Import Dynamics CRM 2011 Organization Service SOAP Protocol to BizTalk Server 2010
1)Open Visual Studio 2010, Select File menu -> New -> Project -> 'Empty BizTalk Server Project'

2)Right click the project, Select Add menu -> 'Add Generated Items...'

3)Select 'Consume WCF Service', press 'Add' button

4)'BizTalk WCF Service Consumng Wizard' will popup, select 'Metadata Exchange(MEX) endpoint', press 'Next' button
Enter the Metadata Address (URL) (Get the URL from CRM Settings -> Customizations -> Developer Resources -> Organization Service URL)
Press 'Get', 'Next', 'Import' and 'Finish' the button.

5)Now your project contains 2 bindinginfo (*.xml, 1 Orchestration (*.odx), and 9 Schemas (*.xsd).
Build your project, you will see atleast 121 errors. Because these are not valid schemas for this endpoint. They do not have the proper links between each other.

6)Two options to fix each schema - manually (complicated) or include BizTalk schemas from Dynamics CRM SDK (easy).
7)Delete all 9 schemas (*.xsd) from the project.
8)Right click the project, select 'Add' -> 'Existing Item', browse the 'CRM2011_SDK\sdk\schemas\crmbiztalkintegration' folder, select 7 organization service schemas (organizationserver_schemas*.xsd), Press 'Add' button.

9)Now ReBuild the project, you will still get the error. Because Orchstration 'Multi-part Message Type' pointed the worng schema name ( Red Exclamatory inside the Round Symbol).
Here you can two options to point correct schem - One by One or Replace.
One By One option
i)Double OrchstarionService.odx, select 'Orchstation View' -> Types -> Muti-port Message Types -> IOrganizationService_Associate_InputMessage -> parameters -> Right Click and choose Properties window.
ii)'Type' properties, select the corresponding schemas , in this example
BTSCRM.OrganizationService_schemas_microsoft_com_xrm_2011_Contracts_Services.Associate
will be replaced by
BTSCRM.organizationservice_schemas_microsoft_com_xrm_2011_contracts_services.Associate
iii)Repeat the above (i and ii) steps for all the Red arrow symbol.

Replace option
1)Open the OrchstarionService.odx in the NotePad++ (any text editor)
apply Find and Replace
Find - BTSCRM.OrganizationService_schemas_microsoft_com_xrm_2011_Contracts_Services.
Replace - BTSCRM.organizationservice_schemas_microsoft_com_xrm_2011_contracts_services.
apply Find and Replace
Find - BTSCRM.OrganizationService_schemas_microsoft_com_xrm_2011_Contracts.
Replace - BTSCRM.organizationservice_schemas_microsoft_com_xrm_2011_contracts.
2)Save the file
3)Now ReBuild the project, you will still get the same number error.
4)Select any one 'Orchstation View' -> Types -> Muti-port Message Types -> IOrganizationService_Associate_InputMessage -> parameters -> Right Click and choose Properties window -> Select the same value.
5)Save the project
6)Rebuild once again. you will get 'Rebuild All succeeded' message.

1)Open Visual Studio 2010, Select File menu -> New -> Project -> 'Empty BizTalk Server Project'

2)Right click the project, Select Add menu -> 'Add Generated Items...'

3)Select 'Consume WCF Service', press 'Add' button

4)'BizTalk WCF Service Consumng Wizard' will popup, select 'Metadata Exchange(MEX) endpoint', press 'Next' button
Enter the Metadata Address (URL) (Get the URL from CRM Settings -> Customizations -> Developer Resources -> Organization Service URL)
Press 'Get', 'Next', 'Import' and 'Finish' the button.

5)Now your project contains 2 bindinginfo (*.xml, 1 Orchestration (*.odx), and 9 Schemas (*.xsd).
Build your project, you will see atleast 121 errors. Because these are not valid schemas for this endpoint. They do not have the proper links between each other.

6)Two options to fix each schema - manually (complicated) or include BizTalk schemas from Dynamics CRM SDK (easy).
7)Delete all 9 schemas (*.xsd) from the project.
8)Right click the project, select 'Add' -> 'Existing Item', browse the 'CRM2011_SDK\sdk\schemas\crmbiztalkintegration' folder, select 7 organization service schemas (organizationserver_schemas*.xsd), Press 'Add' button.

9)Now ReBuild the project, you will still get the error. Because Orchstration 'Multi-part Message Type' pointed the worng schema name ( Red Exclamatory inside the Round Symbol).
Here you can two options to point correct schem - One by One or Replace.
One By One option
i)Double OrchstarionService.odx, select 'Orchstation View' -> Types -> Muti-port Message Types -> IOrganizationService_Associate_InputMessage -> parameters -> Right Click and choose Properties window.
ii)'Type' properties, select the corresponding schemas , in this example
BTSCRM.OrganizationService_schemas_microsoft_com_xrm_2011_Contracts_Services.Associate
will be replaced by
BTSCRM.organizationservice_schemas_microsoft_com_xrm_2011_contracts_services.Associate
iii)Repeat the above (i and ii) steps for all the Red arrow symbol.

Replace option
1)Open the OrchstarionService.odx in the NotePad++ (any text editor)
apply Find and Replace
Find - BTSCRM.OrganizationService_schemas_microsoft_com_xrm_2011_Contracts_Services.
Replace - BTSCRM.organizationservice_schemas_microsoft_com_xrm_2011_contracts_services.
apply Find and Replace
Find - BTSCRM.OrganizationService_schemas_microsoft_com_xrm_2011_Contracts.
Replace - BTSCRM.organizationservice_schemas_microsoft_com_xrm_2011_contracts.
2)Save the file
3)Now ReBuild the project, you will still get the same number error.
4)Select any one 'Orchstation View' -> Types -> Muti-port Message Types -> IOrganizationService_Associate_InputMessage -> parameters -> Right Click and choose Properties window -> Select the same value.
5)Save the project
6)Rebuild once again. you will get 'Rebuild All succeeded' message.

No comments:
Post a Comment