none
CRM Adapter FetchResponse Parsing RRS feed

  • Question

  • Hi All

    What is the best way of parsing the FetchResponse returned from CRM using the CRM Adapter 4.0 ?

    I want to extract the <FetchXmlResult> content from the below Response , construct a new XMLDocument(Schema) & use this for another mapping (to destination system).

    How can the serialization of &lt; into <  be handled ?

    I have read some previous posts here ,but I am looking for specific details .

    <ns0:Response xmlns:ns0="http://schemas.microsoft.com/crm/BizTalkAdapter/Response">

    <Header>

    <ReturnCode>1</ReturnCode>

    <ErrorCode />

    <ErrorString />

    <Retryable />

    </Header>

    <Body>

    <Message><prefix:ExecuteFetchResponse xmlns:prefix="http://localhost/schemas.microsoft.com/crm/2006/ExecuteFetchResponse"><FetchXmlResult>&lt;resultset morerecords='0' paging-cookie='$1$$incident$incidentid$1$0$38${7C89EC34-6828-410B-9718-185B5A39A8BA}$!$incident$incidentid$1$0$38${7C89EC34-6828-410B-9718-185B5A39A8BA}$'&gt;&lt;result&gt;&lt;ticketnumber&gt;CAS-01006-ZBEJ0W&lt;/ticketnumber&gt;&lt;title&gt;This is test case1&lt;/title&gt;&lt;/result&gt;&lt;/resultset&gt;</FetchXmlResult></prefix:ExecuteFetchResponse></Message>

    </Body>

    </ns0:Response>

     

    Thanks & Regards

    Sullu


    Please mark as answer if this solved the issue.Thanks
    Tuesday, November 30, 2010 10:16 AM

Answers

  • Ok.

    I managed to get a solution , but not sure if there is any better way.

    I formatted the XML  by doing  string replace, for example characters like &lt; with "<". This can be done in better ways using external .NET code or within Orchestration expression shape.

    Now my XML is well formatted & I selected the single result node from the XML,have created a Schema out of it.

    Used the Result schema to map with destination system.

    if anybody still got any other way of doing it ,please dont hesitate to share here.

    NB: The resultset returned by calling the webservice directly (using .NET code) is much better & cleaner than the one returned by CRM Adapter in BizTalk.

    Thanks .

    Sullu

     


    Please mark as answer if this solved the issue.Thanks
    Tuesday, November 30, 2010 3:17 PM