473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SOAP From WSDL - Namespaces

E11
Hi all,

I am composing a SOAP request message from a WSDL definition, and it
seems that my concept of namespaces is wrong.
The "types" section of the WSDL definition is as follows:

<types>
<s:schema
elementFormDefault="qualified"
targetNamespace="http://www.foo.com"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:bar="http://www.bar.com"
<s:import namespace="http://www.bar.com"/>
<s:element name="update">
<s:complexType>
<s:sequence>
<s:element ref="bar:updateStatusNotification"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<xs:schema
targetNamespace="http://www.bar.com"
elementFormDefault="unqualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:baz="http://www.baz.com" <xs:import namespace="http://www.baz.com"/>
<xs:element name="updateStatusNotification"
type="baz:statusNotification"/>
</xs:schema>
<xs:schema
targetNamespace="http://www.baz.com"
elementFormDefault="unqualified"
attributeFormDefault="unqualified"
xmlns:baz="http://www.baz.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"

<xs:complexType name="statusNotification">
<xs:sequence>
<xs:element name="activityDate" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
And the "Body" section of my (wrongly) composed SOAP request is as
follows:

<soap-env:Body>
<m0:update xmlns:m0="http://www.foo.com">
<m1:updateStatusNotification xmlns:m1="http://www.bar.com">
<m2:activityDate xmlns:m2="http://www.baz.com">
2006-04-07
</m2:activityDate>
</m1:updateStatusNotification>
</m0:update>
</soap-env:Body>
The rationale i use is as follows:

- First i start with the "update" element of the "http://www.foo.com"
namespace (as this was pointed to by the "part" section of the WSDL
definition. Also, this "update" element in the SOAP request gets the
namespace "http://www.foo.com" because that's its target namespace in
the WSDL.

- Following from the WSDL, the "update" element has a child which
references the "updateStatusNotification" element of the
"http://www.bar.com" namespace. So, in the SOAP request, i add a
"updateStatusNotification" element under the "update" element, and it
is given a namespace of "http://www.bar.com" (because this is the
target namespace of the "updateStatusNotification" element in the WSDL.

- Then, from the WSDL, the "updateStatusNotification" element is of
type "statusNotification" of the "http://www.baz.com" namespace. So i
look for the "statusNoticiation" type in the "http://www.baz.com"
namespace, and find that it has a single child element "activityDate".
So in the SOAP request, i add the "activityDate" element under the
"updateStatusNotification" element and give it a namespace of
"http://www.baz.com" (because this is the target namespace of the
"activityDate" element in the WSDL).
The structure of the SOAP request that i composed is correct, as with
the namespaces, EXCEPT for the namespace of the "activityDate" element.
Now where in my reasoning (above) did i go wrong?

TIA and Regards,
Edwin

Apr 7 '06 #1
1 3502
Hi Edwin,

activityDate should not be in any namespace. This is because you are
using elementFormDefault="unqualified", which means that locally
declared elements are not in a namespace (and activityDate is locally
declared). If you
change your third schema to use elementFormDefault="qualfied", it should
work the way you expect.

Hope that helps,
Priscilla

----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
XQuery
http://www.datypic.com
----------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Apr 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: burdeen | last post by:
I've been trying to return an array with PHP5 soap. Is this not supported? or am i doing it wrong? Seems to return on the last element in the array. In my WSDL i've defined my return type as a...
0
by: stefan | last post by:
hello everybody, I want to call a method on a SAP WAS. For testing purposes, I do have the same method on two WASs. One of them has been updated recently. The wsdl-files of both are not...
0
by: Cleo | last post by:
Hi, I am trying to call a WebService Method written in Weblogic from VB.NET and I am getting the following error. I am using SOAP Caal s from VB.NET. Please find the wsdl file and my code. ...
4
by: martin.skarsaune | last post by:
We have some SOAP compatilibility issues with Visual Studio .NET. Procedure: 1. Add web reference by importing WSDL from an external system 2. Generate C# classes 3. Try to invoke the remote...
4
by: Christian Wilhelm | last post by:
Hi! I have a Problem understanding the deserialisation of SOAP-Responses. The "normal" way, calling a XML WebService is to use WSDL 1) Send Request 2) Get SOAP-Response 3) With Informations...
16
by: MR | last post by:
my soap messages to a remote site are failing. as far as i can tell the only differences between what my SOAP message looks liek and what they want are in the SOAP envelope SInce they don't have a...
2
by: lallous | last post by:
Hello, I am new to webservices internals and I used the web service wizard to generate the webservice class and appropriate objects. After issueing a request, I noticed that the SOAP message...
3
by: Joshua Beall | last post by:
Hi All, I've got the following PHP code: $service = new SoapClient("http://www.webservicex.net/length.asmx? wsdl"); $result = $service->ChangeLengthUnit(10,"Inches","Centimeters");...
0
by: Matthew | last post by:
Hi - apologies in advance if this is the wrong list for the following php/soap related question; would appreciate a pointer to the right group. The quick way to phrase my question is - is the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.