views:

45

answers:

2

I am trying to mock up a java web service that isn't complete but has been designed, i.e. I have the wsdl. I've implemented a .net web service with the classes and methods required with the same names, etc. However when I request the wsdl from the .net web service, the proxy classes generated contain the suffix "Soap", .e.g instead of FundService, I get FundServiceSoap.

How do I remove the Soap bit so that my generated classes will match the ones when I eventually point it to the completed Java web service.

+1  A: 

The first question you need to ask is whether the generated WSDL is the same as the original Java WSDL. It may be, but it may not be.

In particular, you should ignore the proxy classes in this case. They would probably have had "Soap" at the end of them, even if generated from the original Java WSDL.

Most likely, the generated WSDL will not be the same as the original WSDL. It should be equivalent, but it may very well not be identical. If you need an identical WSDL, you're pretty much out of luck since you're using ASMX web services. The best you can do is to place the original WSDL somewhere on the same web site as the mock service. Clients can then get the original WSDL via a URL that points to Service.wsdl instead of to Service.asmx?wsdl.

BTW, WCF allows you to specify the location of the WSDL to be returned when metadata (WSDL) is requested.

John Saunders
+1  A: 

If you have the WSDL, you can generate a server stub for it, wsdl.exe /serverInterface the.wsdl (or similar, depends on which exact version of .NET you're using). This will generate you a server stub of a service that conforms to the WSDL you already have.

superfell