1

I need to add a service reference to our 3rd party's web service but I'm told they do not host the endpoint wsdl. I do however have a local copy of the wsdl so can anyone give me any pointer as to the best way to do this?

thanks

DarkW1nter
  • 2,933
  • 11
  • 67
  • 120
  • You can create service reference from wsdl local file. See http://stackoverflow.com/questions/12710281/how-to-generate-service-reference-with-only-physical-wsdl-file [1]: http://stackoverflow.com/questions/12710281/how-to-generate-service-reference-with-only-physical-wsdl-file – Juraj Majer Mar 12 '15 at 15:34
  • thanks for the reply. I can add a reference to the local wsdl, unsure to to send the request to the actual endpoint, if you know of any posts with examples? Can't seem to find what Im looking for. – DarkW1nter Mar 13 '15 at 15:04

1 Answers1

1

To access 3rd party web service using a wcf client you have to:

1.) Create service reference from wsdl file. See How to generate service reference with only physical wsdl file

2.) Instantiate the WCF client and call the required method. Sample code:

// Create a client object. CalculatorClient class was generated in service reference code.
CalculatorClient calcClient = new CalculatorClient();
// Call the Add service operation.
double value1 = 100.00D;
double value2 = 15.99D;
double result = calcClient.Add(value1, value2);
Console.WriteLine("Add({0},{1}) = {2}", value1, value2, result);

For more see Instantiate the WCF client proxy section in Accessing Services Using a WCF Client

Community
  • 1
  • 1
Juraj Majer
  • 567
  • 5
  • 10