Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2006

Tip: Looking for answers? Try searching our database.

SOAP spec

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
storalae@yahoo.com - 05 Mar 2006 18:41 GMT
after reading soap specification at w3c i have a few questions

1) you can't use soap-envelope namespace with application specific
<element>?

since soap schema have not define namespace (env) can use with <MyElement>

inside soap schema -->

targetNamespace=http://www.w3.org/2003/05/soap-envelope

indicates that the elements defined by this schema are <Header>

for example: <env:MyElement> --> we cannot use the envlope namespace with
<MyElement>?

note: <MyElement> is an element generate from my own application

2) in soap schema we have

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.w3.org/2003/05/soap-envelope"
targetNamespace="http://www.w3.org/2003/05/soap-envelope"
elementFormDefault="qualified">

in soap request xml we can delcare using that namespace by

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">

so all element with env namespace will follow rules in soap schema at
http://www.w3.org/2003/05/soap-envelope/
is that correct?

at the same time all element in My namespace will follow rules in my new
schema that i define?

3) the above is why we need namespace?

for example -

a) soap-envelope namespace is a set of elements includes <Envelope> <Header>

b) WSDL namespace is for a set of elements <definitions> <types> <message>
<portType> <binding> .. etc etc

c) My own defined namespace is for a set of elements <MyElement> .. etc etc
that i defined.

so namespace can distinguish a set of elements in XML that's defined by
different people?

Thanks
Josh Twist - 05 Mar 2006 20:43 GMT
1.) Your own elements should be in your own namespace. e.g. the stock
HelloWorld example is in the http://tempuri.org namespace.

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <soap:Body>
   <HelloWorldResponse xmlns="http://tempuri.org/">
     <HelloWorldResult>Hello World</HelloWorldResult>
   </HelloWorldResponse>
 </soap:Body>
</soap:Envelope>

2.) Yes, absolutely
3.) Yup, that's exactly what namespaces are for. Each example node
below are different nodes even though they have the same name. The idea
is to stop us developers treading all over each others toes when our
xml documents meet :)

<container xmlns:ns1="some-namespace" xmlns:ns2="other-namespace"
xmlns="default-namespace">
 <ns1:example>one</ns1:example>
 <ns2:example>one</ns2:example>
 <example>one</example>
</container>

Note that the above document is semantically identical to the one below
because the prefix (xx:) doesn't mean anything, it's just short hand
for the namespace itself.

<foo:container xmlns:nonsense="some-namespace"
xmlns:hello="other-namespace" xmlns:foo="default-namespace">
 <nonsense:example>one</nonsense:example>
 <hello:example>one</hello:example>
 <foo:example>one</foo:example>
</foo:container>

Josh
http://www.thejoyofcode.com/

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.