Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to reverse-engineer a web service interface from a WSDL file?

I've inherited a WSDL file for a web service on a system that I don't have access to for development and testing.

I need to generate a web service that adheres to that WSDL. The wrapper is .NET, but if there's an easy way to do this with another platform, we might be able to look at that. The production web service is Java-based.

What's the best way to go about doing this?

Note: The inherited wsdl doesn't appear to be compatible with wsdl.exe because it doesn't conform to WS-I Basic Profile v1.1. In particular, the group that passed it on mentioned it uses another standard that the Microsoft tool doesn't support, but they didn't clarify. The error is related to a required 'name' field:

Error: Element Reference '{namespace}/:viewDocumentResponse' declared in
schema type '' from namespace ''
       - the required attribute 'name' is missing

For clarity's sake, I understand that I can easily create a .NET wrapper class from the WSDL file, but that's not what I need. It's like this:

Update: The original web service was created using Axis.

Diagram of system showing unavailable web service and mock web service http://paulw.us/blog/uploads/SO-WSDL-Question2.gif

like image 684
paulwhit Avatar asked Nov 03 '25 13:11

paulwhit


2 Answers

You may find useful the command line utility wsdl.exe of .NET by using the /serverInterface option. According to the documentation:

Generates interfaces for server-side implementation of an ASP.NET Web Service. An interface is generated for each binding in the WSDL document(s). The WSDL alone implements the WSDL contract (classes that implement the interface should not include either of the following on the class methods: Web Service attributes or Serialization attributes that change the WSDL contract). Short form is '/si'.

like image 155
Panos Avatar answered Nov 05 '25 06:11

Panos


We are using WSCF - Web Services Contract First tool from Thinktecture to do web service development creating XSD schema first and then generating service interfaces using this tool. It may be useful to generate service interfaces from WSDL but I have not tried this yet myself.

like image 23
Vlad N Avatar answered Nov 05 '25 04:11

Vlad N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!