Vishal,
A SOAP runtime system should provide a layer of
abstraction between your message format and the application that implements the
service. Hence the format of the message (Doc/literal vs RPC/encoded) shouldn't
really impact the design of your service. The SOAP runtime system should be able
to marshal and unmarshal the messages, map XML to Java, dispatch the appropriate
application, and transform exceptions into SOAP fault messages for you -- all
based on the WSDL description and deployment descriptor -- regardless of whether
you use RPC or document style messages. Your application shouldn't need to
process XML unless you choose to receive the message as an XML
document.
You should not assume that the SOAP runtime will
validate the document. If you want it to perform validation before processing,
you would need to specify a validation interceptor in your deployment descriptor
(to call a handler in your handler chain). You should assume that the SOAP
runtime will parse the document and deserialize it into Java objects. If you are
using RPC/encoded, then it does the mapping based on the SOAP Section 5 data
model. If you are using Document/Literal, then it does the mapping based on the
XML Schema message description.
When writing a service, you should do what you
would normally do in any Java application -- throw an exception. The SOAP
runtime system should catch the exception and transform it into the appropriate
SOAP fault message. The client SOAP runtime system should be able to
interpret the SOAP fault, and assuming it's a Java system, rethrow the exception
for the client.
Now, of course, these best practices don't
necessarily apply to Web services written using Apache SOAP. You must realise that Apache SOAP is a very old SOAP
implementation that doesn't support WSDL, is very RPC/encoded-centric, and
doesn't support doc/literal according to the standard.
Unless you have legacy applications based on Apache
SOAP, I recommend that you start using Apache Axis (http://ws.apache.org/axis), or any of the
20 or so commercial implementations that fully support SOAP 1.1, WSDL 1.1,
JAX-RPC, and the WS-I Basic Profile.
Best regards,
Anne
|
- design question Vishal Shah
- Re: design question Scott Nichol
- Re: design question Vishal Shah
- Re: design question Anne Thomas Manes
- Re: design question Vishal Shah
- Re: design question Anne Thomas Manes
- Re: design question Vishal Shah
- Re: design question Anne Thomas Manes
- Re: design question Vishal Shah
- Re: design question Anne Thomas Manes
- Re: design question Scott Nichol
- Re: design question Anne Thomas Manes
- Re: design question Simon Fell
- Re: design question Anne Thomas Manes