It always helps to think of it from the SOAP on the wire perspective:
 
In all cases, the SOAP Body can have at most one child element. This child element is what Axis (or any SOAP engine) uses to dispatch the request. It is the unique signature of the message. If your send more than one child element in the SOAP Body, the SOAP engine will ignore all elements after the first one.

When using RPC style, the WSDL does not explicitly define the child element of the SOAP Body. Instead it defines the operation name and a set of parameter types (each parameter type defined as a separate part in the input message). The SOAP engine generates the child element based on that information. The generated child element has the same name as the operation, and it has a child accessor element for each of the parameter types. The programming model when using RPC style is similar to RMI -- invoke a method on your interface and pass it a set of parameters. e.g.:

return method(param1, param2)

When using Document style (both wrapped and unwrapped), the WSDL explicitly defines the child element of the SOAP Body. In both cases, the message can have at most one message part, and that part must reference an element definition rather than a type definition. The wrapped style is a programming convention that simulates the RPC style -- essentially you are explicitly defining a wrapper element which contains a set of child accessor elements for each of your parameters. But rather than defining these parameters as maessage parts, you must define these parameters as child elements of your wrapper element (using the <sequence> compositor). If you follow this convention, then you can use the RPC style programming model. If you do not follow the wrapped programming convention, then you cannot invoke the operation using more then one parameter -- you must define a bean that contains all your parameters, e.g.:

return method(bean)

I hope it's more clear now.

Anne

On 1/19/06, Dies Koper <[EMAIL PROTECTED]> wrote:
Hello Anne,

I think I still do not quite understand the consequences of the
different styles.
Looking only at document style, I understood there is wrapped and
unwrapped (bare?).
With wrapped you have to have at most 1 part in your soap:operation.
So I understood this as you can have multiple parts with unwrapped.
Yet, when you use multiple parts, only the first one is serialized. Is
that what unwrapped is and why everybody advices not to use it? Because
you can define the parts, but they won't get send anyway? Or are there
any usecases where this is desireble?
As I understand, I do not quite get it yet..

Thanks,
Dies


Anne Thomas Manes wrote:
> It is not a bug. Document style does not support parameters -- it takes a
> document in and returns a document. If you would like to use an RPC
> programming style with document/literal, then you must use the WRAPPED
> style. Axis will then automatically generate a wrapping document-style
> element for your parameters.
>
> Anne
>
> On 1/19/06, Dies Koper <[EMAIL PROTECTED] > wrote:
>
>>Hello Nicolas,
>>
>>I have noticed the same, I think it is a bug.
>>Use document/literal(WRAPPED) instead of document/literal when you
>>create your WSDL (-y WRAPPED, IIRC). That should work.
>>
>>Regards,
>>Dies
>>
>>
>>Nicolas De Loof wrote:
>>
>>>I'd like to use Java2Wsdl to build a WSDL for my business service
>>>Business method is "public boolean isSiteDroit(String idSiu, String
>>>idDroit)"
>>>
>>>It works fine in "rpc" mode, but in document mode, Java2WSDL creates
>>>this WSDL message :
>>><wsdl:message name="isSiteDroitRequest">
>>>     <wsdl:part element="impl:idSiu" name="idSiu"/>
>>>     <wsdl:part element="impl:idDroit1" name="idDroit"/>
>>></wsdl:message>
>>>
>>>When I generate an axis client using WSDL2Java The SOAP message contains
>>>in its body two elements
>>><soap:body>
>>>  <idSiu>x</idSiu>
>>>  <idDroit1>1</idDroit1>
>>></soap:body>
>>>
>>>The business method is invoked, but receives null as second argument.
>>>
>>>When running debugger in axis code, I've found only the first soap
>>>parameter is read and used for method invocation.
>>>
>>>Is this expected ? How to build my wsdl to work ?
>>>
>>>Nico.
>>
>>
>>--
>>Dies KOPER <[EMAIL PROTECTED]> (changed on 1 July 2005)
>>Fujitsu Ltd - MWPF1  (changed from MWPF3 on 21 Nov 2005)
>>2-15-16, Shin-Yokohama, Kouhoku-ku, Yokohama, 222-0033, Japan
>>Tel. +81(45)-475-5605  (internal 7181-4217)
>>
>>
>
>

--
Dies KOPER <[EMAIL PROTECTED]> (changed on 1 July 2005)
Fujitsu Ltd - MWPF1  (changed from MWPF3 on 21 Nov 2005)
2-15-16, Shin-Yokohama, Kouhoku-ku, Yokohama, 222-0033, Japan
Tel. +81(45)-475-5605  (internal 7181-4217)


Reply via email to