How do you call a web service in Java with only XSD and NO WSDL?

余生颓废 提交于 2019-12-23 17:02:24

问题


I have a web service outside of my company that provides no WSDL for their service. They do provide:

  • a detailed document on how to POST to their service
  • what a SoapEnvelope should look like
  • and even an .xsd that I can use to create the message to put in the SOAP <env:Body></env:Body> of the call.

How do you make a SOAP call to a web service without a WSDL (in Java)? I need a tool that can take my JAXB-formatted XML message, wrap it in a SOAP Envelope, and send it as HTTP POST to some web service (with SSL and Certificates).

Are there tools that make this easy? I've looked at CXF with JAX-WS dispatch briefly, but since most examples and documentation expect a wsdl document, I am not sure if CXF is what I should be using.


回答1:


Did they give you the URL? Try to surf to http://the-url-of-service-that-does-not-provide-wsdl/wsdl

this is the standard URL where you should download the WSDL file (unless they coded everything by hand).

OK, if not you have 2 ways

  1. Create the WSDL yourself based on their document.

  2. Parse the SOAP XML using any tool you know. For example JAXB, Digester, DOM



来源:https://stackoverflow.com/questions/6752420/how-do-you-call-a-web-service-in-java-with-only-xsd-and-no-wsdl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!