XML Deserializing issue

Discussion in 'ASP .Net Web Services' started by VGE, Apr 10, 2008.

  1. VGE

    VGE Guest

    We are consuming a web service and we receive the following response soap:

    ResponseCode: 200 (OK)
    X-SOAP-Server:NuSOAP/0.7.2 (1.6)
    Keep-Alive:timeout=15, max=100
    Connection:Keep-Alive
    Content-Length:1540
    Content-Type:text/xml; charset=ISO-8859-1
    Date:Thu, 10 Apr 2008 01:29:51 GMT
    Server:Apache
    X-Powered-By:pHP/5.2.5

    <?xml version="1.0" encoding="utf-16"?>
    <SOAP-ENV:Envelope
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <getQuoteResponse xmlns="urn:pngwsdl">
    <quoteResponse>
    <pngRequestId>VGE0409200813976API674700055047</pngRequestId>
    <site>
    <street>2520 Whitehall Park Dr</street>
    <city>Charlotte</city>
    <state>NC</state>
    <zip>28273</zip>
    <npa>704</npa>
    <nxx>555</nxx>
    </site>
    <quotes>
    <item>
    <quoteId>VGETB00409200813977API021200129473</quoteId>
    <carrier>Broadwing</carrier>
    <term>12</term>
    <expirationDate>2008-05-09</expirationDate>
    <loopMRC>308</loopMRC>
    <loopNRC>0</loopNRC>
    <portMRC>358</portMRC>
    <portNRC>0</portNRC>
    </item>
    <item>
    <quoteId>VGETB00409200813983API023600182299</quoteId>
    <carrier>Broadwing</carrier>
    <term>36</term>
    <expirationDate>2008-05-09</expirationDate>
    <loopMRC>272</loopMRC>
    <loopNRC>0</loopNRC>
    <portMRC>287</portMRC>
    <portNRC>0</portNRC>
    </item>
    <item>
    <quoteId>VGETB00409200813982API022400121435</quoteId>
    <carrier>Broadwing</carrier>
    <term>24</term>
    <expirationDate>2008-05-09</expirationDate>
    <loopMRC>281</loopMRC>
    <loopNRC>0</loopNRC>
    <portMRC>310</portMRC>
    <portNRC>0</portNRC>
    </item>
    </quotes>
    <message>Verizon, Paetec, XO, Qwest failed to return valid
    pricing or support the service type and bandwidth of this request.</message>
    </quoteResponse>
    </getQuoteResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>


    However the object as created by the Framework contains all nulls and
    has the following hierarchy:

    getQuote
    Headers
    Body
    quoteResponse
    pngResultId = null
    site = null
    siteZ = null
    quotes = null
    message = null

    If I manually deserialize the soap response it creates the object with
    the above structure except with the appropriate data. How do I fix this
    so that the object generated by the framework will populate correctly
    with the data when the response is received?

    I hope that explains the question.

    Thanks,

    Neville Kelly
    VGE
     
    VGE, Apr 10, 2008
    #1
    1. Advertising

  2. Hi Neville,

    From your description, when consuming one webservice, you found that your
    client proxy doesn't correctly populate the properties of the response
    object, correct?

    As for the webservice, is it an ASP.NET webservice or generated upon other
    platform? Since the SOAP message does carry the XML data, it does be likely
    a XML deserialization issue. is it possible that you provide a publich
    accessible url , I'd like to perform some test on my side to have a further
    look.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

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

    --------------------
    >Date: Thu, 10 Apr 2008 16:06:29 -0400
    >From: VGE <>
    >User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
    >MIME-Version: 1.0
    >Subject: XML Deserializing issue


    >
    >We are consuming a web service and we receive the following response soap:
    >
    >ResponseCode: 200 (OK)
    >X-SOAP-Server:NuSOAP/0.7.2 (1.6)
    >Keep-Alive:timeout=15, max=100
    >Connection:Keep-Alive
    >Content-Length:1540
    >Content-Type:text/xml; charset=ISO-8859-1
    >Date:Thu, 10 Apr 2008 01:29:51 GMT
    >Server:Apache
    >X-Powered-By:pHP/5.2.5
    >
    ><?xml version="1.0" encoding="utf-16"?>
    ><SOAP-ENV:Envelope
    >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    >xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    > <SOAP-ENV:Body>
    > <getQuoteResponse xmlns="urn:pngwsdl">
    > <quoteResponse>
    > <pngRequestId>VGE0409200813976API674700055047</pngRequestId>
    > <site>
    > <street>2520 Whitehall Park Dr</street>
    > <city>Charlotte</city>
    > <state>NC</state>
    > <zip>28273</zip>
    > <npa>704</npa>
    > <nxx>555</nxx>
    > </site>
    > <quotes>
    > <item>
    > <quoteId>VGETB00409200813977API021200129473</quoteId>
    > <carrier>Broadwing</carrier>
    > <term>12</term>
    > <expirationDate>2008-05-09</expirationDate>
    > <loopMRC>308</loopMRC>
    > <loopNRC>0</loopNRC>
    > <portMRC>358</portMRC>
    > <portNRC>0</portNRC>
    > </item>
    > <item>
    > <quoteId>VGETB00409200813983API023600182299</quoteId>
    > <carrier>Broadwing</carrier>
    > <term>36</term>
    > <expirationDate>2008-05-09</expirationDate>
    > <loopMRC>272</loopMRC>
    > <loopNRC>0</loopNRC>
    > <portMRC>287</portMRC>
    > <portNRC>0</portNRC>
    > </item>
    > <item>
    > <quoteId>VGETB00409200813982API022400121435</quoteId>
    > <carrier>Broadwing</carrier>
    > <term>24</term>
    > <expirationDate>2008-05-09</expirationDate>
    > <loopMRC>281</loopMRC>
    > <loopNRC>0</loopNRC>
    > <portMRC>310</portMRC>
    > <portNRC>0</portNRC>
    > </item>
    > </quotes>
    > <message>Verizon, Paetec, XO, Qwest failed to return valid
    >pricing or support the service type and bandwidth of this

    request.</message>
    > </quoteResponse>
    > </getQuoteResponse>
    > </SOAP-ENV:Body>
    ></SOAP-ENV:Envelope>
    >
    >
    >However the object as created by the Framework contains all nulls and
    >has the following hierarchy:
    >
    >getQuote
    > Headers
    > Body
    > quoteResponse
    > pngResultId = null
    > site = null
    > siteZ = null
    > quotes = null
    > message = null
    >
    >If I manually deserialize the soap response it creates the object with
    >the above structure except with the appropriate data. How do I fix this
    >so that the object generated by the framework will populate correctly
    >with the data when the response is received?
    >
    >I hope that explains the question.
    >
    >Thanks,
    >
    >Neville Kelly
    >VGE
    >
     
    Steven Cheng [MSFT], Apr 11, 2008
    #2
    1. Advertising

  3. VGE

    VGE Guest

    Here is the url to the web service. And the request input. When adding
    the web service you have to add it as a 2.0 service since 3.0/3.5 will
    not consume it correctly. It was created using NuSoap, that is all I
    know about it since it is not ours we are just trying to consume it.

    Url:
    http://ecare.pngcom.com/agentportal2/dedicated/WSTest/PNGQuote.php?WSDL

    Request Input:
    <?xml version="1.0" encoding="utf-16"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <getQuote xmlns="urn:pngwsdl">
    <quoteRequest user="VGE" password="plops" xmlns="">
    <site>
    <street>2520 Whitehall Park Dr</street>
    <city>Charlotte</city>
    <state>NC</state>
    <zip>28273</zip>
    <npa>704</npa>
    <nxx>555</nxx>
    </site>
    <siteZ>
    <street />
    <city />
    <state />
    <zip>0</zip>
    <npa>0</npa>
    <nxx>0</nxx>
    </siteZ>
    <serviceType>Data</serviceType>
    <customId />
    <bandwidth>DS-1</bandwidth>
    </quoteRequest>
    </getQuote>
    </soap:Body>
    </soap:Envelope>

    Thanks,

    Neville Kelly
    VGE

    Steven Cheng [MSFT] wrote:
    > Hi Neville,
    >
    > From your description, when consuming one webservice, you found that your
    > client proxy doesn't correctly populate the properties of the response
    > object, correct?
    >
    > As for the webservice, is it an ASP.NET webservice or generated upon other
    > platform? Since the SOAP message does carry the XML data, it does be likely
    > a XML deserialization issue. is it possible that you provide a publich
    > accessible url , I'd like to perform some test on my side to have a further
    > look.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > Delighting our customers is our #1 priority. We welcome your comments and
    > suggestions about how we can improve the support we provide to you. Please
    > feel free to let my manager know what you think of the level of service
    > provided. You can send feedback directly to my manager at:
    > .
    >
    > ==================================================
    > 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.
    >
    > --------------------
    >> Date: Thu, 10 Apr 2008 16:06:29 -0400
    >> From: VGE <>
    >> User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
    >> MIME-Version: 1.0
    >> Subject: XML Deserializing issue

    >
    >> We are consuming a web service and we receive the following response soap:
    >>
    >> ResponseCode: 200 (OK)
    >> X-SOAP-Server:NuSOAP/0.7.2 (1.6)
    >> Keep-Alive:timeout=15, max=100
    >> Connection:Keep-Alive
    >> Content-Length:1540
    >> Content-Type:text/xml; charset=ISO-8859-1
    >> Date:Thu, 10 Apr 2008 01:29:51 GMT
    >> Server:Apache
    >> X-Powered-By:pHP/5.2.5
    >>
    >> <?xml version="1.0" encoding="utf-16"?>
    >> <SOAP-ENV:Envelope
    >> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    >> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    >> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    >> <SOAP-ENV:Body>
    >> <getQuoteResponse xmlns="urn:pngwsdl">
    >> <quoteResponse>
    >> <pngRequestId>VGE0409200813976API674700055047</pngRequestId>
    >> <site>
    >> <street>2520 Whitehall Park Dr</street>
    >> <city>Charlotte</city>
    >> <state>NC</state>
    >> <zip>28273</zip>
    >> <npa>704</npa>
    >> <nxx>555</nxx>
    >> </site>
    >> <quotes>
    >> <item>
    >> <quoteId>VGETB00409200813977API021200129473</quoteId>
    >> <carrier>Broadwing</carrier>
    >> <term>12</term>
    >> <expirationDate>2008-05-09</expirationDate>
    >> <loopMRC>308</loopMRC>
    >> <loopNRC>0</loopNRC>
    >> <portMRC>358</portMRC>
    >> <portNRC>0</portNRC>
    >> </item>
    >> <item>
    >> <quoteId>VGETB00409200813983API023600182299</quoteId>
    >> <carrier>Broadwing</carrier>
    >> <term>36</term>
    >> <expirationDate>2008-05-09</expirationDate>
    >> <loopMRC>272</loopMRC>
    >> <loopNRC>0</loopNRC>
    >> <portMRC>287</portMRC>
    >> <portNRC>0</portNRC>
    >> </item>
    >> <item>
    >> <quoteId>VGETB00409200813982API022400121435</quoteId>
    >> <carrier>Broadwing</carrier>
    >> <term>24</term>
    >> <expirationDate>2008-05-09</expirationDate>
    >> <loopMRC>281</loopMRC>
    >> <loopNRC>0</loopNRC>
    >> <portMRC>310</portMRC>
    >> <portNRC>0</portNRC>
    >> </item>
    >> </quotes>
    >> <message>Verizon, Paetec, XO, Qwest failed to return valid
    >> pricing or support the service type and bandwidth of this

    > request.</message>
    >> </quoteResponse>
    >> </getQuoteResponse>
    >> </SOAP-ENV:Body>
    >> </SOAP-ENV:Envelope>
    >>
    >>
    >> However the object as created by the Framework contains all nulls and
    >> has the following hierarchy:
    >>
    >> getQuote
    >> Headers
    >> Body
    >> quoteResponse
    >> pngResultId = null
    >> site = null
    >> siteZ = null
    >> quotes = null
    >> message = null
    >>
    >> If I manually deserialize the soap response it creates the object with
    >> the above structure except with the appropriate data. How do I fix this
    >> so that the object generated by the framework will populate correctly
    >> with the data when the response is received?
    >>
    >> I hope that explains the question.
    >>
    >> Thanks,
    >>
    >> Neville Kelly
    >> VGE
    >>

    >
     
    VGE, Apr 11, 2008
    #3
  4. Hi VGE,

    Regarding on the the test url you provided. I've visited it and try
    generating proxy and consume it. I've used the request sample you provided
    and the webservice call did reach the server. However, it report an
    authentication error, indicate that I need to supply username/password.

    Is there a test account you can provide me for test? If its not that
    confidential, you can send it to me offline by the following email:

    "stcheng" +"@" + "microsoft.com"

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

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

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

    --------------------
    >Date: Fri, 11 Apr 2008 15:27:36 -0400
    >From: VGE <>
    >User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
    >MIME-Version: 1.0
    >Subject: Re: XML Deserializing issue


    >
    >Here is the url to the web service. And the request input. When adding
    >the web service you have to add it as a 2.0 service since 3.0/3.5 will
    >not consume it correctly. It was created using NuSoap, that is all I
    >know about it since it is not ours we are just trying to consume it.
    >
    >Url:
    >http://ecare.pngcom.com/agentportal2/dedicated/WSTest/PNGQuote.php?WSDL
    >
    >Request Input:
    ><?xml version="1.0" encoding="utf-16"?>
    ><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    > <soap:Body>
    > <getQuote xmlns="urn:pngwsdl">
    > <quoteRequest user="VGE" password="plops" xmlns="">
    > <site>
    > <street>2520 Whitehall Park Dr</street>
    > <city>Charlotte</city>
    > <state>NC</state>
    > <zip>28273</zip>
    > <npa>704</npa>
    > <nxx>555</nxx>
    > </site>
    > <siteZ>
    > <street />
    > <city />
    > <state />
    > <zip>0</zip>
    > <npa>0</npa>
    > <nxx>0</nxx>
    > </siteZ>
    > <serviceType>Data</serviceType>
    > <customId />
    > <bandwidth>DS-1</bandwidth>
    > </quoteRequest>
    > </getQuote>
    > </soap:Body>
    ></soap:Envelope>
    >
    >Thanks,
    >
    >Neville Kelly
    >VGE
    >
    >Steven Cheng [MSFT] wrote:
    >> Hi Neville,
    >>
    >> From your description, when consuming one webservice, you found that

    your
    >> client proxy doesn't correctly populate the properties of the response
    >> object, correct?
    >>
    >> As for the webservice, is it an ASP.NET webservice or generated upon

    other
    >> platform? Since the SOAP message does carry the XML data, it does be

    likely
    >> a XML deserialization issue. is it possible that you provide a publich
    >> accessible url , I'd like to perform some test on my side to have a

    further
    >> look.
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >>
    >> Delighting our customers is our #1 priority. We welcome your comments

    and
    >> suggestions about how we can improve the support we provide to you.

    Please
    >> feel free to let my manager know what you think of the level of service
    >> provided. You can send feedback directly to my manager at:
    >> .
    >>
    >> ==================================================
    >> 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.
    >>
    >> --------------------
    >>> Date: Thu, 10 Apr 2008 16:06:29 -0400
    >>> From: VGE <>
    >>> User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
    >>> MIME-Version: 1.0
    >>> Subject: XML Deserializing issue

    >>
    >>> We are consuming a web service and we receive the following response

    soap:
    >>>
    >>> ResponseCode: 200 (OK)
    >>> X-SOAP-Server:NuSOAP/0.7.2 (1.6)
    >>> Keep-Alive:timeout=15, max=100
    >>> Connection:Keep-Alive
    >>> Content-Length:1540
    >>> Content-Type:text/xml; charset=ISO-8859-1
    >>> Date:Thu, 10 Apr 2008 01:29:51 GMT
    >>> Server:Apache
    >>> X-Powered-By:pHP/5.2.5
    >>>
    >>> <?xml version="1.0" encoding="utf-16"?>
    >>> <SOAP-ENV:Envelope
    >>> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    >>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    >>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    >>> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    >>> <SOAP-ENV:Body>
    >>> <getQuoteResponse xmlns="urn:pngwsdl">
    >>> <quoteResponse>
    >>> <pngRequestId>VGE0409200813976API674700055047</pngRequestId>
    >>> <site>
    >>> <street>2520 Whitehall Park Dr</street>
    >>> <city>Charlotte</city>
    >>> <state>NC</state>
    >>> <zip>28273</zip>
    >>> <npa>704</npa>
    >>> <nxx>555</nxx>
    >>> </site>
    >>> <quotes>
    >>> <item>
    >>> <quoteId>VGETB00409200813977API021200129473</quoteId>
    >>> <carrier>Broadwing</carrier>
    >>> <term>12</term>
    >>> <expirationDate>2008-05-09</expirationDate>
    >>> <loopMRC>308</loopMRC>
    >>> <loopNRC>0</loopNRC>
    >>> <portMRC>358</portMRC>
    >>> <portNRC>0</portNRC>
    >>> </item>
    >>> <item>
    >>> <quoteId>VGETB00409200813983API023600182299</quoteId>
    >>> <carrier>Broadwing</carrier>
    >>> <term>36</term>
    >>> <expirationDate>2008-05-09</expirationDate>
    >>> <loopMRC>272</loopMRC>
    >>> <loopNRC>0</loopNRC>
    >>> <portMRC>287</portMRC>
    >>> <portNRC>0</portNRC>
    >>> </item>
    >>> <item>
    >>> <quoteId>VGETB00409200813982API022400121435</quoteId>
    >>> <carrier>Broadwing</carrier>
    >>> <term>24</term>
    >>> <expirationDate>2008-05-09</expirationDate>
    >>> <loopMRC>281</loopMRC>
    >>> <loopNRC>0</loopNRC>
    >>> <portMRC>310</portMRC>
    >>> <portNRC>0</portNRC>
    >>> </item>
    >>> </quotes>
    >>> <message>Verizon, Paetec, XO, Qwest failed to return valid
    >>> pricing or support the service type and bandwidth of this

    >> request.</message>
    >>> </quoteResponse>
    >>> </getQuoteResponse>
    >>> </SOAP-ENV:Body>
    >>> </SOAP-ENV:Envelope>
    >>>
    >>>
    >>> However the object as created by the Framework contains all nulls and
    >>> has the following hierarchy:
    >>>
    >>> getQuote
    >>> Headers
    >>> Body
    >>> quoteResponse
    >>> pngResultId = null
    >>> site = null
    >>> siteZ = null
    >>> quotes = null
    >>> message = null
    >>>
    >>> If I manually deserialize the soap response it creates the object with
    >>> the above structure except with the appropriate data. How do I fix this
    >>> so that the object generated by the framework will populate correctly
    >>> with the data when the response is received?
    >>>
    >>> I hope that explains the question.
    >>>
    >>> Thanks,
    >>>
    >>> Neville Kelly
    >>> VGE
    >>>

    >>

    >
     
    Steven Cheng [MSFT], Apr 15, 2008
    #4
  5. Hi VGE,

    I've got the credentials and have performed some further tests.

    Based on more tests(I save the response content into xml file and manually
    use Xmlserialzier to deserialize them), I found that the problem is due to
    the namespace setting for the classes defined in the auto-generated proxy
    file. The response content is as below:

    ===============
    <getQuoteResponse xmlns="urn:pngwsdl">
    <quoteResponse>
    <pngRequestId>VGE0416200827251API168700006528</pngRequestId><site><street>25
    20 Whitehall Park
    .........
    ============

    that means the <quoteResponse> element and its children are all under
    "urn:pngwsdl". However, in the auto-generated proxy classes, it use the
    following attributes to decorate the nested child elements of
    "quoteResponse" element:

    =================
    .....................
    public partial class quoteResponse {

    private string pngRequestIdField;

    private site siteField;

    private site siteZField;

    private quoteArray quotesField;

    private string messageField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form =
    System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public string pngRequestId {
    get {
    return this.pngRequestIdField;
    }
    set {
    this.pngRequestIdField = value;
    }
    }

    ....................
    =========================

    the [System.Xml.Serialization.XmlElementAttribute(Form =
    System.Xml.Schema.XmlSchemaForm.Unqualified)] result the .NET
    xmlserializer look for elements that doesn't have a namespace associated
    and then fail to deserlize those properties in the children of
    "quoteResponse" element.

    Currently a quick way to resolve the problem is customize the types in the
    generated proxy code. Here is a complete list of the modified properties:

    =========================
    System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml",
    "2.0.50727.1433")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:pngwsdl")]
    public partial class quoteResponse {

    private string pngRequestIdField;

    private site siteField;

    private site siteZField;

    private quoteArray quotesField;

    private string messageField;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form =
    System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    public string pngRequestId {
    get {
    return this.pngRequestIdField;
    }
    set {
    this.pngRequestIdField = value;
    }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form =
    System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    public site site {
    get {
    return this.siteField;
    }
    set {
    this.siteField = value;
    }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form =
    System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    public site siteZ {
    get {
    return this.siteZField;
    }
    set {
    this.siteZField = value;
    }
    }

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(Form =
    System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    public quoteArray quotes {
    get {
    return this.quotesField;
    }
    set {
    this.quotesField = value;
    }
    }

    /// <remarks/>

    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSche
    maForm.Qualified, Namespace="urn:pngwsdl")]
    public string message {
    get {
    return this.messageField;
    }
    set {
    this.messageField = value;
    }
    }
    }
    ===========================

    I've tested it and it worked correctly on my side. You can test it to see
    whether it works also.

    Hope this helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

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

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



    --------------------
    >From: (Steven Cheng [MSFT])
    >Organization: Microsoft
    >Date: Tue, 15 Apr 2008 06:37:09 GMT
    >Subject: Re: XML Deserializing issue


    >
    >Hi VGE,
    >
    >Regarding on the the test url you provided. I've visited it and try
    >generating proxy and consume it. I've used the request sample you provided
    >and the webservice call did reach the server. However, it report an
    >authentication error, indicate that I need to supply username/password.
    >
    >Is there a test account you can provide me for test? If its not that
    >confidential, you can send it to me offline by the following email:
    >
    >"stcheng" +"@" + "microsoft.com"
    >
    >Sincerely,
    >
    >Steven Cheng
    >
    >Microsoft MSDN Online Support Lead
    >
     
    Steven Cheng [MSFT], Apr 16, 2008
    #5
  6. VGE

    VGE Guest

    Thank you for the huge help. I was wondering if I wanted to go back to
    the vendor in this case and tell them to fix their web service what
    would be the best thing to say?

    Thanks

    Neville Kelly
    VGE

    Steven Cheng [MSFT] wrote:
    > Hi VGE,
    >
    > I've got the credentials and have performed some further tests.
    >
    > Based on more tests(I save the response content into xml file and manually
    > use Xmlserialzier to deserialize them), I found that the problem is due to
    > the namespace setting for the classes defined in the auto-generated proxy
    > file. The response content is as below:
    >
    > ===============
    > <getQuoteResponse xmlns="urn:pngwsdl">
    > <quoteResponse>
    > <pngRequestId>VGE0416200827251API168700006528</pngRequestId><site><street>25
    > 20 Whitehall Park
    > ........
    > ============
    >
    > that means the <quoteResponse> element and its children are all under
    > "urn:pngwsdl". However, in the auto-generated proxy classes, it use the
    > following attributes to decorate the nested child elements of
    > "quoteResponse" element:
    >
    > =================
    > ....................
    > public partial class quoteResponse {
    >
    > private string pngRequestIdField;
    >
    > private site siteField;
    >
    > private site siteZField;
    >
    > private quoteArray quotesField;
    >
    > private string messageField;
    >
    > /// <remarks/>
    > [System.Xml.Serialization.XmlElementAttribute(Form =
    > System.Xml.Schema.XmlSchemaForm.Unqualified)]
    > public string pngRequestId {
    > get {
    > return this.pngRequestIdField;
    > }
    > set {
    > this.pngRequestIdField = value;
    > }
    > }
    >
    > ...................
    > =========================
    >
    > the [System.Xml.Serialization.XmlElementAttribute(Form =
    > System.Xml.Schema.XmlSchemaForm.Unqualified)] result the .NET
    > xmlserializer look for elements that doesn't have a namespace associated
    > and then fail to deserlize those properties in the children of
    > "quoteResponse" element.
    >
    > Currently a quick way to resolve the problem is customize the types in the
    > generated proxy code. Here is a complete list of the modified properties:
    >
    > =========================
    > System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml",
    > "2.0.50727.1433")]
    > [System.SerializableAttribute()]
    > [System.Diagnostics.DebuggerStepThroughAttribute()]
    > [System.ComponentModel.DesignerCategoryAttribute("code")]
    > [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:pngwsdl")]
    > public partial class quoteResponse {
    >
    > private string pngRequestIdField;
    >
    > private site siteField;
    >
    > private site siteZField;
    >
    > private quoteArray quotesField;
    >
    > private string messageField;
    >
    > /// <remarks/>
    > [System.Xml.Serialization.XmlElementAttribute(Form =
    > System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    > public string pngRequestId {
    > get {
    > return this.pngRequestIdField;
    > }
    > set {
    > this.pngRequestIdField = value;
    > }
    > }
    >
    > /// <remarks/>
    > [System.Xml.Serialization.XmlElementAttribute(Form =
    > System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    > public site site {
    > get {
    > return this.siteField;
    > }
    > set {
    > this.siteField = value;
    > }
    > }
    >
    > /// <remarks/>
    > [System.Xml.Serialization.XmlElementAttribute(Form =
    > System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    > public site siteZ {
    > get {
    > return this.siteZField;
    > }
    > set {
    > this.siteZField = value;
    > }
    > }
    >
    > /// <remarks/>
    > [System.Xml.Serialization.XmlElementAttribute(Form =
    > System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    > public quoteArray quotes {
    > get {
    > return this.quotesField;
    > }
    > set {
    > this.quotesField = value;
    > }
    > }
    >
    > /// <remarks/>
    >
    > [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSche
    > maForm.Qualified, Namespace="urn:pngwsdl")]
    > public string message {
    > get {
    > return this.messageField;
    > }
    > set {
    > this.messageField = value;
    > }
    > }
    > }
    > ===========================
    >
    > I've tested it and it worked correctly on my side. You can test it to see
    > whether it works also.
    >
    > Hope this helps.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > Delighting our customers is our #1 priority. We welcome your comments and
    > suggestions about how we can improve the support we provide to you. Please
    > feel free to let my manager know what you think of the level of service
    > provided. You can send feedback directly to my manager at:
    > .
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > ==================================================
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    >
    > --------------------
    >> From: (Steven Cheng [MSFT])
    >> Organization: Microsoft
    >> Date: Tue, 15 Apr 2008 06:37:09 GMT
    >> Subject: Re: XML Deserializing issue

    >
    >> Hi VGE,
    >>
    >> Regarding on the the test url you provided. I've visited it and try
    >> generating proxy and consume it. I've used the request sample you provided
    >> and the webservice call did reach the server. However, it report an
    >> authentication error, indicate that I need to supply username/password.
    >>
    >> Is there a test account you can provide me for test? If its not that
    >> confidential, you can send it to me offline by the following email:
    >>
    >> "stcheng" +"@" + "microsoft.com"
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>

    >
     
    VGE, Apr 16, 2008
    #6
  7. Hi Neville,

    Thanks for your reply.

    So far I think you do not need to modify the WSDL since the problem here is
    also related to the wsdl.exe's code generation. This maybe a particular
    case in which the WSDL's type definiation(schema) make the code generation
    misunderstand the type's namespace. And it would be time consuming to find
    a new scheme style that will make the generation work correctly.
    Therefore, I think you can use the workaround mentioned earlier if you need
    a quick fix.

    Regards,

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

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

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


    --------------------
    >Date: Wed, 16 Apr 2008 10:54:02 -0400
    >From: VGE <>
    >User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
    >MIME-Version: 1.0
    >Subject: Re: XML Deserializing issue
    >References: <>

    <> <Ony6ZoAnIHA.5692
    >
    >Thank you for the huge help. I was wondering if I wanted to go back to
    >the vendor in this case and tell them to fix their web service what
    >would be the best thing to say?
    >
    >Thanks
    >
    >Neville Kelly
    >VGE
    >
    >Steven Cheng [MSFT] wrote:
    >> Hi VGE,
    >>
    >> I've got the credentials and have performed some further tests.
    >>
    >> Based on more tests(I save the response content into xml file and

    manually
    >> use Xmlserialzier to deserialize them), I found that the problem is due

    to
    >> the namespace setting for the classes defined in the auto-generated

    proxy
    >> file. The response content is as below:
    >>
    >> ===============
    >> <getQuoteResponse xmlns="urn:pngwsdl">
    >> <quoteResponse>
    >>

    <pngRequestId>VGE0416200827251API168700006528</pngRequestId><site><street>25
    >> 20 Whitehall Park
    >> ........
    >> ============
    >>
    >> that means the <quoteResponse> element and its children are all under
    >> "urn:pngwsdl". However, in the auto-generated proxy classes, it use the
    >> following attributes to decorate the nested child elements of
    >> "quoteResponse" element:
    >>
    >> =================
    >> ....................
    >> public partial class quoteResponse {
    >>
    >> private string pngRequestIdField;
    >>
    >> private site siteField;
    >>
    >> private site siteZField;
    >>
    >> private quoteArray quotesField;
    >>
    >> private string messageField;
    >>
    >> /// <remarks/>
    >> [System.Xml.Serialization.XmlElementAttribute(Form =
    >> System.Xml.Schema.XmlSchemaForm.Unqualified)]
    >> public string pngRequestId {
    >> get {
    >> return this.pngRequestIdField;
    >> }
    >> set {
    >> this.pngRequestIdField = value;
    >> }
    >> }
    >>
    >> ...................
    >> =========================
    >>
    >> the [System.Xml.Serialization.XmlElementAttribute(Form =
    >> System.Xml.Schema.XmlSchemaForm.Unqualified)] result the .NET
    >> xmlserializer look for elements that doesn't have a namespace associated
    >> and then fail to deserlize those properties in the children of
    >> "quoteResponse" element.
    >>
    >> Currently a quick way to resolve the problem is customize the types in

    the
    >> generated proxy code. Here is a complete list of the modified properties:
    >>
    >> =========================
    >> System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml",
    >> "2.0.50727.1433")]
    >> [System.SerializableAttribute()]
    >> [System.Diagnostics.DebuggerStepThroughAttribute()]
    >> [System.ComponentModel.DesignerCategoryAttribute("code")]
    >> [System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:pngwsdl")]
    >> public partial class quoteResponse {
    >>
    >> private string pngRequestIdField;
    >>
    >> private site siteField;
    >>
    >> private site siteZField;
    >>
    >> private quoteArray quotesField;
    >>
    >> private string messageField;
    >>
    >> /// <remarks/>
    >> [System.Xml.Serialization.XmlElementAttribute(Form =
    >> System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    >> public string pngRequestId {
    >> get {
    >> return this.pngRequestIdField;
    >> }
    >> set {
    >> this.pngRequestIdField = value;
    >> }
    >> }
    >>
    >> /// <remarks/>
    >> [System.Xml.Serialization.XmlElementAttribute(Form =
    >> System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    >> public site site {
    >> get {
    >> return this.siteField;
    >> }
    >> set {
    >> this.siteField = value;
    >> }
    >> }
    >>
    >> /// <remarks/>
    >> [System.Xml.Serialization.XmlElementAttribute(Form =
    >> System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    >> public site siteZ {
    >> get {
    >> return this.siteZField;
    >> }
    >> set {
    >> this.siteZField = value;
    >> }
    >> }
    >>
    >> /// <remarks/>
    >> [System.Xml.Serialization.XmlElementAttribute(Form =
    >> System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "urn:pngwsdl")]
    >> public quoteArray quotes {
    >> get {
    >> return this.quotesField;
    >> }
    >> set {
    >> this.quotesField = value;
    >> }
    >> }
    >>
    >> /// <remarks/>
    >>
    >>

    [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSche
    >> maForm.Qualified, Namespace="urn:pngwsdl")]
    >> public string message {
    >> get {
    >> return this.messageField;
    >> }
    >> set {
    >> this.messageField = value;
    >> }
    >> }
    >> }
    >> ===========================
    >>
    >> I've tested it and it worked correctly on my side. You can test it to

    see
    >> whether it works also.
    >>
    >> Hope this helps.
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >>
    >> Delighting our customers is our #1 priority. We welcome your comments

    and
    >> suggestions about how we can improve the support we provide to you.

    Please
    >> feel free to let my manager know what you think of the level of service
    >> provided. You can send feedback directly to my manager at:
    >> .
    >>
    >> ==================================================
    >> Get notification to my posts through email? Please refer to
    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >>
    >> ==================================================
    >> This posting is provided "AS IS" with no warranties, and confers no

    rights.
    >>
    >>
    >>
    >> --------------------
    >>> From: (Steven Cheng [MSFT])
    >>> Organization: Microsoft
    >>> Date: Tue, 15 Apr 2008 06:37:09 GMT
    >>> Subject: Re: XML Deserializing issue

    >>
    >>> Hi VGE,
    >>>
    >>> Regarding on the the test url you provided. I've visited it and try
    >>> generating proxy and consume it. I've used the request sample you

    provided
    >>> and the webservice call did reach the server. However, it report an
    >>> authentication error, indicate that I need to supply username/password.
    >>>
    >>> Is there a test account you can provide me for test? If its not that
    >>> confidential, you can send it to me offline by the following email:
    >>>
    >>> "stcheng" +"@" + "microsoft.com"
    >>>
    >>> Sincerely,
    >>>
    >>> Steven Cheng
    >>>
    >>> Microsoft MSDN Online Support Lead
    >>>

    >>

    >
     
    Steven Cheng [MSFT], Apr 17, 2008
    #7
    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. PJ
    Replies:
    1
    Views:
    1,803
    Ramzey
    Jun 25, 2003
  2. Sjaakie

    Problems with deserializing XML

    Sjaakie, Jul 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    559
    Sjaakie
    Jul 7, 2006
  3. Replies:
    0
    Views:
    443
  4. Replies:
    5
    Views:
    575
    RYoung
    Dec 15, 2006
  5. VGE

    XML Deserializing issue

    VGE, Apr 10, 2008, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    161
    Steven Cheng [MSFT]
    Apr 11, 2008
Loading...

Share This Page