SOAP Envelope using implicit header vs explicit header vs wrapped body
Hi,
I'm using JCaps v. 5.1.2 and my question is related to eInsight, Soap and Wsdl's.
Background:
In addition to the schema-types our services operate on as input/output; we see the need of adding an extra common schema-type to follow all our service requests.
The extra common schema-type can be seen upon as the envelope that follows each service transaction.
Right now we use WS, but in time we should be able to support JMS as protocol for our services. As far as I see I have 3 choices of patterns to select from:
1. Add the Envelope as a wrapper on each input/output schema-type of a service.
2. Add the Envelope using the SOAP implicit header but not as a wrapper on the service-types for input/output.
3. Add the Envelope using the SOAP explicit header but not as a wrapper on the service-types for input/output.
Question:
What would be the preferred pattern for implementing an envelope?
Regards,
Erlend Ytterstad
# 1
I performed a short test on this topic.
The wrapper pattern would be nice if I could use the xsd attribute abstract and the substitution group. However this have side effects on some common used client tools, in example SoapUI v1.7.1. NetBeans5.5 recognized the abstract payload nicely.
If abstract attribute is not used I would end up with a wrapper definition type that I can't just import to my input/output definitions. If a change in the wrapper type in the future is needed; then it would involve a massive update on each service.
I have not investigated other methods to implement the wrapper pattern.
Using the explicit header would involve Rpc. Rpc has weaknesses with the encoding style regarding lack of support for the constraint of complex data, and lack of support for data validation.
The implicit header looks as the best choice in my case but I'am still evaluating..
Tip: If you plan to use implicit types in eInsight, don't forget to create a file in your user profile directory with the extention: .ecrc before you import your wsdl. It should contain the line: com.stc.wscommon.design.codegen.impl.WsdlMsgNormalizer=enabled
Regards,
Erlend
# 2
Further findings on implicit header:
I had to add the following extra lines to the .ecrc file:
com.stc.wscommon.design.codegen.impl.WsdlMsgNormalizer.soapencArrayTypeName=
com.stc.wscommon.design.codegen.impl.WsdlMsgNormalizer.resolveRPCBinding=enable d
I had to define the value of the soapencArrayTypeName with the value of the part name of the header message definition.
After importing the implicit service definition I found that it is converted into a explicit definiton. Further findings also indicates RPC on explicit header can be avoided by simply defining the soap operation with style="document".
This indicates that both the implicit and explicit pattern can be used.
Regards,
Erlend