I’m trying to consume some .NET web services using JAX-WS. I have generated the Java classes using the wsimport tool. However, when I try to use these (proprietary, not public) web services in Java, I notice that most of the methods and properties provided by the vendor in their C# examples are not avaiable in the generated classes (despite having not encountered any errors when generating the Java classes from WSDL file). Connecting to the web services also works basically.
When I tried to generate a C# class using wsdl.exe from the .NET SDK, all the methods were properly generated.
What would be the best way to consume the .NET web services so that the full functionality would be available in Java, and why does wsimport only generate a small subset of all the methods and properties described in the WSDL file?
Example: in the WSDL file UserManagement.wsdl there is a snippet
<s:schema elementFormDefault="qualified" targetNamespace="http://www.initechsystems.com/initech7/initechws/'> <s:element name="UserSecurityContext" type="s2:UserSecurityContext"/> <s:complexType name="UserSecurityContext"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Token" type="s2:UserToken"/> </s:sequence> </s:complexType> <s:complexType name="UserToken"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Value" type="s:string"/> </s:sequence> </s:complexType> </s:schema>
In C#, I can access the the UserSecurityContext followingly:
UserManagement userMgmt = new UserManagement(); userMgmt.UserSecurityContextValue = new SampleWS.UserRef.UserSecurityContext();
However, in Java I can create the UserManagement object
UserManagement userMgmt = new UserManagement();
but the generated UserManagement object does not have any accessible object SecurityContext, nor getters or setters for such a private object.
These link might be useful to you:
Also. the answer to another question might help.