.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
Asad Ali
Post New Web Links

On adding WCF Service reference element is not created

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :WCF
 

Hi Friends,

I am using x.509 certificate based authentication in my WCF service. In development stage, I created a x.509 certificate using makecert utility. Installed it on my local machine. Added the reference to the certificate in my WCF service. When I added the service reference to my Test App, following element got created in the app.config file of the Test App.

            <endpoint address="http://localhost/MyService/MyService.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint"
    contract="MyService.IMyService" name="wsHttpEndpoint">
                <identity>
                    <certificate encodedValue="Long encoded string..." />
                </identity>
            </endpoi


View Complete Post


More Related Resource Links

On adding WCF Service reference element is not created

  

Hi Friends,

I am using x.509 certificate based authentication in my WCF service. In development stage, I created a x.509 certificate using makecert utility. Installed it on my local machine. Added the reference to the certificate in my WCF service. When I added the service reference to my Test App, following element got created in the app.config file of the Test App.

            <endpoint address="http://localhost/MyService/MyService.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint"
    contract="MyService.IMyService" name="wsHttpEndpoint">
                <identity>
                    <certificate encodedValue="Long encoded string..." />
                </identity>
            </endpoint>

I then deployed the WC

On adding WCF Service reference element is not created

  

Hi Friends,

I am using x.509 certificate based authentication in my WCF service. In development stage, I created a x.509 certificate using makecert utility. Installed it on my local machine. Added the reference to the certificate in my WCF service. When I added the service reference to my Test App, following element got created in the app.config file of the Test App.

            <endpoint address="http://localhost/MyService/MyService.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint"
    contract="MyService.IMyService" name="wsHttpEndpoint">
                <identity>
                    <certificate encodedValue="Long encoded string..." />
                </identity>
            </endpoint>

I then deployed the WC

Problem adding a Service Reference

  

Hello all.

I am developing a Web Application using Visual Studio 2010 in witch I have to add a Service Reference to http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl.

The problem is that my company's network requires a proxy authentication. So when I enter the "Add Service Reference" dialog, paste the url and click "go" I get a "(407) Proxy Authentication Required" error and cannot add the service.

I also tried using svcutil but the result, obviously, was the same.

How can I work around this? Is there somewhere I can specify the required proxy? Googling around, I found some comments that it can be specified in the Web.config, but I can't find more details on how to do this.

Thanks in advance.


adding a service reference throws a contract error

  

Hi

I added a service reference via the add service reference method. I can see all of its services in the intellisense but when I run the project and it executes the line where I instantiate the service : MyProjectName.ServiceReferenceName.IServiceReferenceClient  client = new  MyProjectName.ServiceReferenceName.ServiceReferenceClient;

it throws this error:

Could not find default endpoint element that references contract 'ServiceReferenceName.IServiceReferenceClient' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

 

Now this within my class library and I have added the service reference in my class library project.

Kind Regards

Ernst


finding url to use when adding a service reference

  

I have sample code from stamps.com to access their SOAP style web services.  I would like to create a new project and add a service reference to it for the Stamps.com soap web service. How do I get the correct URL from the working project to use when adding the service reference to the new project?

I click properties of the web reference in the working stamps.com supplied project.  The web reference URL is https://swsim.testing.stamps.com/swsim/swsim-v4-wsdl.aspx

In another project, I click "add service reference", then paste that URL into the address line and click Go. Get back an error:
There was an error downloading 'https://swsim.testing.stamps.com/swsim/swsim-v4-wsdl.aspx'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'https://swsim.testing.stamps.com/swsim/swsim-v4-wsdl.aspx'.
There was no endpoint listening at https://swsim.testing.stamps.com/swsim/swsim-v4-wsdl.aspx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.

thanks,

 


while adding service reference in .net 2008

  

The document at the url https://hostname/app1/abc.svc was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'There was an error downloading 'https://internalsystemname/app1/abc.svc?disco'.'.
  - The request failed with HTTP status 502: Proxy Error ( No data record is available. For more information about this event, see ISA Server Help.  ).
- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'https://hostname/app1/abc.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.
The document at the url https://hostname/app1/abc.svc was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'There was an error downloading 'https://internalsystemname/app1/abc.svc?disco'.'.
  - The request failed with HTTP status 502: Proxy Error ( No data record is available. For more informatio

Problem while Adding reference of my Wcf Service

  

Hi

I have my wcf service hosted in the iis of the my development server.I am able to directly access the url of the service from both the server and the client browsers.I am also able to see the wsdl generated.

But when i add service reference from Visual studio 2008/2010,i get the following error..

The document at the url http://something.svc was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'http://something.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'DISCO Document' is 'There was an error downloading 'http://something.svc?disco'.'.

 - The request failed with HTTP status 503: Service Unavailable.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: 'http://something.svc'.

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.

The remote server returned an error: (401) Unauthorized.

If the service is defined in the current 

Problem adding service reference to web services in VS 08

  

Hi,

I’ve been trying to write some C# in Visual Studio 2008 to leverage SharePoint Web Services. I’ve scoured the web for help on this problem. I’m just beginning to learn .NET programming, but I’ve done a bunch with SharePoint Web Services with javascript and then with jQuery.SPServices.

 

If I start a new Console Application project and try to add a Service Reference, I put in my url: …/_vti_bin/Authentication.asmx and try to attach it. It tells me that there’s a problem with the certificate (which I get in the browser and SP Designer).

 

I get this error:

The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'https://example.com/myCollection/_vti_bin/Authentication.asmx'.
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic Realm="example.com"'.
The remote server returned an error: (401) Unauthorized.
If the service is defined in the current solution, try building the solution and adding the service reference again.

If I click Advanced and Add Web Reference, I try again. This time, the browser window brings up the form we use to authenticate. From what I understand about the architecture, the MOSS

Custom tool error: Failed to generate code for the service reference 'CompanyService'. Please che

  

A little background because I feel I have an out of the ordinary architecture in place and don't know if this is contributing to the problem. 

We have an existing ASP.net application that is undergoing expansion.  The new functionality is all written in Silverlight 4.  As part of that expansion I gutted all the old Linq to SQL and put Entity Framework 4 into place.  To do this I created a standard .net Class Library and added my edmx files there.  Naturally, the business entities created by this cannot be used in Silverlight.  So I created a Silverlight Class Library and added all the business entities to that Silverlight Class Library as linked files.  I changed the name space to be the same.

So I have the following assembly / namespaces

Company.Project.Dal.csproj / Company.Project.Entities (.net 4 class library)

Company.Project.Entities.csproj / Company.Project.Entities (SL4 class library)

With this architecture I was able to share my business entities with my SL enabled web services, my asp.net projects, my silverlight projects.  Really it's a beautiful thing.

Once this was done I added "message" classes to Company.Project.Dal and again shared them with the other entites using linked files.  These messages are things like MyObjectRequest; they are class

Adding carriage returns between 2 dynamically created controls in an HtmlTableCell

  

The title pretty much explains it. Here is what i'm trying to do...

 Private Sub LoadGrid_CommentsField(ByVal Row As HtmlTableRow, ByVal BookingNumber As String, ByVal CommentsText As String)
  Dim Txt As TextBox
  Dim Cmd As ClickOnceButton.ClickOnceButton

  Txt = New TextBox
  Txt.ID = "txtComment_" & BookingNumber
  Txt.CssClass = "TFAppControls"
  Txt.TextMode = TextBoxMode.MultiLine
  Txt.MaxLength = 500
  Txt.Width = New Unit(95, UnitType.Percentage)
  Txt.Text = CommentsText
  Row.Cells(cComments).Controls.Add(Txt)

  Row.Cells(cComments).InnerHtml &= "<br/>"

  Cmd = New ClickOnceButton.ClickOnceButton
  Cmd.DisableAfterClick = True
  Cmd.Text = "Save Comments"
  Cmd.ID = "cmdSaveComments_" & BookingNumber
  Cmd.CssClass = "TFAppButtons"
  Cmd.EnableViewState = False
  Row.Cells(cComments).Controls.Add(Cmd)
 End Sub

On the line where i try and update the InnerHtml, i get the following error; "Cannot get inner content of  because the contents are not literal."


Cannot get service reference for Net.tcp service hosted in IIS7

  
HiI've got a service that I want to host in IIS7. The service runs over net.tcp (currently without security), but I am unable to create a service reference to it, or call it, using the net.tcp protocol. My event log is populated with lots of errors related to ASP.NET and System.ServiceModel, 3.0.0.0The relevant services are installed and running (net.tcp port sharing service and net.tcp listener adapter).O/S : Window7 RTMDevStudio: 2008I publish the webservice to IIS7 and I get a valid page when navigating to the published .svc file (which tells me to use svtutil.exe and point it at the net.tcp endpoint).For that, I get this error :    The message could not be dispatched because the service at the endpoint address 'net.tcp://gedm-desktop.profiledc01.appdevelop.local/ManageAVMEP/ManageAVMAgent.svc/mex' is unavailable for the protocol of the address.Googling the problem leads me down several blind alleys :(I cannot determine what is causing the net.tcp listener to keep stopping? Everything is fine if I use the wsHttpBinding.Any tips or pointers to a course of action would be appreciated.ThanksGed My event log is full of errors (here is a sample) :-------An error occurred while trying to listen for the URL '/LM/W3SVC/1/ROOT/ManageAVMEP'. This worker process will be terminated. Sender Information: net.tcp Exception: System.ServiceModel.WasHos

Adding web reference

  
Hi All,I have VS 2008 professional. I have created a web service. In one of my websites I want to add this web service. When i clicked on add web reference > web service on local machine, it is giving the error The Web services and Discovery Documents available on your VS.NET developer machine are listed below. Click the service link to browse that service. There was an error while enumerating services on local machine: Active Directory Services cannot find the web server. A possible cause for this is an incompatibility between versions of Internet Information Server (IIS) on the client and the server. Another possible cause is that IIS is not installed on the local machine, or the user identity under which you are running may not have permissions to view websites on this machine. To view websites on this machine, make sure that you run Visual Studio as administrator. On Windows Vista computers with IIS installed, make sure that IIS Metabase and IIS 6 configuration compatibility feature is enabled. If i run the VS as administrator and try to do the same thing, it will show The Web services and Discovery Documents available on your VS.NET developer machine are listed below. Click the service link to browse that service. None - No Web services were found on the local computer. Plz help to solve this.Smitha

Adding a reference insanity

  
So I have a solution that is somewhat designed like this|Solution|-project DAL|-project commons|-project ServerSideStartUp       -public class startUp (public constructor startUp)|-project windowsService      -service service1Now I can reference commons from the windowsService with no problems. I can also reference serverSideStartup. When I add the reference and start typing code I even get the correct intellisence. At this point there I would have no reason for being here. Unfortunately after I build I get Error    3    The type or namespace name 'ServerSideStartUp' could not be found (are you missing a using directive or an assembly reference?)    Which to me would say I forgot to reference it. But 2 minutes before I added the reference and was even using the intellisence to help write the code.Have any of you ever run into this problem? Also if I add or remove another reference the project knows about the reference.Any ideas or advice?

Adding AJAX-enabled WCF Service to the Solution throws an error

  
Hi I am just trying to learn Ajax enabled WCF service, when I try to create a new web application and add new item "AJAX-enabled WCF Service" I get an error message that "The extension of type 'System.ServiceModel.Configuration.WebScriptEnablingElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not registered in the extension collection 'behaviorExtensions'. I had .net2.0/VS2005 and then I installed VS2008. I thought it might be an issue with Machine.config. So I am attaching my machine.config info. <?xml version="1.0" encoding="UTF-8"?>    <!--    Please refer to machine.config.comments for a description and    the default values of each configuration section.     For a full documentation of the schema please refer to    http://go.microsoft.com/fwlink/?LinkId=42127     To improve performance, machine.config should contain only those    settings that differ from their defaults.    -->    <configuration>      <configSections>    <section name="appSettings" type="System.Configuration.AppSettingsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, Publi

Can't Add Service Reference in VS 2010 to a net.tcp endpoint

  
I've got a service running (well, it doesn't crash), but when I try to add a Service Reference to it, I keep getting Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:55555/mex'. Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:55555/mex'. If the service is defined in the current solution, try building the solution and adding the service reference again. The pertinent parts of my config file are:   <netTcpBinding> <binding name="ReliableDuplexBinding" closeTimeout="00:00:10" openTimeout="00:00:10" receiveTimeout="00:00:30" sendTimeout="00:00:15" maxBufferPoolSize="1048576" maxBufferSize="262144" maxReceivedMessageSize="262144"> <readerQuotas maxDepth="33" maxStringContentLength="100000" maxArrayLength="131072" maxBytesPerRead="262144" maxNameTableCharCount="54000" /> <reliableSession inactivityTimeout="05:00:00" enabled="true" /> <security mode="None"> <transport> <extendedProtectionPolicy policyEnforcement="Never" /> </transport> </security> </binding> </netTcpBinding> <behaviors> <serviceBehaviors> <behavior nam

Deploy XBAP application with WCF Service Reference into multiple environments

  
Hi, we have a multiple environment setup (local, Development servers, QA servers, prod servers, etc.) and we are building an XBAP application that uses WCF Services to connect to databases.  We code and unit test everything locally and then deploy to our Development servers for more thorough unit testing.  The issue that we are having is that we don't see how to update the deployed XBAP application to use the Development server deployed WCF Service.  The only way we've been able to do this is by having to change the reference on my local machine, complie, and redeploy the XBAP.Question:  How do we configure a deployed XBAP's Service Reference to point to the same service on a different server than what it was originally compiled/deployed with?  (Like in some configuration file...NOTE: but we also don't see a config file after deploying the XBAP.)  We don't want to have to update the Service Reference for QA, Prod, Training, Stage, etc. on our local machines, compile and redeploy every time we need to migrate the application to a new environment.Thanks!

How do I generate service reference activities in my rehosted designer

  
My desginer is used to create lots of xamlx workflows.  These are hosted in app fabric. From Visual Studio I can add a service reference that points to my workflows, and it generates activities in my toolbar that I can use to call my service from another workflow. I'd like to do the same thing from my rehosted designer.  I figured it would be something like calling svcutil.exe, but couldn't find any information on this. Does anybody know how to create xaml activities by pointing at a service for a workflow designer rehost?   CheersJason Bolstad
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend