• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in JAX-WS 2.2 SPEC - Chapter 2

 
Rajamani Sriram
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading the JAX WS 2.2 SPEC and could not understand the following in chapter 2 (Page 14).

From the spec:
2.3.1.2 Wrapper Style

A WSDL Operation qualifies for wrapper style mapping only if the following criteria are met:
(i) The operation's input and ouput messages (if present) each contain only a single part
(ii) The input message part refers to a global element declaration whose localname is equal to the operation name
(iii) The output message (if present) part refers to a global element declaration
(iv) blah... blah..

I got confused with the point ii here. Does it mean that global element's localname is equal to operation name (method name)

I just wrote a example wsdl fragment (please ignore all the mistakes I made in this wsdl) to explain what i understood:

<message name="A">
<part name="model" type="school" >
</message>

<porttype name="blahPortType">
<operation name="school">
<input type="A">
<opuput>

Does this mean that the school, input message part referring a global element should be operation name school ???

Please correct me what I got wrong here from the spec.

Thanks,
Rajamani Sriram
 
Stefan Taranu
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rajamani,

I guess you got it right.
If you are still an doubt I suggest trying to build your own example...
I also suggest to look here to get a better explanation.


Hope that helps,
Stefan
 
Chintan Rajyaguru
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajamani,
You understood it right but your example needs to be modified. First of all, input message part refers to a 'global element'..., this means that
(1) the message must refer to an 'element' as opposed to 'type'
(2) it must be a global element. Global elements in XML are defined as outer level elements (it has no parent element)
(3) the name of the element in schema must be same as the name of the operation for the input message. The convention is to represent output message with an element that has the name 'operation name+Response'

Example:
In WSDL
<message name="sayHello">
<part name="parameters" element="tns:sayHello"/>
</message>
...
<portType name="HelloWorld">
<operation name="sayHello">
...
Note: (1) part refers to an element as opposed to a type (2) the local name of the element (sayHello) is the same as the operation name

In schema
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" all the namespaces>
<xs:element name="sayHello" type="tns:sayHello"/>
...

Note: sayHello is a global element

Now comes the important question:
1. Why do you think these rules apply to document and not RPC style?
2. Why do you think these rules apply to wrapper style?
If you know the answers, you won't have to remember the rules.
Hint: What would happen to two methods in a single class with identical signatures without these rules?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic