Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSDL Message definition and elements - what are the rules???

Status
Not open for further replies.

SteveJR

Programmer
Aug 13, 2001
72
GB
Hi,

Would someone be able to tell me if there is a requirement in XML/WSDL/SOAP rules which means an application must return a response message with the same top-level element as defined in the WSDL thata client would use?

For example, if I have a WSDL that contains the following:

<wsdl:message name="ServiceResponseMessage">
<wsdl:part name="Header" element="v1_0:Header"/>
<wsdl:part name="Body" element="v1_0:ServiceResponse"/>
</wsdl:message>

Then the body element in the response message from the application should have ServiceResponse as the top level element.

Is the above correct or can the application return a body part that has "ResponseBody" as the top level element? Should this make any difference to the calling client?

Does the message returned from the application need to start with the same top level element but use any namespaces it wishes as they are just references?

Many thanks for your help,

Steve
 
Think on the WSDL as a contract with the client. So, yes, the client is expecting a response that will follow the schema shown in the WSDL file.

Cheers,
Dian
 
Thanks Dian.

I assumed that would be the case but wasn't sure if there were rules that said the client could still accept a response where the top level was different but then I guess it could not confirm it was getting the right response.

Steve
 
Well, it's up to the client to validate the message or not but even if chooses to not do it, how would know if the top element is just renamed or the structure has changed? The structure uses to be necessary to properly identify the data contained in it.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top