user1005448
user1005448

Reputation: 637

Integrating Biztalk and SalesForce

I'm trying to communicate with SalesForce from Biztalk.

To make a POC where I just login I tried the following: Visual Studio: Generate schema from SalesForce partner wsdl

Biztalk: I made a receive location which reads a login.xml message containing username and password. Then imported the SforceService.BindingInfo.xml to make my sendport and setup filters on it.

When I run the example i get the following exception:
WcfSendPort_SforceService_Soap 
https://login.salesforce.com/services/Soap/u/24.0 
   System.InvalidOperationException: An action mapping was defined but BTS.Operation 
was not found in the message context. 
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient 

I want to invoke the following operation on the SalesForce webservice:

<Operation Name="login" Action="" />

Any ideas on how to call login without using orchestrations ?

Upvotes: 1

Views: 1608

Answers (1)

yieldvs
yieldvs

Reputation: 442

From http://msdn.microsoft.com/en-us/library/bb743856.aspx

Specifying action mapping for WCF.Action in an Expression shape is not supported. You need to specify the action mapping in the WCF transport properties dialog box. Then the WCF adapter will look up the SOAP action by using the BTS.Operation context property, which the orchestration sets to the name of the operation on the port where the message is sent.

If outgoing messages are routed with content-based routing (CBR) where the http://schemas.microsoft.com/BizTalk/2003/system-properties#Operation property is not set, WCF send adapters will set the whole action mapping string to the action of the outgoing WCF messages. To work around this, you can do one of the following:

Set the action field on the send port to http://MyService/IMyContract/MyAction1.

Set the BTS.Operation context property in a pipeline. For example, set the value of http://schemas.microsoft.com/BizTalk/2003/system-properties#Operation to Operation1.

Leave the action field blank and use the action from the incoming message instead.

You can also use the BizTalk WCF Service Consuming Wizard to consume the WCF services with single action or action mapping. For more details, see How to Use the BizTalk WCF Service Consuming Wizard to Consume a WCF Service.

Upvotes: 1

Related Questions