Preventing Escapes in Post

Discussion in 'ASP .Net Web Services' started by SevDer, Aug 26, 2007.

  1. SevDer

    SevDer Guest

    Hi,

    I am trying to consume the webservice which is written with Java through the
    provided wsdl & xsd definitions.
    However there is a slight problem.

    Problem is, they are expecting a clean XML but .NET converts my query XML
    into escaped form into the SOAP body which makes their service to respond in
    the following form:

    <?xml version="1.0" encoding="utf-8"?><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:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>java.lang.IndexOutOfBoundsException:
    Index: 0, Size: 0</faultstring><detail><ns1:hostname
    xmlns:ns1="http://xml.apache.org/axis/">trajanoxp</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>


    Now my question is: Is there a way to prevent this escaping? Or I must write
    all the soap from string and send the whole XML string manually?

    Thanks for your help in advance.

    --

    SevDer
    www.sevder.com
    SevDer, Aug 26, 2007
    #1
    1. Advertising

  2. "SevDer" <> wrote in message
    news:...
    > Hi,
    >
    > I am trying to consume the webservice which is written with Java through
    > the provided wsdl & xsd definitions.
    > However there is a slight problem.
    >
    > Problem is, they are expecting a clean XML but .NET converts my query XML
    > into escaped form into the SOAP body


    Obviously, this is not something that .NET does on its own, or everyone
    would have this problem. This obviously has to do with the way that you are
    using .NET.

    Please tell us how you are producing the XML.

    Also, is there a reason that you didn't just consume the web service by
    using Add Web Reference in Visual Studio?
    --
    John Saunders [MVP]
    John Saunders [MVP], Aug 26, 2007
    #2
    1. Advertising

  3. SevDer

    SevDer Guest

    Hello John,

    Thanks for the reply.

    I think you should check this again. I've learned that .NET actually escapes
    the inner XML to prevent bad XML forming on some cases. And as far as I
    learned this is the behavior of .NET not the way that I use.
    Additionally the otherway around problem is there too. For your webservice
    to work with other applications, you will need to escape all received inner
    XMLs as they (like Java) send it as nonescaped form.

    Also I added as web reference and I am trying to make the webreference to
    work not any other way. If I cannot make this working, then I will have to
    POST using regular HTTP Post and not use wsdl reference.

    And their WSDL defined method calls does not accept structured objects but
    simple and generic object which actually is simple XML.

    The bottom line is, I am just trying to learn if there is a way for .NET to
    not to escape my request XML while sending over!

    --

    Sevket Seyalioglu
    CTO
    www.kbstours.com
    "John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
    news:...
    > "SevDer" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I am trying to consume the webservice which is written with Java through
    >> the provided wsdl & xsd definitions.
    >> However there is a slight problem.
    >>
    >> Problem is, they are expecting a clean XML but .NET converts my query XML
    >> into escaped form into the SOAP body

    >
    > Obviously, this is not something that .NET does on its own, or everyone
    > would have this problem. This obviously has to do with the way that you
    > are using .NET.
    >
    > Please tell us how you are producing the XML.
    >
    > Also, is there a reason that you didn't just consume the web service by
    > using Add Web Reference in Visual Studio?
    > --
    > John Saunders [MVP]
    >
    SevDer, Aug 26, 2007
    #3
  4. "SevDer" <> wrote in message
    news:...
    > Hello John,
    >
    > Thanks for the reply.
    >
    > I think you should check this again. I've learned that .NET actually
    > escapes the inner XML to prevent bad XML forming on some cases. And as far
    > as I learned this is the behavior of .NET not the way that I use.
    > Additionally the otherway around problem is there too. For your webservice
    > to work with other applications, you will need to escape all received
    > inner XMLs as they (like Java) send it as nonescaped form.
    >
    > Also I added as web reference and I am trying to make the webreference to
    > work not any other way. If I cannot make this working, then I will have to
    > POST using regular HTTP Post and not use wsdl reference.
    >
    > And their WSDL defined method calls does not accept structured objects but
    > simple and generic object which actually is simple XML.
    >
    > The bottom line is, I am just trying to learn if there is a way for .NET
    > to not to escape my request XML while sending over!


    I promise you that, as a general rule, .NET doesn't prevent people from
    using XML by escaping it. You are clearly using it in a way that other
    developers do not use it - they are succeeding and you are failing.

    Please post some code showing us how you are using XML. Among other things,
    your mention of "inner xml" is frightening. You are doing something very
    strange.

    Please look at some of the following links on Web Service basics.

    Overview of XML Web services:

    http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx



    A walkthrough of building a basic XML Web service:

    http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx



    A walkthrough of building a basic client application:

    http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx



    Serializing objects with XML web services

    http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx
    --
    John Saunders [MVP]
    John Saunders [MVP], Aug 27, 2007
    #4
  5. Thanks for John's input.

    Hello SevDer,

    I agree that the problem should be quite specific to the service and its
    requirement on the SOAP message format. Would you provide some further
    information on the service(such as the format and structure of the SOAP
    message it expects from client). Normally, for any string value inside XML
    document(include SOAP envelope), it have to escape those special characters
    so as to ensure the validity of the document. If the customzation requests
    for your scenario does be reasonable, we may look for some ways to
    customize the client proxy class.

    Please feel free to post here if there is anything we've missed.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.



    --------------------
    >From: "John Saunders [MVP]" <john.saunders at trizetto.com>
    >References: <>

    <>
    <>
    >Subject: Re: Preventing Escapes in Post
    >Date: Sun, 26 Aug 2007 21:14:58 -0400
    >Lines: 58
    >Organization: The TriZetto Group, Inc.
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > format=flowed;
    > charset="iso-8859-1";
    > reply-type=response
    >Content-Transfer-Encoding: 7bit
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
    >Message-ID: <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >NNTP-Posting-Host: pool-71-184-5-216.bstnma.east.verizon.net 71.184.5.216
    >Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl
    >Xref: TK2MSFTNGHUB02.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:1413
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >"SevDer" <> wrote in message
    >news:...
    >> Hello John,
    >>
    >> Thanks for the reply.
    >>
    >> I think you should check this again. I've learned that .NET actually
    >> escapes the inner XML to prevent bad XML forming on some cases. And as

    far
    >> as I learned this is the behavior of .NET not the way that I use.
    >> Additionally the otherway around problem is there too. For your

    webservice
    >> to work with other applications, you will need to escape all received
    >> inner XMLs as they (like Java) send it as nonescaped form.
    >>
    >> Also I added as web reference and I am trying to make the webreference

    to
    >> work not any other way. If I cannot make this working, then I will have

    to
    >> POST using regular HTTP Post and not use wsdl reference.
    >>
    >> And their WSDL defined method calls does not accept structured objects

    but
    >> simple and generic object which actually is simple XML.
    >>
    >> The bottom line is, I am just trying to learn if there is a way for .NET
    >> to not to escape my request XML while sending over!

    >
    >I promise you that, as a general rule, .NET doesn't prevent people from
    >using XML by escaping it. You are clearly using it in a way that other
    >developers do not use it - they are succeeding and you are failing.
    >
    >Please post some code showing us how you are using XML. Among other

    things,
    >your mention of "inner xml" is frightening. You are doing something very
    >strange.
    >
    >Please look at some of the following links on Web Service basics.
    >
    >Overview of XML Web services:
    >
    >http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx
    >
    >
    >
    >A walkthrough of building a basic XML Web service:
    >
    >http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx
    >
    >
    >
    >A walkthrough of building a basic client application:
    >
    >http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx
    >
    >
    >
    >Serializing objects with XML web services
    >
    >http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx
    >--
    >John Saunders [MVP]
    >
    >
    >
    Steven Cheng[MSFT], Aug 27, 2007
    #5
  6. SevDer

    KBSTours Guest

    Hi Steven,

    The webservice (not the native .NET webservice) which is written in Java is
    expecting the string in XML format without being escaped. Its not my
    service, I am just trying to consume it.
    So how can I customize it in the proxy class?

    What are the basics? Are there any samples or guides?

    --


    CTO
    www.kbstours.com
    "Steven Cheng[MSFT]" <> wrote in message
    news:X%23gO%23$...
    > Thanks for John's input.
    >
    > Hello SevDer,
    >
    > I agree that the problem should be quite specific to the service and its
    > requirement on the SOAP message format. Would you provide some further
    > information on the service(such as the format and structure of the SOAP
    > message it expects from client). Normally, for any string value inside XML
    > document(include SOAP envelope), it have to escape those special
    > characters
    > so as to ensure the validity of the document. If the customzation
    > requests
    > for your scenario does be reasonable, we may look for some ways to
    > customize the client proxy class.
    >
    > Please feel free to post here if there is anything we've missed.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    >
    > --------------------
    >>From: "John Saunders [MVP]" <john.saunders at trizetto.com>
    >>References: <>

    > <>
    > <>
    >>Subject: Re: Preventing Escapes in Post
    >>Date: Sun, 26 Aug 2007 21:14:58 -0400
    >>Lines: 58
    >>Organization: The TriZetto Group, Inc.
    >>MIME-Version: 1.0
    >>Content-Type: text/plain;
    >> format=flowed;
    >> charset="iso-8859-1";
    >> reply-type=response
    >>Content-Transfer-Encoding: 7bit
    >>X-Priority: 3
    >>X-MSMail-Priority: Normal
    >>X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
    >>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
    >>Message-ID: <>
    >>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >>NNTP-Posting-Host: pool-71-184-5-216.bstnma.east.verizon.net 71.184.5.216
    >>Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl
    >>Xref: TK2MSFTNGHUB02.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webservices:1413
    >>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >>
    >>"SevDer" <> wrote in message
    >>news:...
    >>> Hello John,
    >>>
    >>> Thanks for the reply.
    >>>
    >>> I think you should check this again. I've learned that .NET actually
    >>> escapes the inner XML to prevent bad XML forming on some cases. And as

    > far
    >>> as I learned this is the behavior of .NET not the way that I use.
    >>> Additionally the otherway around problem is there too. For your

    > webservice
    >>> to work with other applications, you will need to escape all received
    >>> inner XMLs as they (like Java) send it as nonescaped form.
    >>>
    >>> Also I added as web reference and I am trying to make the webreference

    > to
    >>> work not any other way. If I cannot make this working, then I will have

    > to
    >>> POST using regular HTTP Post and not use wsdl reference.
    >>>
    >>> And their WSDL defined method calls does not accept structured objects

    > but
    >>> simple and generic object which actually is simple XML.
    >>>
    >>> The bottom line is, I am just trying to learn if there is a way for .NET
    >>> to not to escape my request XML while sending over!

    >>
    >>I promise you that, as a general rule, .NET doesn't prevent people from
    >>using XML by escaping it. You are clearly using it in a way that other
    >>developers do not use it - they are succeeding and you are failing.
    >>
    >>Please post some code showing us how you are using XML. Among other

    > things,
    >>your mention of "inner xml" is frightening. You are doing something very
    >>strange.
    >>
    >>Please look at some of the following links on Web Service basics.
    >>
    >>Overview of XML Web services:
    >>
    >>http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx
    >>
    >>
    >>
    >>A walkthrough of building a basic XML Web service:
    >>
    >>http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx
    >>
    >>
    >>
    >>A walkthrough of building a basic client application:
    >>
    >>http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx
    >>
    >>
    >>
    >>Serializing objects with XML web services
    >>
    >>http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx
    >>--
    >>John Saunders [MVP]
    >>
    >>
    >>

    >
    KBSTours, Aug 28, 2007
    #6
  7. SevDer

    KBSTours Guest

    Hi John,

    It is not my first time using webservices.
    Please see Stevens comments too. He clearly mentions that .NET needs to do
    this escaping as a safe guard which I am trying to prevent. And this is not
    an issue when both ends are .NET code but when one of the end is not .NET
    like Java then you have a problem.

    I've spent good amount of time to see where I fail and finally find this out
    by writing the TraceExtension to the webservice call.

    So if you can find anything for this, please let me know.

    Thanks

    --


    CTO
    www.kbstours.com
    "John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
    news:...
    > news:...
    >> Hello John,
    >>
    >> Thanks for the reply.
    >>
    >> I think you should check this again. I've learned that .NET actually
    >> escapes the inner XML to prevent bad XML forming on some cases. And as
    >> far as I learned this is the behavior of .NET not the way that I use.
    >> Additionally the otherway around problem is there too. For your
    >> webservice to work with other applications, you will need to escape all
    >> received inner XMLs as they (like Java) send it as nonescaped form.
    >>
    >> Also I added as web reference and I am trying to make the webreference to
    >> work not any other way. If I cannot make this working, then I will have
    >> to POST using regular HTTP Post and not use wsdl reference.
    >>
    >> And their WSDL defined method calls does not accept structured objects
    >> but simple and generic object which actually is simple XML.
    >>
    >> The bottom line is, I am just trying to learn if there is a way for .NET
    >> to not to escape my request XML while sending over!

    >
    > I promise you that, as a general rule, .NET doesn't prevent people from
    > using XML by escaping it. You are clearly using it in a way that other
    > developers do not use it - they are succeeding and you are failing.
    >
    > Please post some code showing us how you are using XML. Among other
    > things, your mention of "inner xml" is frightening. You are doing
    > something very strange.
    >
    > Please look at some of the following links on Web Service basics.
    >
    > Overview of XML Web services:
    >
    > http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx
    >
    >
    >
    > A walkthrough of building a basic XML Web service:
    >
    > http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx
    >
    >
    >
    > A walkthrough of building a basic client application:
    >
    > http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx
    >
    >
    >
    > Serializing objects with XML web services
    >
    > http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx
    > --
    > John Saunders [MVP]
    >
    >
    KBSTours, Aug 28, 2007
    #7
  8. "KBSTours" <> wrote in message
    news:...
    > Hi John,
    >
    > It is not my first time using webservices.
    > Please see Stevens comments too. He clearly mentions that .NET needs to do
    > this escaping as a safe guard which I am trying to prevent.


    You have misread Steven's post. The escaping he's referring to is within
    text nodes. That is, within an attribute value or within the text value of
    an element. For instance:

    <element attr="&lt;x&gt;">Includes &quot;&amp;&quot;</element>

    The main portion of your SOAP messages should not be getting escaped. If it
    is, then you are doing something very unusual.

    As a hint: note that there are many questions about web services on this
    newsgroup, and yet no questions about how to not escape SOAP messages. Your
    problem must be unique to your code.

    Please post some of your code, so we can see what is going on. In
    particular, if you can create a smaller example that reproduces what you're
    seeing, and then if you could post the WSDL and client code for that smaller
    example, then we'd be able to see what you're doing to produce escaped XML.
    Without that, we're just guessing.

    And, please let me reiterate that this may very well have to do with the
    fact that you are manipulating OuterXml. It should be unnecessary to deal
    with the string representation of XML in a web service.


    Here are some basic references on Web Services in .NET:

    Overview of XML Web services:
    http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx

    A walkthrough of building a basic XML Web service:
    http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx

    A walkthrough of building a basic client application:
    http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx

    Serializing objects with XML web services
    http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx

    --
    John Saunders [MVP]
    John Saunders [MVP], Aug 28, 2007
    #8
  9. Thanks for the reply,

    So based on your further description, I know that the java webservice
    actually expect a webservice SOAP message which contains an XML fragment
    (which is not escaped) as part of the SOAP body itself. I'm afraid this
    doesn't quite conform to XML webservice standard. Because for any method's
    data(parameters or return value) ,if it contains particular charaters, it
    should be escaped. For example, the SOAP body xml document is used to
    represent a request message of a method call, however, if your parameters
    data is a XML fragment and not escaped, how can we know which part of the
    xml document is the method body and which part are parameters data?

    Therefore, for the scenario here, I think it would be better to manually
    post the XML soap message through some network components such as
    HttpWebRequest as it can let you freely control the underlying tranfered
    message data. How do you think?

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    >From: "KBSTours" <>


    >Hi Steven,
    >
    >The webservice (not the native .NET webservice) which is written in Java

    is
    >expecting the string in XML format without being escaped. Its not my
    >service, I am just trying to consume it.
    >So how can I customize it in the proxy class?
    >
    >What are the basics? Are there any samples or guides?
    >
    >--
    >
    >
    >CTO
    >www.kbstours.com
    >"Steven Cheng[MSFT]" <> wrote in message
    >news:X%23gO%23$...
    >> Thanks for John's input.
    >>
    >> Hello SevDer,
    >>
    >> I agree that the problem should be quite specific to the service and its
    >> requirement on the SOAP message format. Would you provide some further
    >> information on the service(such as the format and structure of the SOAP
    >> message it expects from client). Normally, for any string value inside

    XML
    >> document(include SOAP envelope), it have to escape those special
    >> characters
    >> so as to ensure the validity of the document. If the customzation
    >> requests
    >> for your scenario does be reasonable, we may look for some ways to
    >> customize the client proxy class.
    >>
    >> Please feel free to post here if there is anything we've missed.
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >>
    >>
    >> ==================================================
    >>
    >> Get notification to my posts through email? Please refer to
    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >>
    >>
    >>
    >> Note: The MSDN Managed Newsgroup support offering is for non-urgent

    issues
    >> where an initial response from the community or a Microsoft Support
    >> Engineer within 1 business day is acceptable. Please note that each

    follow
    >> up response may take approximately 2 business days as the support
    >> professional working with you may need further investigation to reach the
    >> most efficient resolution. The offering is not appropriate for situations
    >> that require urgent, real-time or phone-based interactions or complex
    >> project analysis and dump analysis issues. Issues of this nature are best
    >> handled working with a dedicated Microsoft Support Engineer by contacting
    >> Microsoft Customer Support Services (CSS) at
    >> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>
    >> ==================================================
    >>
    >>
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >>
    >> --------------------
    >>>From: "John Saunders [MVP]" <john.saunders at trizetto.com>
    >>>References: <>

    >> <>
    >> <>
    >>>Subject: Re: Preventing Escapes in Post
    >>>Date: Sun, 26 Aug 2007 21:14:58 -0400
    >>>Lines: 58
    >>>Organization: The TriZetto Group, Inc.
    >>>MIME-Version: 1.0
    >>>Content-Type: text/plain;
    >>> format=flowed;
    >>> charset="iso-8859-1";
    >>> reply-type=response
    >>>Content-Transfer-Encoding: 7bit
    >>>X-Priority: 3
    >>>X-MSMail-Priority: Normal
    >>>X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
    >>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
    >>>Message-ID: <>
    >>>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >>>NNTP-Posting-Host: pool-71-184-5-216.bstnma.east.verizon.net 71.184.5.216
    >>>Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl
    >>>Xref: TK2MSFTNGHUB02.phx.gbl

    >> microsoft.public.dotnet.framework.aspnet.webservices:1413
    >>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >>>
    >>>"SevDer" <> wrote in message
    >>>news:...
    >>>> Hello John,
    >>>>
    >>>> Thanks for the reply.
    >>>>
    >>>> I think you should check this again. I've learned that .NET actually
    >>>> escapes the inner XML to prevent bad XML forming on some cases. And as

    >> far
    >>>> as I learned this is the behavior of .NET not the way that I use.
    >>>> Additionally the otherway around problem is there too. For your

    >> webservice
    >>>> to work with other applications, you will need to escape all received
    >>>> inner XMLs as they (like Java) send it as nonescaped form.
    >>>>
    >>>> Also I added as web reference and I am trying to make the webreference

    >> to
    >>>> work not any other way. If I cannot make this working, then I will have

    >> to
    >>>> POST using regular HTTP Post and not use wsdl reference.
    >>>>
    >>>> And their WSDL defined method calls does not accept structured objects

    >> but
    >>>> simple and generic object which actually is simple XML.
    >>>>
    >>>> The bottom line is, I am just trying to learn if there is a way for

    NET
    >>>> to not to escape my request XML while sending over!
    >>>
    >>>I promise you that, as a general rule, .NET doesn't prevent people from
    >>>using XML by escaping it. You are clearly using it in a way that other
    >>>developers do not use it - they are succeeding and you are failing.
    >>>
    >>>Please post some code showing us how you are using XML. Among other

    >> things,
    >>>your mention of "inner xml" is frightening. You are doing something very
    >>>strange.
    >>>
    >>>Please look at some of the following links on Web Service basics.
    >>>
    >>>Overview of XML Web services:
    >>>
    >>>http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx
    >>>
    >>>
    >>>
    >>>A walkthrough of building a basic XML Web service:
    >>>
    >>>http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx
    >>>
    >>>
    >>>
    >>>A walkthrough of building a basic client application:
    >>>
    >>>http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx
    >>>
    >>>
    >>>
    >>>Serializing objects with XML web services
    >>>
    >>>http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx
    >>>--
    >>>John Saunders [MVP]
    >>>
    >>>
    >>>

    >>

    >
    >
    Steven Cheng[MSFT], Aug 29, 2007
    #9
  10. SevDer

    KBSTours Guest

    Thanks Steven,

    I was actually looking for answer and you've given that to me.
    At least I do not need to look for more.

    I also during that time, given up and started developing by my own posting
    as I didn't see any chance.

    Thanks for the information.

    --


    CTO
    www.kbstours.com
    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Thanks for the reply,
    >
    > So based on your further description, I know that the java webservice
    > actually expect a webservice SOAP message which contains an XML fragment
    > (which is not escaped) as part of the SOAP body itself. I'm afraid this
    > doesn't quite conform to XML webservice standard. Because for any method's
    > data(parameters or return value) ,if it contains particular charaters, it
    > should be escaped. For example, the SOAP body xml document is used to
    > represent a request message of a method call, however, if your parameters
    > data is a XML fragment and not escaped, how can we know which part of the
    > xml document is the method body and which part are parameters data?
    >
    > Therefore, for the scenario here, I think it would be better to manually
    > post the XML soap message through some network components such as
    > HttpWebRequest as it can let you freely control the underlying tranfered
    > message data. How do you think?
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    >
    > --------------------
    >>From: "KBSTours" <>

    >
    >>Hi Steven,
    >>
    >>The webservice (not the native .NET webservice) which is written in Java

    > is
    >>expecting the string in XML format without being escaped. Its not my
    >>service, I am just trying to consume it.
    >>So how can I customize it in the proxy class?
    >>
    >>What are the basics? Are there any samples or guides?
    >>
    >>--
    >>
    >>
    >>CTO
    >>www.kbstours.com
    >>"Steven Cheng[MSFT]" <> wrote in message
    >>news:X%23gO%23$...
    >>> Thanks for John's input.
    >>>
    >>> Hello SevDer,
    >>>
    >>> I agree that the problem should be quite specific to the service and its
    >>> requirement on the SOAP message format. Would you provide some further
    >>> information on the service(such as the format and structure of the SOAP
    >>> message it expects from client). Normally, for any string value inside

    > XML
    >>> document(include SOAP envelope), it have to escape those special
    >>> characters
    >>> so as to ensure the validity of the document. If the customzation
    >>> requests
    >>> for your scenario does be reasonable, we may look for some ways to
    >>> customize the client proxy class.
    >>>
    >>> Please feel free to post here if there is anything we've missed.
    >>>
    >>> Sincerely,
    >>>
    >>> Steven Cheng
    >>>
    >>> Microsoft MSDN Online Support Lead
    >>>
    >>>
    >>>
    >>> ==================================================
    >>>
    >>> Get notification to my posts through email? Please refer to
    >>>

    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >>> ications.
    >>>
    >>>
    >>>
    >>> Note: The MSDN Managed Newsgroup support offering is for non-urgent

    > issues
    >>> where an initial response from the community or a Microsoft Support
    >>> Engineer within 1 business day is acceptable. Please note that each

    > follow
    >>> up response may take approximately 2 business days as the support
    >>> professional working with you may need further investigation to reach
    >>> the
    >>> most efficient resolution. The offering is not appropriate for
    >>> situations
    >>> that require urgent, real-time or phone-based interactions or complex
    >>> project analysis and dump analysis issues. Issues of this nature are
    >>> best
    >>> handled working with a dedicated Microsoft Support Engineer by
    >>> contacting
    >>> Microsoft Customer Support Services (CSS) at
    >>> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>>
    >>> ==================================================
    >>>
    >>>
    >>> This posting is provided "AS IS" with no warranties, and confers no
    >>> rights.
    >>>
    >>>
    >>>
    >>> --------------------
    >>>>From: "John Saunders [MVP]" <john.saunders at trizetto.com>
    >>>>References: <>
    >>> <>
    >>> <>
    >>>>Subject: Re: Preventing Escapes in Post
    >>>>Date: Sun, 26 Aug 2007 21:14:58 -0400
    >>>>Lines: 58
    >>>>Organization: The TriZetto Group, Inc.
    >>>>MIME-Version: 1.0
    >>>>Content-Type: text/plain;
    >>>> format=flowed;
    >>>> charset="iso-8859-1";
    >>>> reply-type=response
    >>>>Content-Transfer-Encoding: 7bit
    >>>>X-Priority: 3
    >>>>X-MSMail-Priority: Normal
    >>>>X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
    >>>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
    >>>>Message-ID: <>
    >>>>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >>>>NNTP-Posting-Host: pool-71-184-5-216.bstnma.east.verizon.net
    >>>>71.184.5.216
    >>>>Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl
    >>>>Xref: TK2MSFTNGHUB02.phx.gbl
    >>> microsoft.public.dotnet.framework.aspnet.webservices:1413
    >>>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >>>>
    >>>>"SevDer" <> wrote in message
    >>>>news:...
    >>>>> Hello John,
    >>>>>
    >>>>> Thanks for the reply.
    >>>>>
    >>>>> I think you should check this again. I've learned that .NET actually
    >>>>> escapes the inner XML to prevent bad XML forming on some cases. And as
    >>> far
    >>>>> as I learned this is the behavior of .NET not the way that I use.
    >>>>> Additionally the otherway around problem is there too. For your
    >>> webservice
    >>>>> to work with other applications, you will need to escape all received
    >>>>> inner XMLs as they (like Java) send it as nonescaped form.
    >>>>>
    >>>>> Also I added as web reference and I am trying to make the webreference
    >>> to
    >>>>> work not any other way. If I cannot make this working, then I will
    >>>>> have
    >>> to
    >>>>> POST using regular HTTP Post and not use wsdl reference.
    >>>>>
    >>>>> And their WSDL defined method calls does not accept structured objects
    >>> but
    >>>>> simple and generic object which actually is simple XML.
    >>>>>
    >>>>> The bottom line is, I am just trying to learn if there is a way for

    > NET
    >>>>> to not to escape my request XML while sending over!
    >>>>
    >>>>I promise you that, as a general rule, .NET doesn't prevent people from
    >>>>using XML by escaping it. You are clearly using it in a way that other
    >>>>developers do not use it - they are succeeding and you are failing.
    >>>>
    >>>>Please post some code showing us how you are using XML. Among other
    >>> things,
    >>>>your mention of "inner xml" is frightening. You are doing something very
    >>>>strange.
    >>>>
    >>>>Please look at some of the following links on Web Service basics.
    >>>>
    >>>>Overview of XML Web services:
    >>>>
    >>>>http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx
    >>>>
    >>>>
    >>>>
    >>>>A walkthrough of building a basic XML Web service:
    >>>>
    >>>>http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx
    >>>>
    >>>>
    >>>>
    >>>>A walkthrough of building a basic client application:
    >>>>
    >>>>http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx
    >>>>
    >>>>
    >>>>
    >>>>Serializing objects with XML web services
    >>>>
    >>>>http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx
    >>>>--
    >>>>John Saunders [MVP]
    >>>>
    >>>>
    >>>>
    >>>

    >>
    >>

    >
    KBSTours, Aug 30, 2007
    #10
  11. Thanks for your followup,

    It's a pity that we can not do more here with the built-in features. Also,
    through XML webservice is designed to provide heterogenious platform
    interop and recommend document-literal and WSDL/SOAP restricted message
    formats, there are still many realworld services which do not quite conform
    to that, that makes the interop difficult :(.

    Anyway, if you need any further help later, please feel free to post here.

    Thanks for your posting!

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    >From: "KBSTours" <>
    >References: <>

    <>
    <>
    <>
    <X#gO#$>
    <>
    <>
    >In-Reply-To: <>
    >Subject: Re: Preventing Escapes in Post
    >Date: Wed, 29 Aug 2007 22:11:48 -0400
    >Lines: 226
    >Message-ID: <>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > format=flowed;
    > charset="iso-8859-1";
    > reply-type=original
    >Content-Transfer-Encoding: 7bit
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Windows Mail 6.0.6000.16480
    >X-MS-CommunityGroup-PostID: {A9559244-C3D8-48B3-99AD-A3C02C6A96E6}
    >X-MS-CommunityGroup-ThreadID: 8FF02BD5-84BB-4955-BB03-97C4F51154A0
    >X-MS-CommunityGroup-ParentID: ABC1F4AE-F1AE-4693-AECB-7ABB5A25C792
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16480
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >NNTP-Posting-Host: ool-4353afab.dyn.optonline.net 67.83.175.171
    >Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP04.phx.gbl
    >Xref: TK2MSFTNGHUB02.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:1435
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >Thanks Steven,
    >
    >I was actually looking for answer and you've given that to me.
    >At least I do not need to look for more.
    >
    >I also during that time, given up and started developing by my own posting
    >as I didn't see any chance.
    >
    >Thanks for the information.
    >
    >--
    >
    >
    >CTO
    >www.kbstours.com
    >"Steven Cheng[MSFT]" <> wrote in message
    >news:...
    >> Thanks for the reply,
    >>
    >> So based on your further description, I know that the java webservice
    >> actually expect a webservice SOAP message which contains an XML fragment
    >> (which is not escaped) as part of the SOAP body itself. I'm afraid this
    >> doesn't quite conform to XML webservice standard. Because for any

    method's
    >> data(parameters or return value) ,if it contains particular charaters, it
    >> should be escaped. For example, the SOAP body xml document is used to
    >> represent a request message of a method call, however, if your parameters
    >> data is a XML fragment and not escaped, how can we know which part of the
    >> xml document is the method body and which part are parameters data?
    >>
    >> Therefore, for the scenario here, I think it would be better to manually
    >> post the XML soap message through some network components such as
    >> HttpWebRequest as it can let you freely control the underlying tranfered
    >> message data. How do you think?
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >>
    >> This posting is provided "AS IS" with no warranties, and confers no
    >> rights.
    >>
    >>
    >> --------------------
    >>>From: "KBSTours" <>

    >>
    >>>Hi Steven,
    >>>
    >>>The webservice (not the native .NET webservice) which is written in Java

    >> is
    >>>expecting the string in XML format without being escaped. Its not my
    >>>service, I am just trying to consume it.
    >>>So how can I customize it in the proxy class?
    >>>
    >>>What are the basics? Are there any samples or guides?
    >>>
    >>>--
    >>>
    >>>
    >>>CTO
    >>>www.kbstours.com
    >>>"Steven Cheng[MSFT]" <> wrote in message
    >>>news:X%23gO%23$...
    >>>> Thanks for John's input.
    >>>>
    >>>> Hello SevDer,
    >>>>
    >>>> I agree that the problem should be quite specific to the service and

    its
    >>>> requirement on the SOAP message format. Would you provide some further
    >>>> information on the service(such as the format and structure of the SOAP
    >>>> message it expects from client). Normally, for any string value inside

    >> XML
    >>>> document(include SOAP envelope), it have to escape those special
    >>>> characters
    >>>> so as to ensure the validity of the document. If the customzation
    >>>> requests
    >>>> for your scenario does be reasonable, we may look for some ways to
    >>>> customize the client proxy class.
    >>>>
    >>>> Please feel free to post here if there is anything we've missed.
    >>>>
    >>>> Sincerely,
    >>>>
    >>>> Steven Cheng
    >>>>
    >>>> Microsoft MSDN Online Support Lead
    >>>>
    >>>>
    >>>>
    >>>> ==================================================
    >>>>
    >>>> Get notification to my posts through email? Please refer to
    >>>>

    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >>>> ications.
    >>>>
    >>>>
    >>>>
    >>>> Note: The MSDN Managed Newsgroup support offering is for non-urgent

    >> issues
    >>>> where an initial response from the community or a Microsoft Support
    >>>> Engineer within 1 business day is acceptable. Please note that each

    >> follow
    >>>> up response may take approximately 2 business days as the support
    >>>> professional working with you may need further investigation to reach
    >>>> the
    >>>> most efficient resolution. The offering is not appropriate for
    >>>> situations
    >>>> that require urgent, real-time or phone-based interactions or complex
    >>>> project analysis and dump analysis issues. Issues of this nature are
    >>>> best
    >>>> handled working with a dedicated Microsoft Support Engineer by
    >>>> contacting
    >>>> Microsoft Customer Support Services (CSS) at
    >>>> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>>>
    >>>> ==================================================
    >>>>
    >>>>
    >>>> This posting is provided "AS IS" with no warranties, and confers no
    >>>> rights.
    >>>>
    >>>>
    >>>>
    >>>> --------------------
    >>>>>From: "John Saunders [MVP]" <john.saunders at trizetto.com>
    >>>>>References: <>
    >>>> <>
    >>>> <>
    >>>>>Subject: Re: Preventing Escapes in Post
    >>>>>Date: Sun, 26 Aug 2007 21:14:58 -0400
    >>>>>Lines: 58
    >>>>>Organization: The TriZetto Group, Inc.
    >>>>>MIME-Version: 1.0
    >>>>>Content-Type: text/plain;
    >>>>> format=flowed;
    >>>>> charset="iso-8859-1";
    >>>>> reply-type=response
    >>>>>Content-Transfer-Encoding: 7bit
    >>>>>X-Priority: 3
    >>>>>X-MSMail-Priority: Normal
    >>>>>X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
    >>>>>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138
    >>>>>Message-ID: <>
    >>>>>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >>>>>NNTP-Posting-Host: pool-71-184-5-216.bstnma.east.verizon.net
    >>>>>71.184.5.216
    >>>>>Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl
    >>>>>Xref: TK2MSFTNGHUB02.phx.gbl
    >>>> microsoft.public.dotnet.framework.aspnet.webservices:1413
    >>>>>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >>>>>
    >>>>>"SevDer" <> wrote in message
    >>>>>news:...
    >>>>>> Hello John,
    >>>>>>
    >>>>>> Thanks for the reply.
    >>>>>>
    >>>>>> I think you should check this again. I've learned that .NET actually
    >>>>>> escapes the inner XML to prevent bad XML forming on some cases. And

    as
    >>>> far
    >>>>>> as I learned this is the behavior of .NET not the way that I use.
    >>>>>> Additionally the otherway around problem is there too. For your
    >>>> webservice
    >>>>>> to work with other applications, you will need to escape all received
    >>>>>> inner XMLs as they (like Java) send it as nonescaped form.
    >>>>>>
    >>>>>> Also I added as web reference and I am trying to make the

    webreference
    >>>> to
    >>>>>> work not any other way. If I cannot make this working, then I will
    >>>>>> have
    >>>> to
    >>>>>> POST using regular HTTP Post and not use wsdl reference.
    >>>>>>
    >>>>>> And their WSDL defined method calls does not accept structured

    objects
    >>>> but
    >>>>>> simple and generic object which actually is simple XML.
    >>>>>>
    >>>>>> The bottom line is, I am just trying to learn if there is a way for

    >> NET
    >>>>>> to not to escape my request XML while sending over!
    >>>>>
    >>>>>I promise you that, as a general rule, .NET doesn't prevent people from
    >>>>>using XML by escaping it. You are clearly using it in a way that other
    >>>>>developers do not use it - they are succeeding and you are failing.
    >>>>>
    >>>>>Please post some code showing us how you are using XML. Among other
    >>>> things,
    >>>>>your mention of "inner xml" is frightening. You are doing something

    very
    >>>>>strange.
    >>>>>
    >>>>>Please look at some of the following links on Web Service basics.
    >>>>>
    >>>>>Overview of XML Web services:
    >>>>>
    >>>>>http://msdn2.microsoft.com/en-us/library/7bkzywba.aspx
    >>>>>
    >>>>>
    >>>>>
    >>>>>A walkthrough of building a basic XML Web service:
    >>>>>
    >>>>>http://msdn2.microsoft.com/en-us/library/7hs6sw69.aspx
    >>>>>
    >>>>>
    >>>>>
    >>>>>A walkthrough of building a basic client application:
    >>>>>
    >>>>>http://msdn2.microsoft.com/en-us/library/hk7y1596.aspx
    >>>>>
    >>>>>
    >>>>>
    >>>>>Serializing objects with XML web services
    >>>>>
    >>>>>http://msdn2.microsoft.com/en-us/library/564k8ys4.aspx
    >>>>>--
    >>>>>John Saunders [MVP]
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>
    >>>

    >>

    >
    >
    Steven Cheng[MSFT], Aug 30, 2007
    #11
    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. Rick Brandt

    Escapes Sequences Not Working?

    Rick Brandt, Aug 25, 2004, in forum: XML
    Replies:
    13
    Views:
    733
    Donald Roby
    Aug 28, 2004
  2. Alexander Schmolck

    re.sub replacement text \-escapes woe

    Alexander Schmolck, Feb 13, 2004, in forum: Python
    Replies:
    4
    Views:
    372
    Alexander Schmolck
    Feb 14, 2004
  3. Xah Lee

    Q: quoting string without escapes

    Xah Lee, Jan 31, 2005, in forum: Python
    Replies:
    2
    Views:
    362
    Daniel Bickett
    Jan 31, 2005
  4. Hans-Peter Jansen

    convert ascii escapes into binary form

    Hans-Peter Jansen, Jul 20, 2005, in forum: Python
    Replies:
    3
    Views:
    618
    Hans-Peter Jansen
    Jul 20, 2005
  5. James Thiele

    escapes in regular expressions

    James Thiele, May 21, 2006, in forum: Python
    Replies:
    4
    Views:
    241
    Heiko Wundram
    May 21, 2006
Loading...

Share This Page