none
Soap Header for composite operation - Biztalk 2010 RRS feed

  • Question

  • Hello,

    Not long ago, I have create a small BizTalk application to invoke an oracle store procedure to insert a record into the database. I was advised to leave only the store procedure name on the action part of the soap header when configuring the WCF. And that worked well as the application did insert a record successfully in the database. I follow the same clue and repeat the same method for retrieving the records and that worked too.

    However, I would like to combine both operations (insert and retrieve) in 1 requests and let the system intelligently decide which store procedure to call. I have modified my xml request to have another field call ReqId and depending on whether the content is 1 or 2, I will send the request to insert or to retrieve to the oracle from my orchestration. Unfortunately, when combining the operation like that, I do not really know what to put down in the SOAP Action header to make it selectively send request to the proper store procedure. Below is the BizTalk auto generated SOAP action. How do I tweak it to work for both scenarios (Insert or Retrieve) depending on the reqID being 1 or 2?

    <BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <Operation Name="RECORD_ACTIVITY" Action="http://Microsoft.LobServices.OracleDB/2007/03/AXIUM/Procedure/RECORD_ACTIVITY" />
      <Operation Name="RETRIEVE_ACTIVITIES" Action="http://Microsoft.LobServices.OracleDB/2007/03/AXIUM/Procedure/RETRIEVE_ACTIVITIES" />
    </BtsActionMapping>


    • Edited by FrankTo Tuesday, January 15, 2013 1:17 PM
    Monday, January 14, 2013 9:25 PM

All replies

  • Hi,

    What you want to do is dynamically set the BTS.Operation property via your orchestration or pipeline component.

    Specifying SOAP Actions for WCF Send Adapters

    Thanks,

    William

    Tuesday, January 15, 2013 10:49 AM
  • Thanks William for your hint. I just would like to clarify it a bit. By dynamically set BTS.Operation, did you mean somewhere in the orchestration set

    OutboundMessage(WCF.Action)="http://Microsoft.LobServices.OracleDB/2007/03/AXIUM/Procedure/RECORD_ACTIVITY"  and in other place set

    OutboundMessage(WCF.Action)="http://Microsoft.LobServices.OracleDB/2007/03/AXIUM/Procedure/RETRIEVE_ACTIVITY"

    All I need to do is have the expression shapes before the requests to redirect the traffic? In that case, should I leave the SOAP header in WCF properties blank or it does not matter?

    Also, is that the only way to deal with the issue? Is there a way to put something on the SOAP header and do not have to use the OutboundMessage settings? I think my SOAP header has what was specified in the SOAP header of the document you pointed out but for some reason, mine does not work. Must be something minor that I have overlooked due to my lack of exposure to BizTalk.

    Tuesday, January 15, 2013 1:30 PM
  • Just set the WCF.Action context property in the orchestration and then leave the Action field blank in the WCF adapter transport properties dialog box. If you also specify an action in the send port, the WCF.Action context property you set in the orchestration will be overridden.



    Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitt-sharma.blogspot.com/)

    Thursday, January 17, 2013 5:12 AM
    Moderator
  • Hi,

    In a way yes, but you would have to do the following when using the BTS.Operation property;

    You would define an BtsActionMapping like below

    BtsActionMapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Operation Name="Operation_1" Action="http://Microsoft.LobServices.OracleDB/2007/03/AXIUM/Procedure/RECORD_ACTIVITY" /> <Operation Name="Operation_2" Action="http://Microsoft.LobServices.OracleDB/2007/03/AXIUM/Procedure/RETRIEVE_ACTIVITY" /> </BtsActionMapping>

    Then you would based on which operation you would like to call you would set the BTS.Operation to Operation1 or Operation2.

    The other choice is as indicated by Rohit,  you could directly set the WCF.Action to URI for the specific operation which you would like to call.

    The different between WCF.Action and BTS.Operation is that BTS.Operation allows the abstraction of the required SOAP Action without requiring the orchestration to have intrinsic knowledge of the type of the physical transport.

    Thanks,

    William


    Thursday, January 17, 2013 6:23 AM
  • Williams,

    I understood Rohit's explanation but I prefer using BTS.Operation. However, I do not know how to make that happen. I did have the SOAP Action as you mentioned above in the wcf properties and did name the corresponding operations at the corresponding Oracle 2 way ports Operation_1 and Operation_2 to match, but my test.xml did not make it to the orchestration (I used System.Diagnostics.EventLog.WriteEntry to write a simple message for debugging purpose). This is the error I found in the eventlog. (I have an InFolder to get my xml message where the ReqID inside the xml could be 1 or 2, if it is 1 then Operation_1 is supposed to kick in and debatch the records then save them in Oracle, I ignore the results received for now). After, the xml message is consumed in the InFolder, no record was saved and instead, I found the error below in my event log.

    FILE
    E:\Test\CompositeOperationTest\InFolder\*.xml
    OutsideReceiveLocation

    The published message
    could not be routed because no subscribers were found. This error occurs if the
    subscribing orchestration or send port has not been enlisted, or if some of the
    message properties necessary for subscription evaluation have not been promoted.
    Please use the Biztalk Administration console to troubleshoot this failure.

    Friday, January 18, 2013 3:20 PM
  • Hi,

    To achieve the scenario described by Frank we can use the composite operation. By using the composite operation, this will help us to call multiple operation at once at the destination.
    This link msdn.microsoft.com/en-us/library/dd788136(v=bts.10).aspx helps in understanding the basics of Composite operation by calling different operations at one go in the destination.

    This link www.biztalkgurus.com/biztalk_server/biztalk_blogs/b/biztalksyn/archive/2009/03/30/walkthrough-composite-operations-with-the-new-wcf-based-sql-adapter.aspx

    is more relevant to your approach of calling 2 different stored procedure like insertstoredprocedure and selectstoredprocedure. This scenario described in this link looks similar to that you are trying to achieve.

    Thursday, January 24, 2013 2:02 AM
  • Hi Parashuram,

    Your links do help especially the 2nd. They help me verify and make sure my steps are correct. One difference between the link and mine is (I think) the sample in the link did an insert/update then select sequentially. In other word, the link performed both operations while mine only performs 1 operation depending on the ReqId received. I wonder, if I can still use action in SOAP Header or do I need to do a map of some sort to direct the operations probably. That's where I am at a lost...

    Secondly, the author use BizTalk 2009 and I wonder CompositeOperation keyword is still valid for 2010.

    Thursday, January 24, 2013 1:21 PM