views:

117

answers:

3

Hi.

I have a WSDL file (the web-service has written by .NET) and i can generate the java web-service client proxy classes and codes in IntelliJ IDEA 7.0.4 by its tool. the web-service has a soap request header , but i can't see any property or method in auto generated Java proxy classes and codes to set the request header. (but when i use Visual Studio 2008 to generate the proxy classes for C#, an object is created in web-service proxy class as the header so i can set fill it simply)

what should i do in Java?

A: 

I'm not sure what IntelliJ uses to generate proxy classes. AXIS maybe?

I do know that if you want to do this with CXF, when you are defining your client, the best way is to create a class that implement SoapInterceptor and then set it as an outbound Interceptor.

public void handleMessage(SoapMessage message) throws Fault {
           message.getHeaders().add(QName.valueOf("foo"), "bar");
   }

Ultimately though, it's going to be hard for you to figure out the right way to handle this if you don't know the library your IDE is using.

jcalvert
A: 

All the classes for a complete web service client can be created by wsimport tool included in jdk.

http://download.oracle.com/javase/6/docs/technotes/tools/share/wsimport.html

You only need to specify the wsdl address.

Elias