0

From a .NET application, how do I consume a Web Service developed using gSoap c/C++ library?

I can create a C/C++ client using gSoap library to consume the web service. But I need to consume it from within a .NET (C#) application. I tried Adding a Web Reference but that doesn't seem to work.

Would I need to work with raw Soap Packets?

byte
  • 1,665
  • 1
  • 19
  • 36

2 Answers2

1

You can try to call the Web Service dinamically (without adding the reference)

You can also try to build a WCF client, and generate the managed source code file for a proxy using the ServiceModel Metadata Utility Tool (Svcutil.exe).

Finally, the ProxyFactory project lets you build the proxy classes without WCF

Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206
  • Thank you but I have resolved the Web reference error in other way. Upvoted your answer for alternate approaches. – byte Jul 16 '10 at 10:47
1

The reason Web reference was not working was the hand crafted WSDL. It worked fine with gSoap library and gSoap C/C++ code generrator nut not with VS. With some changes in the way WSDL was written, I am now able to consume the gSoap C/C++ web service by adding a Web Reference in Visual Studio and also by using HTTP GET method.

Steps taken -

  • Instead of adding Web reference, use wsdl.exe in verbose mode to generate code using thee gSoap WSDL and XSD file
  • change the WSDL file to resolve any error and warnings reported by wsdl.exe
  • Once wsdl.exe can successfully generate code using the WSDL, you can now use VS add web / service reference wizard
byte
  • 1,665
  • 1
  • 19
  • 36