But when you are going to use the WCF-BasicHttp adapter, "Add Web Reference" is not going to work, and we need to take advantage of the hidden "Consume WCF Service" wizard, which comes as part of BizTalk 2006 R2. The wizard will generate required schemas, multi-part messages, orchestration port types, and also binding files for both basicHttp and custom binding. I'll put the steps here to consume a basic .asmx webservice in BizTalk 2006 R2 with WCF-BasicHttp adapter.
- Create a blank BizTalk Project
- Right-Click on the project and select Add->Add Generated Items->Consume WCF Service
- Select the option "Metadata file (WSDL and XSD)", Click "Next"
- Open an instance of a browser and navigate to your ".asmx?WSDL" file and save it somewhere in your harddrive (Example: c:\Service.wsdl).
- Click on the "Add" button (next step in the wizard after the one shown above), browse to the .WSDL file you saved in Step 4, Click "Next" (Accept defaults), Click "Import" and then Click "Finish" to complete the wizard.
- Once you click "Finish" the following files will be added to your project (File name will depend on the name of the .WSDL file you selected)
Service.BindingInfo.xml
Service.odx
Service_Custom.BindingInfo.xml
Service.tempuri_org.xsd - Open the Service.odx file, inside the orchestration view create 2 messages as shown below
WSRequest - Multi-part Message Type - ConsumeWebService.ConcatNameSoapIn
WSResponse - Multi-part Message Type - ConsumeWebService.ConcatNameSoapOut - Right-Click on the orchestration "Port Surface", Click "Next", In the port properties page Click "Next", In the "Select a Port Type" page select "Use an existing Port Type" and select "ConsumeWebService.ServiceSoap", In port binding page select "I'll be sending a request and receiving a response." for port direction and "Specify later" for port binding. Click "Next" and then "Finish".
- Make your orchestration logic....
- Deploy your orchestration ..and configuring the ws port
- Open BizTalk Administration Console, Right-Click on the application and select "Import Binding". Browse to the auto generated binding file "Service.BindingInfo.xml" and select it. Bind your Orchestration to the correct ports and host. For the .asmx webservice logical port, select the auto generated "WcfSendPort_Service_ServiceSoap".
- Configuring other port if present ... go!
bye.
Nessun commento:
Posta un commento