File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 3697
    
    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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WSDL Structure for two opeations which uses same schema
 
Similar Threads
Document/litereal or RPC/Literal
document Vs rpc message styles
How to enable cached authentication details..??
java.io.IOException: Type {http://lang.java}Exception is referenced but not defined.
Issues related to RESTful web servicers