Questions tagged [service-reference]

A Service Reference is a Visual Studio construct which generates code from service metadata (possibly from a service WSDL). It produces classes, interfaces, and configuration which can be used by client code to access the service.

A Service Reference is a Visual Studio (and Monodevelop) construct which generates client code from service metadata (possibly from a service WSDL) from a SOAP web service. It produces classes, interfaces, and configuration which can be used by client code to access the service.

A Service Reference is the modern equivalent of the legacy "Web Reference" feature. Web References should not be used in new development unless absolutely necessary.

See

457 questions
144
votes
3 answers

How to generate service reference with only physical wsdl file

I have been creating and consuming web services for years and always have been able to use Visual Studio to create a service reference from the client. I have a third party service I need to work with and they refuse to open their security so I can…
kfoster
  • 1,623
  • 2
  • 11
  • 11
139
votes
13 answers

Service Reference Error: Failed to generate code for the service reference

I have a Windows Service Solution and am trying to add a service reference to a Hermes(Opensource ebms message server) Web Service in VS2010. I can find the Web Service using it's URL, but when I try and populate the Service reference I get the…
jheppinstall
  • 2,338
  • 4
  • 23
  • 27
93
votes
4 answers

What are the WCF Service Reference .datasource files?

What are the .datasource files that are automatically generated by "Create Service Reference" in Visual Studio? The comment in the file is this: This file is automatically generated by Visual Studio .Net. It is used to store generic object…
Andy White
  • 86,444
  • 48
  • 176
  • 211
88
votes
13 answers

What does this WCF error mean: "Custom tool warning: Cannot import wsdl:portType"

I created a WCF service library project in my solution, and have service references to this. I use the services from a class library, so I have references from my WPF application project in addition to the class library. Services are set up straight…
stiank81
  • 25,418
  • 43
  • 131
  • 202
32
votes
4 answers

can't access the added service reference

I've added a service reference to my mvc4 web project and left it with the default namespace "ServiceReference1", but when I wanna use that namespace, visual studio can't find it, like it doesn't exist, the webservice is up and working fine. What…
arash moeen
  • 4,533
  • 9
  • 40
  • 85
27
votes
2 answers

Version-control: svcmap, disco, xsd, wsdl, svcinfo and datasource files

We have a webservice named, let's say Foo. So there is a Foo.svc file and a code behind Foo.svc.cs. We add a silverlight project and wish to use the Foo.svc services so we add a Service Reference and call it's namespace FooBar. This creates the…
23
votes
5 answers

Including a service reference from a class library

I have a C# class library and a startup project (a console app). The class library includes a service reference to a web service. When I try to run the project, I get an InvalidOperationException because the startup project isn't reading the class…
JR.
  • 5,840
  • 9
  • 31
  • 34
19
votes
1 answer

Change service reference URL in code

I'm working in a Windows Phone 8 project and in order to use some webservices I added a service reference with a specific URL. My problem is the URL because it changes fom time to time so I need to let the user insert the new URL from some menu…
sparcopt
  • 416
  • 2
  • 8
  • 22
18
votes
7 answers

WCF common types not reused

Hint: This questions has many duplicates, but none of the solutions works for me. What I have is a web service and a client, both having references to a shared assembly "DataModel". I'm creating the service proxy using the "Add service reference..."…
AndiDog
  • 68,631
  • 21
  • 159
  • 205
18
votes
1 answer

Service reference - why reuse types in referenced assemblies

I'm following instructions to add a service reference to my project and, by default, the "reuse types in referenced assemblies" is ticked. If I leave it ticked, I get ambiguous warnings on controls like Label, which I have to declare fully now. If I…
Graham
  • 7,807
  • 20
  • 69
  • 114
16
votes
2 answers

How can you control the file names for .NET Service References?

Windows has a limitation of 259 characters in paths. Unfortunately, this is starting to cause problems for us due to some of our Service Reference names. For example, we have our TFS branch with an already-long path, and then .NET service…
Jerad Rose
  • 15,235
  • 18
  • 82
  • 153
16
votes
3 answers

Where do I set the CookieContainer on a Service Reference?

When adding WebService Reference to an ASMX Service on a .NET 2.0 project for example, var objService = new NameSpace.groupservices(); there exists, objService.CookieContainer = new System.Net.CookieContainer(); When adding ServiceReference to an…
user677607
15
votes
5 answers

System.Net.WebException: The request was aborted: the request was cancelled

I have a WCF service that has been giving me this error under load conditions (and I can't seem to recreate the error otherwise). We've been trying to find a way around it for about a week now with no such luck.. The error I see has two parts to…
15
votes
4 answers

Error adding service reference: Type is a recursive collection data contract which is not supported

I tried to add a service reference to a WCF service that resides in the same solution from an ASP.NET MVC 4 project but failed. I got a error saying: Custom tool error: Failed to generate code for the service reference 'XXX'. Please check other…
user1532001
  • 151
  • 1
  • 3
14
votes
4 answers

VS2012 Add Service Reference not updating config file

I have created a new IIS hosts WCF service using the webHttpBinding which is currently running on on IIS Express on my development machine and when I try to "Add Service Reference" the service is correctly built and the Reference.cs file looks fine…
Phil Murray
  • 6,396
  • 9
  • 45
  • 95
1
2 3
30 31