473,394 Members | 1,699 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,394 software developers and data experts.

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:Envelope xmlns:soap="http://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:Envelope xmlns:soap="http://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:HelloRequest>
<ns0:message>Wave</ns0:message>
<ns0:x>0</ns0:x>
<ns0:y>0</ns0:y>
<ns0:flag>none</ns0:flag>
</ns0:HelloRequest>
</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
XmlElementAttribute(Form = XmlSchemaForm.Qualified) 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 1601
"J. Dudgeon" <JD******@discussions.microsoft.comwrote in message
news:E6**********************************@microsof t.com...
Is it possible to configure a .NET 2.0 ASMX Web service to accept
namespace
qualified messages?

For instance, instead of:

<soap:Envelope xmlns:soap="http://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:Envelope xmlns:soap="http://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:HelloRequest>
<ns0:message>Wave</ns0:message>
<ns0:x>0</ns0:x>
<ns0:y>0</ns0:y>
<ns0:flag>none</ns0:flag>
</ns0:HelloRequest>
</soap:Body>
</soap:Envelope>

To repeat the question, is this possible?

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

For instance, instead of:

<soap:Envelope xmlns:soap="http://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:Envelope xmlns:soap="http://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:HelloRequest>
<ns0:message>Wave</ns0:message>
<ns0:x>0</ns0:x>
<ns0:y>0</ns0:y>
<ns0:flag>none</ns0:flag>
</ns0:HelloRequest>
</soap:Body>
</soap:Envelope>

To repeat the question, is this possible?

"John Saunders" wrote:
"J. Dudgeon" <JD******@discussions.microsoft.comwrote in message
news:E6**********************************@microsof t.com...
Is it possible to configure a .NET 2.0 ASMX Web service to accept
namespace
qualified messages?
>
For instance, instead of:
>
<soap:Envelope xmlns:soap="http://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******@discussions.microsoft.comwrote in message
news:D1**********************************@microsof t.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******@discussions.microsoft.comwrote in message
news:D0**********************************@microsof t.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 "theoretical", 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******@discussions.microsoft.comwrote in message
news:D1**********************************@microsof t.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
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...
1
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"...
5
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"...
0
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>...
1
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...
3
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...
3
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"...
1
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.