Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xmlns:soap attribute of SOAP element

I just now started learning web services.I cannot understand the use of xmlns:soap attribute of SOAP element.Thanks.

like image 277
Warrior Avatar asked May 16 '09 16:05

Warrior


2 Answers

Those "xmlns:" attributes are not specific to SOAP. They define prefixes that will later be used to refer to XML namespaces. Example:

<DTS:Executable xmlns:DTS="www.microsoft.com/SqlServer/Dts" 
    DTS:ExecutableType="SSIS.Package.2">

This defines DTS as a prefix that means the namespace "www.microsoft.com/SqlServer/Dts". It then refers to the ExecutableType attribute from that namespace.

XML namespaces do the same job as a namespace in C# or C++. They provide a space in which to define names, so that names from one namespace do not conflict with names in another. You could define your own "ExecutableType" attribute, and it could mean something totally different from the one that Microsoft defined. Both could be used in the same document, with no ambiguity about which was which.

like image 184
John Saunders Avatar answered Nov 13 '22 14:11

John Saunders


Based on the level of your question (Please don't take offense), it sounds like you are new to XML as well as XML based Web services. John Saunders correctly describes XML namespaces and their uses. If you are looking to get a better understanding of XML and XML based Web services, I recommend that you start with the W3 Schools' XML tutorial (specifically the section on XML namespaces).

The tutorial is located at: http://www.w3schools.com/xml/default.asp

The section on XML namespaces is located at: http://www.w3schools.com/xml/xml_namespaces.asp

like image 45
DavidValeri Avatar answered Nov 13 '22 12:11

DavidValeri