Processing instructions removed from result XML webservice

Discussion in 'ASP .Net Web Services' started by Ronald Scheer, Sep 30, 2003.

  1. 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
    Ronald Scheer, Sep 30, 2003
    #1
    1. Advertising

  2. Ronald Scheer

    MSFT Guest

    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.)
    MSFT, Oct 1, 2003
    #2
    1. Advertising

  3. 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



    "MSFT" <> wrote in message
    news:66$6Mr#...
    > 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.)
    >
    Ronald Scheer, Oct 1, 2003
    #3
  4. Ronald Scheer

    MSFT Guest

    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.)
    MSFT, Oct 2, 2003
    #4
  5. 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

    "MSFT" <> wrote in message
    news:...
    > 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.)
    >
    Ronald Scheer, Oct 2, 2003
    #5
  6. Ronald Scheer

    MSFT Guest

    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.)
    MSFT, Oct 6, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dominic Olivastro

    Processing Instructions

    Dominic Olivastro, Apr 14, 2004, in forum: XML
    Replies:
    9
    Views:
    533
    Ashmodai
    Apr 16, 2004
  2. Tom Anderson
    Replies:
    4
    Views:
    498
    Peter Flynn
    Dec 13, 2008
  3. Michael Tan
    Replies:
    32
    Views:
    937
    Ara.T.Howard
    Jul 21, 2005
  4. kcwolle
    Replies:
    4
    Views:
    128
    Tad McClellan
    Jun 24, 2004
  5. Replies:
    2
    Views:
    82
Loading...

Share This Page