locked
BizTalk consume WCF and parameter RRS feed

  • Question

  • Hi All,

    I have WCF and consume successfully.  I know what is the parameter and its type.

    Now, i like to know how to assign values to this parameter from BizTalk.

    Thanks.

    Tuesday, June 10, 2014 3:16 AM

Answers

  • Raj,

    Glad I understood your problem. You can follow my suggestion in my earlier reply, if you want to assign the value. If you want to know how this been done in Orch1/Orch2, unless I got hold of your code/Orchestration, it will be tough. Can you send your code my email, I can help.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by raj_BizTalk Tuesday, June 10, 2014 9:12 AM
    Tuesday, June 10, 2014 8:58 AM

All replies

  • Tuesday, June 10, 2014 4:11 AM
  • Yea you are correct.

    One parameter is "JobFolder" where i need to send working folder Ex. "v:\BizTalkFolder\Working"

    If i pass this value from my trigger xml is fine, if it is empty, it should automatically take.

    Could you tell me how to achieve this?

    Tuesday, June 10, 2014 6:58 AM
    • In your Microsoft Visual Studio BizTalk project, in Solution Explorer, right-click your project, click Add, and then click Add Generated Items.
    • In the Add Generated Items - <Project name> dialog box, in the Templates section, select Consume WCF Service, and then click Add. BizTalk WCF Service Consuming Wizard. In the Wizard, in  Metadata Exchange (MEX) endpoint section provide the URL of the WCF service.
    • This wizard process would create the required web message-schemas, orchestrations with public ports and binding file (BindingInfo.xml) for you.
    • Use the schema created from this wizard as the destination message(schema in your map ) and use the input schema - which would provide you the parameter. Create a map with this schemas and call it while invoking the WCF service (or in the send port’s outbound map). This way you can assign value/parameters which are expected by the WCF service which you trigger.

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Tuesday, June 10, 2014 7:12 AM
  • Fine..

    My orchestration was developed & deployed already.  

    i dt know where to assign value for "JobFolder" (this is the one of the parameter for my WCF).  How to set value for this parameter?

    Tuesday, June 10, 2014 8:00 AM
  • Map already created and invoking is fine.  Even if i set value here its taken up.  But i dt want to send value here.  

    It should automatically take the "working folder" value and assign.

    how to achieve this?

    Tuesday, June 10, 2014 8:06 AM
  • The parameters for a WCF Method is set though the XML you send to the WCF Send Adapter. In your case you would probably set it in a Map.

    Now I didn't understand what "It should automatically take." meant, but if you mean either take it from a field in the source document otherwise just supply it with a hardcoded value, you could do this with functoids or even better custom XSLT.

    Also: How can a general walk through of how to consume a WCF Service be proposed as the answer to this thread, when the person asking clearly states in his first entry that he has already consumed the service?

    Morten la Cour


    • Edited by la Cour Tuesday, June 10, 2014 8:09 AM
    Tuesday, June 10, 2014 8:09 AM
  • If I understood your question correctly, you have a parameter named “JobFolder”, you want to assign value “v:\BizTalkFolder\Working” which is one of your working folders. But you don’t want to send this value in the file which triggers the process. You want this folder path to be assigned to JobFolder field automatically. If this is the requirement, then you have few options:

    • Set the default value of the field “JobFolder” to “v:\BizTalkFolder\Working”. So this value will be assigned, if no value is passed in the input file.
    • Store it in a datastore or in a configuration file like BTSNTSVC.exe.config or in SSO database. Access the value in your map using scripting functiod which would call an external C# assembly to access this values from the datastore/config file/SSO. Some the following reference might help in this context:

    BizTalk configuration in the SSO database

    BizTalk SSO Configuration Data Storage Tool

    Calling External Assemblies From Maps in BizTalk





    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Tuesday, June 10, 2014 8:24 AM
  • EXACTLY, you understand my requirement :)

    I have Orchestration named "Orch1" which is some how taking this working parameter value (i dt know where they are assigning). There is no value in Triggering XML.  There is no method in MAPS.  where else its taking..

    Now come to my current problematic "Orch2"  this one is also exact copy of "Orch1" but value is not assigning to JobFolder.

    Sure,

    There is no value in Triggering XML and MAPS (by method)

    Where else i should check. Yes i have SSO. If we are taking from SSO, how it assigned to this parameter.

    Many Thanks.

    Tuesday, June 10, 2014 8:51 AM
  • Raj,

    Glad I understood your problem. You can follow my suggestion in my earlier reply, if you want to assign the value. If you want to know how this been done in Orch1/Orch2, unless I got hold of your code/Orchestration, it will be tough. Can you send your code my email, I can help.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by raj_BizTalk Tuesday, June 10, 2014 9:12 AM
    Tuesday, June 10, 2014 8:58 AM
  • if you dt mind can i have your email id? Thanks.

    Tuesday, June 10, 2014 9:06 AM
  • Note: Questioner has sent the source file. And they are using SSO to store the value for the working folder and use SSO utility/helper class to access the value and construct the WCF request message with the read value from SSO.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.


    Tuesday, June 10, 2014 9:11 AM