3

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?

3
  • 1
    Do you have a sample request XML? Or maybe ask them for the WSDL? Commented Apr 26, 2012 at 9:35
  • Yep, I have both request and response XMLs. Commented Apr 26, 2012 at 9:41
  • All you need is a Schema Definition File.. or you can just create wsdl using eclipse.. wiki.eclipse.org/index.php/Introduction_to_the_WSDL_Editor Commented Apr 26, 2012 at 10:16

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Is there any example?
0

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;

3 Comments

Used BindingProvider.ENDPOINT_ADDRESS_PROPERTY to override the endpoint.
See stackoverflow.com/a/8975619/2424205 for how to override the BindingProvider.ENDPOINT_ADDRESS_PROPERTY.
I do not have WSDL file, how can I give wsdlLocation url for constructor argument? @Bitmap

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.