Processing instructions removed from result XML webservice

R

Ronald Scheer

When I moved my webservices from Windows 2000 to Windows
2003 I discovered that all processing instructions are
removed from the output result xml of my webservices.

How do I overrule this ?

I saw the same question already from other people in
different newsgroups the first one was dated May 2003.

I emailed them an nobody got an answer.

Is there someone with experience on .Net that can answer
this ?

My believe is this instruction makes .Net powerful so an
answer will make a lot of people happy.

With Best Regards

Ronald



Example code:

<WebMethod()> Public Function MyService() As
Xml.XmlDocument
Search = New Xml.XmlDocument()
Dim newPI As XmlProcessingInstruction
Dim PItext As String = "type=""text/xsl""
href=""/general/xsl/webserviceitem.xsl"""

newPI = Search.CreateProcessingInstruction("xml-
stylesheet", PItext)
Search.AppendChild(newPI)

........

End Function
 
M

MSFT

Hi Ronald,

I am not very clear on "all processing instructions are removed from the
output result xml". Do you mean the XSL transform didn't happen, or the
string like ""<?xml-stylesheet type="text/xsl" href
="/general/xsl/webserviceitem.xsl" ?>" wasn't in the XML document. Is it
posible that the path for xsl file is invalid on the new server? You may
test a web method like this:

<WebMethod()> Public Function MyService() As String
Search = New Xml.XmlDocument()
Dim newPI As XmlProcessingInstruction
Dim PItext As String = "type=""text/xsl""
href=""/general/xsl/webserviceitem.xsl"""

newPI = Search.CreateProcessingInstruction("xml-
stylesheet", PItext)
Search.AppendChild(newPI)

........


return Search.OutXML
End Function

Can you find the process instruction string in the result?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
R

Ronald Scheer

Hi Luke,

The stylesheet is available and I see the processing instructions in the
result when I convert them to a string.

So it is something in the framework that removes them from a xml.xmldocument
type.

It should be easy for you to reproduce the error on Windows 2003 with .Net
Framework 1.1. No magic a very standard environment.

Thanks for your effort. I hope you can help me on this.

With Best Regards

Ronald
 
M

MSFT

Hi Ronald,

I suspect the problem was related to this fact:

When XmlDocument objects r are returned from Web Service methods, they are
marshaled as XmlNode objects. The Processing instructions may be removed
during marshal. For details, you may refer to:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q330600

Based on my test, I get expect string on server side, but on client side I
haven't found the Process instruction string.


Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
R

Ronald Scheer

Hi Luke,

Thanks for your update. The explanation fits I guess, but...

This has changed with .Net Framework version 1.1.

This doesn't make me very happy, it kills basic achitectuals designs of .Net
applications. When something changes my type I call it a bug.

The question is now how do I add stylesheets to my XML without having
anycode on the clients.

If their is no solution where can I escalate this problem and can I
downgrade to .Net Framework version 1.0 on Windows 2003 in the meanwhile.

Thanks

Ronald
 
M

MSFT

Hi Ronald,

For this situation, I suggest you may return a XML string instead of
XMLDocument object so that the process instructions string are included.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,160
Latest member
CollinStri
Top