• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How could there be multiple wsdl:message parts for a response?

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I saw several WSDLs where there were more than one part defined for response under wsdl:message. Eg is given below taken from specification.



I understand that having multiple parts for input is quite common as we may pass on several method arguments and I can think of each argument as one part defined. But a method call can return only one object (or primitives). Atleast I have not encountered any occasion where multiple items can be returned in java (not sure about other languages). Then how does it map to the output message defined like above.

Also under section of 2.4.6 Parameter Order within an Operation in the above specification

The part name order reflects the order of the parameters in the RPC signature
The return value part is not present in the list
If a part name appears in both the input and output message, it is an in/out parameter
If a part name appears in only the input message, it is an in parameter
If a part name appears in only the output message, it is an out parameter

Can somebody explain me this mapping this to a small java based SEI ?
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kumar,

The style you are discussing is called RPC messaging style (opposed to Document style). In RPC messaging style, one can have more than one part in the request and more than one part in the output. In JAX-WS and it's predecessor JAX-RPC, the javax.xml.ws.Holder class are used to map out and in/out parameters to method parameters. This is a generic class that can hold any Java class as it's value.
 
Kumar Raja
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hany Shafik wrote:Hi Kumar,

The style you are discussing is called RPC messaging style (opposed to Document style). In RPC messaging style, one can have more than one part in the request and more than one part in the output. In JAX-WS and it's predecessor JAX-RPC, the javax.xml.ws.Holder class are used to map out and in/out parameters to method parameters. This is a generic class that can hold any Java class as it's value.



Ok, let me try to put this with an eg

say my method is defined as public Object method(Object o, Object b);

I can map this above method in WSDL using two message elements, request and response. Out of these the request has two parts and response has one part. So my argument is, the response element can not have more than one part at any point of time.But if not, then an example would be appreciated.
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
First of all, have you seen the following from the WSDL 1.1 specification (section 2.6.4)?
http://www.w3.org/TR/wsdl#_parameter
In order to see what kind of Java code such constructs (in/out and out parameters) result in, I would recommend you to create a WSDL that contains operations that have such parameters.
Then you process the WSDL with wsimport and take a look at the generated code.
As Hany Shafik has already answered, the code will use the Holder class.
Best wishes!
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kumar,

Let's please keep in mind that WSDL was not designed just for Java. It's interesting to see the IN OUT implementation in ... PL/SQL for example, where the IN OUT design is very explicit - How to pass parameters to Procedures and Functions in PL/SQL ?

Regards,
Dan
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Dan.

I'm struggling a bit to get these concepts straightened out... But I hope to get into a decent shape soon
reply
    Bookmark Topic Watch Topic
  • New Topic