The fundamental purpose of the WSF is to enable interoperability across dissimilar systems that don't necessarily understand concepts such as method overloading, object inheritance, and polymorphism. Hence web service interfaces should not expose these OO concepts.
A service should expose a document-oriented interface rather than an object-oriented interface. The basic best practices are:
- Flatten object graphs. Don’t expose language-specific object collections, such as maps, lists, or datasets. Instead convert all collections into arrays.
- Don’t use overloaded methods. Each method should have a different operation name.
- Expose a "chunky" interface rather than a "chatty" interface. In other words, don’t expose getter and setter operations for every member in the object class.
It may be necessary to build an abstraction layer between the WSDL interface and the application that implements the service. This abstraction layer performs the necessary mapping between the document-oriented WSDL interface and the application's object model. It also provides much better insulation for flexibility and change.
For best interoperability, developers should use document/literal with the “wrapped” programming convention. .NET uses the “wrapped” style by default. The JAX-RPC specification also requires support for the “wrapped” style. The "wrapped" style supports a programming model that makes document/literal feel like RPC style. "Wrapped" style is very similar to RPC/literal, except for two important distinctions:
- .NET supports "wrapped" style, but it doesn't support RPC/literal
- "Wrapped" style defines a schema of the full soap body (which makes it very easy to validate), while RPC/Literal only defines type information rather that the full schema of the message elements (which makes validation slightly more complicated).
6 comments:
Hi Anne, couldn't agree with you more. Please check out my blog where I posted a link to an article I wrote about the matter for Business Integrayion Journal.
Hi Anne,
I have a two question about wsdl doc/lit wrapped.
1) The output and input messages always must be have the part's name "parameters" ?
for example
<wsdl:message name="Operation_1">
<wsdl:part name="parameters" element="tns:Operation_1Response"/>
</wsdl:message>
<wsdl:message name="Operation_1Response">
<wsdl:part name="parameters" element="tns:Operation_1Response"/>
</wsdl:message>
2) The message's name must be the same that the operation name?
for example:
<wsdl:message name="Operation_1SoapIn" >
<wsdl:part name="parameters" element="tns:Operation_1"/>
</wsdl:message>
<wsdl:message name="Operation_1SoapOut">
<wsdl:part name="parameters" element="tns:Operation_1Response"/>
</wsdl:message>
<wsdl:portType name="WsWrappedWithRefSoap">
<wsdl:operation name="Operation_1">
<wsdl:input message="tns:Operation_1SoapIn"/>
<wsdl:output message="tns:Operation_1SoapOut"/>
</wsdl:operation>
</wsdl:portType>
Thanks!
Ignacio
Sorry, I posted here by mistake.
Hi Annie
Please let me know what are the required changes that need to be done in order to convert a service from RPC\Encoded to Document\Literal. I am using AXIS (Latest Version).
What i did:
In my service that is RPC\Encoded style , i have done changes in its deploy.wsdd.
style="Document",use="literal". and re deployed it.When i accessed its wsdl(axis generates itself) It was according to document\literal. Using this wsdl i generated client code using gsoap. When i made use of that client code it say in its log "SOAP_TAG_MISMATCH" error. i analyed logs and find that may be some namespace issue is thr.
I want to verify my changes and want if u can comment on my issues.
My partner and I stumbled over here from a different web page and thought I might check things out. I like what I see so now i am following you. Look forward to going over your web page repeatedly.
movers in marryland
Wow, this article is really very good, so that I can't say how happy feeling. The article make every detail of the story depicts streaming with the best, and every movement of the characters all write so lifelike, let me see the waves excited. Groom sherwani
Post a Comment