简体   繁体   中英

How to Consume a SOAP Web Service with a local WSDL in CSharp, Java or Python?

I am trying to consume a public Web Service :

  • The Web Service uses SOAP communication
  • The Web Service doesn't expose the WSDL. It is possible to download it from the creator's website.
  • The Web Service only allows to connect via "whitelisted" static IPs.
  • The Web Service is hosted on GlassFish, so I am guessing it is written in Java.
  • The Web Service specification is rather long and contains many mandatory fields.

I would like to expose the Web Service to different type of developers during a Hackathon challenge, which may be using Python, Java, C# or other programming languages.

I used SOAPUI to test the Web Services and it was rather easy.

When I tried to use the standard packages in Python (SOAPpy) and C#, I had many difficulties. When using Java and CXF, it was a nightmare creating the request object.

How would you go about exposing the Web Service in a way which is friendly to developers?

No changes can be made to the original Web Services.

Thanks in advance!

If you want to access the original web service I recommend use its native protocol (SOAP) even though SOAP can be a major PITA and sometimes library support might be lacking (especially in modern script languages like Python, Ruby) because SOAP is not "cool".

ReST/JSON web services are deemed to be more "easy to work with" by many developers but shoehorning a "wrapper"/proxy on top of the existing web service will probably cause even more confusion and subtle bugs.

If the web service is fairly complicated this could mean this project is not ideal for a hackathon. If I were in your position I'd prepare client stubs (including a simplified library API) for 1-2 languages like Python and Java. For Python check out one of jurko-suds , pysimplesoap , or soapfish and check out which one works best out of the box with your service.

As I feel I'm drifting out of the StackOverflow scope I'll stop here :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM