468,133 Members | 1,486 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

how to prevent "xmlns=''" from being serialized in the ASP.net WebService plumbing work.

when I use the XmlWebSerivce to response the xmlelement to Web Service client.
the ASP.net plumbing work ( the XmlSerializer in WebServices ) will serialize the XML

if we can control the wrapper class , I can set the XmlSchemaForm.None or Qualified so that there will no be a 'xmlns=""' in the following namespace, but I don't know how to do that in WebService plumbing.

this null namespace will makes my web service wrapper class complains.
we need to fix it.

xmlns="http://www.cedar.com.tw/bluestar/">
- <BlueStar MsgName="Bank1980" Status="9502" xmlns="">
<StatusCode>9502</StatusCode>
<Severity>Error</Severity>
<StatusDesc>SubmitXML - GetXMLTagName Failed!</StatusDesc>
</BlueStar>

Anyone can provide some help on this?
thanks in adv.

Jim

///<soapBox>it seems there are too many plumbing work in XML WebServices that is not configurable for developers, especially for us that pass XML, instead of .net Class. , SoapExtension seems to be the only solution....</soapBox>

Nov 21 '05 #1
3 3112
Hello Jim!

The WS I'm working on right now is also returning XmlElement, but my WS-client is reading response
soap-xml directly without any proxy. In your case, what happens if your client treats the response
as an XmlElement, converts it to a string/stream, replaces xmlns="" with whatever You want it to be
and then creates a new XmlElement? I know it's just a workaround, but anyway.

I'm not exactly an expert but the impression I've got is that when you use soap extensions you are
working outside the .NET-WS infrastructure. For example what happens with Your automatic
asmx?WSDL-file and what about web service enhancements and the security infrastructure it's
promising?

/Regards Björn

Nov 21 '05 #2
there might be various ways the client of the WS is,
in fact, msxml parser and string might not experience significant issues,
but in System.net and XmlSerializer, default namespace and xmlns='' makes a
lot differnece.
my solution is now is with the XmlNoNamespaceWriter.
but that's a workaround.

thanks

-Jim

"BjörnHolmberg" <bj*****************************@sulitelma.com> wrote in
message news:40***************@sulitelma.com...
Hello Jim!

The WS I'm working on right now is also returning XmlElement, but my WS-client is reading response soap-xml directly without any proxy. In your case, what happens if your client treats the response as an XmlElement, converts it to a string/stream, replaces xmlns="" with whatever You want it to be and then creates a new XmlElement? I know it's just a workaround, but anyway.
I'm not exactly an expert but the impression I've got is that when you use soap extensions you are working outside the .NET-WS infrastructure. For example what happens with Your automatic asmx?WSDL-file and what about web service enhancements and the security infrastructure it's promising?

/Regards Björn

Nov 21 '05 #3
Hello Jim! I made a google-search on XmlNoNamespaceWriter and found it on Kirk Allens blog. Seems to
be a good idea. But how can You plug in XmlNoNamespaceWriter into WS-plumbing?

By the way, here is a third workaround (fourth if we count soap extensions):

Instead of sending xml, it's possible to play by Microsoft rules and send objects instead of xml.
What You have to do then to get at xml is to use XmlSerializer on the object. This will decrease
performance since we will have first have deserialization (in plumbing) and then ask for
serialization again. But both seems to be fast in dotnet. I guess this will be ok for folks like me
that want to create xhtml from xml and xslt. But I don't know how it works for people that create
complicated web services by first designing their own xml-schemas...

Regards
Björn

Jim Hsu wrote:
there might be various ways the client of the WS is,
in fact, msxml parser and string might not experience significant issues,
but in System.net and XmlSerializer, default namespace and xmlns='' makes a
lot differnece.
my solution is now is with the XmlNoNamespaceWriter.
but that's a workaround.

thanks

-Jim

"BjörnHolmberg" <bj*****************************@sulitelma.com> wrote in
message news:40***************@sulitelma.com...
Hello Jim!

The WS I'm working on right now is also returning XmlElement, but my

WS-client is reading response
soap-xml directly without any proxy. In your case, what happens if your

client treats the response
as an XmlElement, converts it to a string/stream, replaces xmlns="" with

whatever You want it to be
and then creates a new XmlElement? I know it's just a workaround, but

anyway.

I'm not exactly an expert but the impression I've got is that when you use

soap extensions you are
working outside the .NET-WS infrastructure. For example what happens with

Your automatic
asmx?WSDL-file and what about web service enhancements and the security

infrastructure it's
promising?

/Regards Björn


Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mike Dickens | last post: by
3 posts views Thread by Keith Hill | last post: by
5 posts views Thread by NeilL | last post: by
3 posts views Thread by ano | last post: by
reply views Thread by R. Ian Lee | last post: by
27 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.