views:

342

answers:

1

HI,

i am using BTS 2006 adapter for MS CRM 4.0 to create records and to fetch data from MS CRM 4.0. I want to get the response from CRM after the record is created or to fetch data from CRM For this i am using response.xsd coming with BTS 2006 adapter for MS CRM 4.0 to receive response from MS CRM i set the target namespace for reponse.xsd as: targetNamespace="http://schemas.microsoft.com/crm/2007/BizTalkAdapter/MicrosoftCRM/Response" according to the organization name here orgName: "MicrosoftCRM" (For more details on this i am referring http://www.ascentium.com/blog/crm/Post398.aspx )

Now i am getting an error:

Exception thrown from: segment -1, progress -1 Inner exception: Received unexpected message type '' does not match expected type 'http://schemas.microsoft.com/crm/2007/BizTalkAdapter/MicrosoftCRM/Response#Response'

Exception type: UnexpectedMessageTypeException Source: Microsoft.XLANGs.Engine Target Site: Void VerifyMessage(Microsoft.XLANGs.Core.Envelope, System.String, Microsoft.XLANGs.Core.Context, Microsoft.XLANGs.Core.OperationInfo)

Here is the Schema instance for response.xsd generated in Visual Studio 2005

 - <ns0:Response xmlns:ns0="http://schemas.microsoft.com/crm/2007/BizTalkAdapter/MicrosoftCRM/Response"&gt;
    - <Header>
      <ReturnCode>ReturnCode_0</ReturnCode>
      <ErrorCode>ErrorCode_0</ErrorCode>
      <ErrorString>ErrorString_0</ErrorString>
      <Retryable>Retryable_0</Retryable>
      </Header>
    - <Body>
      <Message>Message_0</Message>
      </Body>
      </ns0:Response>

and this the suspended message details of response from CRM

<ns0:Response xmlns:ns0="http://schemas.microsoft.com/crm/2007/BizTalkAdapter/MicrosoftCRM/Response"&gt;
    <Header>
        <ReturnCode>1</ReturnCode>
        <ErrorCode></ErrorCode>
        <ErrorString></ErrorString>
        <Retryable></Retryable>
    </Header>
    <Body>
        <Message><prefix:CreateResponse xmlns:prefix="http://localhost/schemas.microsoft.com/crm/2007/MicrosoftCRM/CreateResponse"&gt;&lt;id&gt;f0650fb5-3ff7-dd11-b0f0-0003ff1a2a3c&lt;/id&gt;&lt;/prefix:CreateResponse&gt;&lt;/Message&gt;
    </Body>
</ns0:Response>

Thanks,

Kuldip

A: 

Starting from Microsoft BizTalk CRM 4.0 adapter onwards, use the adapter auto-generated schema 'CRMAdapterResponse_Response.xsd', instead of 'response.xsd'. This schema will be specific to the organization under consideration.

The use of the schema will solve your 'schema does not match expected type' problem.

Thanks.

Naveen Karamchetti