locked
Passing output from a port as input to a c# code in Biztalk 2010 RRS feed

  • Question

  • Hi all

    I have an orchestration which has a request-response receive port and send port.From the send port i will get an xml(which contains a list of fields).


    • Edited by Suja Balan Wednesday, October 26, 2016 3:24 PM
    Friday, September 23, 2016 9:55 AM

All replies

  • Hi Suja,

    In you c# method , expect a XmlDocumet type argument and from you expression shape just pass the response message , which you are getting from Sproc.

    Here You can also use Xlang instead of XmlDocumet. 

    Below are some link which can help you :

    http://www.codeproject.com/Articles/27288/Call-a-custom-NET-component-from-BizTalk

    Regards

    Abhay Giri

    mark this as Answered if this reply provided your answer

    Friday, September 23, 2016 10:24 AM
  • What type of parameter does the SendPushNotifications method accept?

    There is a great article from Paolo that shows various ways to pass orchestration messages to helper methods-

    https://blogs.msdn.microsoft.com/paolos/2009/09/10/4-different-ways-to-process-an-xlangmessage-within-an-helper-component-invoked-by-an-orchestration-part-1/


    Thanks Arindam

    Friday, September 23, 2016 10:26 AM
    Moderator
  • Hi Suja,

    First check what parameters the method is expecting, does it expect individual elements of xml as input or whole xml string as input?

    say xyz is method you want to invoke, so what is it's signature xyz(string element1, string element2 ,.....) or xyz(string xml)

    Secondly, to invoke the method you need to create object of the class containing the method (for that you need to add the reference of assembly) and for collecting  the response you need to create variable depending upon the return type of method. 

    Say, xyz is the method to be invoked and its return type is string then do following

    Declare Var_Response as string variable

    Var_Obj = new Namespace.ClassTobecalled()

    Var_Response = Var_Obj.xyz(input parameter)

    --------

    Maheshkumar S Tiwari|User Page|Blog|Sending file as attachment using BizTalk Orchestration

    Friday, September 23, 2016 10:32 AM
  • Hi Suja,

    Is this xml being passed to some other service(push notification service)?? why are you calling a service via a don net code?? you can use the BizTalk Send ports to pass the message to the service...yuiasng BizTalk port over inline send port provides instrumentation advantages...

    Also in case you decide to go with the calling of the service with C# approach, make sure that you pass the correct parameter to the service, meaning first get the information on the paramters of the service and then you can create those objects using proxy classes easily.

    But I suggest use the BizTalk send port.

    Regards


    Mandar Dharmadhikari

    Friday, September 23, 2016 11:28 AM
    Moderator
  • Hold on team, we need some important details to give the best advice.

    Suja Balan, can you post the signature of the method you need to call?  Specifically, what Type is the parameter that takes the xml.  This makes the biggest difference in how you do it.

    Can you describe what this C# does? There may be a way to do that already in BizTalk.

    Friday, September 23, 2016 11:35 AM
    Moderator