How to create .Net SOAP client for apache web service?

I tried to find Tools to generate WSDL from SOAP Sample, but wasn’t successful.

I’ve started to use WSCF – Web services Contract-First to generate WSDL from XSD, that I’ve created manually , but I have the next problem.  The SOAP example uses collections vector (with apache namespace) and I am not sure how specify them in WSDL to generate expected SOAP messages. Someone suggested  “specify a struct in your wsdl file that contains whatever information your vector objects contain, and return an array of these” but I am not sure, would it help.

I tried to follow Visual Basic .NET Client for Apache SOAP article.

Some other links that I’ve read:
SOAP Interoperability with Microsoft and Apache Toolkits – A step by step guide

Web Services between .NET, Java and MS SOAP Toolkit: Part I

From MSDN Web Services Integration  I found tht for apache web service expected RPC/Encoded messages(See 

Which style of WSDL should I use? FOR MORE DETAILS). From   Web Services Description Language (WSDL) 1.1 specification and

The Difference Between RPC and Document Style WSDL  I found that you can specify

<soap:binding style=”rpc” > and

<soap:body use=”encoded” >.
Unfortunately WSCF – Web services Contract-First  doesn’t allow to specify style/use, and I had to modify it manually .
More examples about RPC/ENCODED styles can be found in Mapping between Java language, WSDL and XML for JAX-RPC applications

Related Discussions:XmlSerializer and SOAP/RPC encoding

specify the type inside an apachesoap:Vector type

I had a lot of problems trying to create WSDL file for RPC/Encoding soap implementation to be acceptable by WSDL.exe.

Related Discussion :WSDL Code Generation . Note that sample ASPX Client of AXIS Web Service  works with documents, not with RPC/Encoded.

Finally I was able to create WSDL file with RPC/Encoding soap implementation, however the structure of SOAP messages created accorfing to WSDL is different to SOAP messages,expected by web service.

I gave up with using WSDL and decided to create and parse SOAP messages in code using plain XML DOM. And it is quite easy and quicker.

Lessons learned:  If you don’t have WSDL file for service and do not have automated tool to create it, do NOT try to create it manually(unless it is trivial). It takes too much time. Using XML DOM is a simple alternative and it is fully under your control, easier to debug and maintain. 

Advertisements