Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

type="xs:string" OR type="xsd:string" in SOAP protocol

I'm new to web services world, and I've seen in different tutorials that some of them use xs:string for data type and some use xsd:string for messages in w3schools.com tut is as below:

<message name="getTermResponse">
  <part name="value" type="xs:string"/>
</message>

And for example in Apress Beginning PHP and MySQL is as the following code:

<message name="getTermResponse">
  <part name="value" type="xsd:string"/>
</message>

What is the differences between them? which one to use when?

like image 822
Alireza Avatar asked May 15 '12 14:05

Alireza


1 Answers

xs:string is an example of a qualified name in XML. The xs part refers to a namespace declaration on the same element or a parent element. Most likely, there's an xmlns:xs=http://www.w3.org/2001/XMLSchema declaration.

xsd:string is exactly the same thing, assuming that the declaration is xmlns:xsd=http://www.w3.org/2001/XMLSchema. foo:string would also be the same, if the declaration were xmlns:foo=http://www.w3.org/2001/XMLSchema.

In other words, the prefix does not matter. It is an alias for the namespace. If the namespaces are the same, and the local names are the same, then the two qualified names are the same.

like image 119
John Saunders Avatar answered Sep 20 '22 13:09

John Saunders