简体   繁体   中英

Soap client service using java without WSDL - How to?

I use JAX-WS thats ships with jdk to create soap client. Now, the service provider isn't exposing the wsdl. How to create soap client without wsdl, if I know the provided services?

Edit: I have the freedom to use any soap api/tool, not restricted to JAX-WS.

Edit2: Here is the message that is shown when the service url is hit. Metadata publishing for this service is currently disabled. And suggests to configure service behavior configuration. I understand the service is done in .Net. But How do I use the provided service behavior related details to access the service in Java?

You can use HttpClient directly but you must hand-code each xml message you send and parse each message you receive. You can also manually create your objects that match your xml and use jaxb to marshall/unmarshall messages.

You can create a client service provider which extends javax.xml.ws.Service , and then override service constructor accepting URL of the remote service you currently have at hand.

public class Foo extends Service
{ 
  ... 

  public Foo(URL wsdlLocation)
  {
    super(wsdlLocation, SERVICE);
  }
}

And then when building your Provider Binding, you explicitly pass the URL to the service interface.

Foo service = new Foo(url);
BindingProvider binding = (BindingProvider)service;

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