• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSDL Structure for two opeations which uses same schema

 
Malatesh Karabisti
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Saloon Keeper
Posts: 4028
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Malatesh Karabisti
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Scott.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic