473,657 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Qualified elements in SOAP Body...

Is it possible to configure a .NET 2.0 ASMX Web service to accept namespace
qualified messages?

For instance, instead of:

<soap:Envelop e xmlns:soap="htt p://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<HelloRequest xmlns="http://foo/services/Test/HelloService">
<message>Wave </ns0:message>
<x>0</x>
<y>0</y>
<flag>none</flag>
</HelloRequest>
</soap:Body>
</soap:Envelope>

can an ASMX 2.0 Web service support:

<soap:Envelop e xmlns:soap="htt p://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http ://foo/services/Test/HelloService">
<soap:Body>
<ns0:HelloReque st>
<ns0:message>Wa ve</ns0:message>
<ns0:x>0</ns0:x>
<ns0:y>0</ns0:y>
<ns0:flag>non e</ns0:flag>
</ns0:HelloReques t>
</soap:Body>
</soap:Envelope>

I know this is possible when working directly with the XmlSerializer, but
something isn't working in the Web service definition. I've even tried using
XmlElementAttri bute(Form = XmlSchemaForm.Q ualified) but that doesn't seem to
take.

I guess I could build an extension that performs the
serialization/deserialization instead of the default built-in code.

Thank you in advance,

Joel
Nov 7 '06 #1
6 1614
"J. Dudgeon" <JD******@discu ssions.microsof t.comwrote in message
news:E6******** *************** ***********@mic rosoft.com...
Is it possible to configure a .NET 2.0 ASMX Web service to accept
namespace
qualified messages?

For instance, instead of:

<soap:Envelop e xmlns:soap="htt p://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"

xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<HelloRequest xmlns="http://foo/services/Test/HelloService">
<message>Wave </ns0:message>
<x>0</x>
<y>0</y>
<flag>none</flag>
</HelloRequest>
</soap:Body>
</soap:Envelope>
All of these elements _are_ namespace-qualified.

John
Nov 7 '06 #2
I understand that, but the test .NET Web service does not want to accept the
latter, even though they are theoretically equivalent. Therefore, if the
client puts the namespace/prefix declaration in the root of the envelope, it
breaks the service. One of our clients requested that we support:

<soap:Envelop e xmlns:soap="htt p://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http ://foo/services/Test/HelloService">
<soap:Body>
<ns0:HelloReque st>
<ns0:message>Wa ve</ns0:message>
<ns0:x>0</ns0:x>
<ns0:y>0</ns0:y>
<ns0:flag>non e</ns0:flag>
</ns0:HelloReques t>
</soap:Body>
</soap:Envelope>

To repeat the question, is this possible?

"John Saunders" wrote:
"J. Dudgeon" <JD******@discu ssions.microsof t.comwrote in message
news:E6******** *************** ***********@mic rosoft.com...
Is it possible to configure a .NET 2.0 ASMX Web service to accept
namespace
qualified messages?

For instance, instead of:

<soap:Envelop e xmlns:soap="htt p://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"

xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<HelloRequest xmlns="http://foo/services/Test/HelloService">
<message>Wave </ns0:message>
<x>0</x>
<y>0</y>
<flag>none</flag>
</HelloRequest>
</soap:Body>
</soap:Envelope>

All of these elements _are_ namespace-qualified.

John
Nov 7 '06 #3
It turns out the error was a weird limitation in .NET Web services, it was a
formatting issue with the client request. I thought it was strange since
both requests are semantically equivalent.

"J. Dudgeon" wrote:
I understand that, but the test .NET Web service does not want to accept the
latter, even though they are theoretically equivalent. Therefore, if the
client puts the namespace/prefix declaration in the root of the envelope, it
breaks the service. One of our clients requested that we support:

<soap:Envelop e xmlns:soap="htt p://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http ://foo/services/Test/HelloService">
<soap:Body>
<ns0:HelloReque st>
<ns0:message>Wa ve</ns0:message>
<ns0:x>0</ns0:x>
<ns0:y>0</ns0:y>
<ns0:flag>non e</ns0:flag>
</ns0:HelloReques t>
</soap:Body>
</soap:Envelope>

To repeat the question, is this possible?

"John Saunders" wrote:
"J. Dudgeon" <JD******@discu ssions.microsof t.comwrote in message
news:E6******** *************** ***********@mic rosoft.com...
Is it possible to configure a .NET 2.0 ASMX Web service to accept
namespace
qualified messages?
>
For instance, instead of:
>
<soap:Envelop e xmlns:soap="htt p://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
>
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<HelloRequest xmlns="http://foo/services/Test/HelloService">
<message>Wave </ns0:message>
<x>0</x>
<y>0</y>
<flag>none</flag>
</HelloRequest>
</soap:Body>
</soap:Envelope>
All of these elements _are_ namespace-qualified.

John

Nov 8 '06 #4
"J. Dudgeon" <JD******@discu ssions.microsof t.comwrote in message
news:D1******** *************** ***********@mic rosoft.com...
>I understand that, but the test .NET Web service does not want to accept
the
latter, even though they are theoretically equivalent. Therefore, if the
client puts the namespace/prefix declaration in the root of the envelope,
it
breaks the service. One of our clients requested that we support:
Sorry, you're mistaken. They aren't _theoretically_ equivalent, they _are_
equivalent.

You should start from the assumption that they are the same and then figure
out how, if they're the same, could you be getting the results you're
experiencing.

One thing to do as a diagnostic tool would be to put the problematic XML
into a file and read it into an XmlDocument. Then look at each node to see
what the LocalName and NamespaceUri are set to.

John
Nov 8 '06 #5
"J. Dudgeon" <JD******@discu ssions.microsof t.comwrote in message
news:D0******** *************** ***********@mic rosoft.com...
It turns out the error was a weird limitation in .NET Web services, it was
a
formatting issue with the client request. I thought it was strange since
both requests are semantically equivalent.
Can you please post an example of the bad vs. good XML?

John
Nov 8 '06 #6
Sorry, the above post should have read "It turns out it *wasn't* a strange
limitation in the .NET Web service." It ended up being a client problem.

Unfortunately, I can't post what they sent because the trace file of the
incoming SOAP messages was cleared before I could save it.

Another project team ran into an issue back in 2001/2002 with a .NET Web
service not correctly deserializing the XML stream and it was related to the
location of namespace declarations. I don't recall the specifics but I
believe it was fixed by using the XmlTextReader or the XmlDocument class to
directly deserialize the XML stream.

As for my use of "theoretica l", it was more slang for "supposed to be"; i.e.
"even though they are *supposed to be* equivalent". My bad.

"John Saunders" wrote:
"J. Dudgeon" <JD******@discu ssions.microsof t.comwrote in message
news:D1******** *************** ***********@mic rosoft.com...
I understand that, but the test .NET Web service does not want to accept
the
latter, even though they are theoretically equivalent. Therefore, if the
client puts the namespace/prefix declaration in the root of the envelope,
it
breaks the service. One of our clients requested that we support:

Sorry, you're mistaken. They aren't _theoretically_ equivalent, they _are_
equivalent.

You should start from the assumption that they are the same and then figure
out how, if they're the same, could you be getting the results you're
experiencing.

One thing to do as a diagnostic tool would be to put the problematic XML
into a file and read it into an XmlDocument. Then look at each node to see
what the LocalName and NamespaceUri are set to.

John
Nov 8 '06 #7

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

Similar topics

1
1634
by: wsdeveloper | last post by:
I have a SOAP Message like the following: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="CreateCoordinationContext.xsl"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <wsa:Action soapenv:mustUnderstand="0"...
1
1226
by: AliasMrJones | last post by:
We're trying to get IBM Websphere Business Integration to talk to a .net webservice. We're using document/literal. WBI is sending a soap request that looks like this: <?xml version="1.0" encoding="UTF-8"?> <!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Eric Moore (Scholastic, Inc.) --> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
3186
by: Earl Damron | last post by:
Hello All. Is it possible to create a Web service with C# that returns a response with two different elements in the SOAP Body? I'm thinking of something like this: <?xml version="1.0" encoding="utf-16"?> <soap:Envelope ...> <soap:Body> <summary_data>
0
1072
by: Don | last post by:
I am calling a web service that requires all elements to have a namespace (or alias) prefix before all elements. Here is an example of xml that works correctly: <SOAP-ENV:Body> <m:VINValidationRequest xmlns:m="http://..."> <m:requestHeader> <m:RequestingApplicationCd>Test</m:requestingApplicationCd> </m:requestHeader> </m:VINValidationRequest>
1
1150
by: Steve Drake | last post by:
All, This maybe OT for this group, but I am really after some views on our issue, with Acrobat Elements server 6.0 the webservices work fine, with 6.0.1 they don't, this is the XML that comes back : <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
3
3138
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The proxy class was auto-generated by Visual Studio from WSDL provided by people who provide the Axis service, and I have not modified it (except to add code for a build that includes a SOAP trace). The only difference I see in the messages is that...
3
7567
by: =?Utf-8?B?TWFucHJlZXQgU3VzaGls?= | last post by:
I am having a Webservice within which i am throwing SOAP Exceptions and therefore whenever something wrong happens a SOAP fault comes up in the response - see below: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
1
6085
by: novicedlh | last post by:
Hello, I am creating a webservice that collects user information and stores it in a database. Since the user information contains sensitive data like SSN I am planning to use WS-Security (WSE 2.0) in my WebService to digitally sign and encrypt the data. Here are the steps I followed to digitally sign the message: 1) I created a X.509 certificate using Certification Services in Windows Server 2003. 2) I installed the certificate...
3
4993
by: axel_johard | last post by:
Hi, need some help with creating a WSDL file. I will try to summarize the problem like this: I need to create a wsdl that accepts a response that has no namespace- prefix in the first line in the body, like this: "...<soap:Body><UpdateCustomerDetailsResponse xmlns="AMI">..." I have tried setting the schema-element like <s:schema elementFormDefault="unqualified" targetNamespace="AMI"and since this
0
8413
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.