This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes WSDL Structure for two opeations which uses same schema Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "WSDL Structure for two opeations which uses same schema " Watch "WSDL Structure for two opeations which uses same schema " New topic
Author

WSDL Structure for two opeations which uses same schema

Malatesh Karabisti
Ranch Hand

Joined: Jul 28, 2010
Posts: 153

I am writing the WSDL which has the two operations
1)GetLIstOfItemsForUser
2)GetSetOfItemsForOrder

Both the operations uses the same schema which has the following structure as shown below.
<LIstOfItems>
<UserName maxoccurence=1 and minOccures=1> *Mandatory
<SetOfItems maxoccurence=Unbouned and minOccures=0>
<OrderNumber maxoccurence=1 and minOccures=1>* *Mandatory
...................
<SetOfItems>
<LIstOfItems>

The Input for first operation GetLIstOfItemsForUser is UserName
<LIstOfItems>
<UserName/>
</LIstOfItems>

According to the schema OrderNumber is mandatory but since its parent tag (SetOfItems) is optional We don't want to include <SetOfItems> tag or any of its child elements

The input for second operation GetSetOfItemsForOrder is OrderNumber
<SetOfItems>
<OrderNumber/>
</SetOfItems>

Is there any problem with this kind of WSDL structure ?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

If the parent is not required, the child is not required if there is no parent. The child is only required if the parent is present.

Keep in mind, WSDL's are about defining communication contracts between you and another party (or parties). You may not be able to enforce every possible rule in the WSDL, which is why applications should still validate input. Also, you could split the input for these two methods to separate definitions.


My Blog: Down Home Country Coding with Scott Selikoff
Malatesh Karabisti
Ranch Hand

Joined: Jul 28, 2010
Posts: 153

Thank You Scott.
 
Consider Paul's rocket mass heater.
 
subject: WSDL Structure for two opeations which uses same schema