Wednesday, November 22, 2006

SOAPENC type mappings

The WS client in the previous post cannot handle the SOAPENC type mappings.
To handle types in this namespace, we can make use of the helper class called DefaultSOAPEncodingTypeMappingImpl.

Class cl = DefaultSOAPEncodingTypeMappingImpl
.getSingleton()
.getClassForQName(qname, null, null);
if(cl == null){
cl = DefaultSOAPEncodingTypeMappingImpl
.getSingletonDelegate()
.getClassForQName(qname);
}


And its better to get the parameters for the operation in the correct order as follows:

List inputParts = input.getOrderedParts(null);
This returns a list with ordered input parts, so that the input parameters for the invoke() method can be set in perfect order as required.

And one more important thing about WS clients is that when you are writing a client for a web service provided using .Net, the SOAPActionURI property has to be set for it to work properly.

No comments: