none
EDI Orchestration and Web Services Publishing Wizard RRS feed

  • Question

  • I have a BizTalk 2006 R2 Orchestration that takes in a EDI X12 message (A) in its native format, processes it based on some business rules and returns another EDI X12 message (B) in the native format. I use the built-in EdiReceive and EdiSend pipelines to get from the native format to the XML format.

    Using the BizTalk Web Services Publishing Wizard, I'm able to expose a WebMethod that takes in  A and returns B. The published WebMethod expects the input  and retuns the output as XML formatted X12 documents. The Web Services receive location uses the PassThruReceive pipeline.

    For backward compatibility, I want to expose a parallel WebMethod that can take in A and return B as strings in their native formats instead of the XML formats Documents. How can I accomplish this from within BizTalk? I want to avoid writing an external web service to hand-convert from the native format to the XML format and re-use as much of the built-in EDI handling in BizTalk as possible.

    Thanks.

    Thursday, June 5, 2008 5:39 PM

Answers

  • OK. Finally got it to work. Here is what I did.

    1. Create an orchestration that takes in a string and return a string. Add a Call Orchestration shape to call into the original orchestration that accepts the EDI in the XML format.
    2. Build and deploy the orchestration.
    3. Run the WCF Service Publishing Wizard to publish the orchestration as a WCF service.
    4. Open the web.config file where the Orchestration is published and add the following under <system.web>
      1. <trust level="Full" originUrl="" />
    1. If Sharepoint is installed on tha machine, open the Sharepoint Central Admin console and go to: "Configure Virtual Server Settings -> "Default Web Site" -> "Define Managed Paths"  and under "Add a New Path" exclude the virtual directory where the WCF Service is hosted.
    2. Go to the BizTalk Server Admin Console, and configure the new WCF Receive Location as follows:
      1. Change Receive Pipeline to EdiReceive. And Send Pipeline to EdiSend.
      2. Under "Transport" -> "Type" click "Configure"
      3. Go to the "Messages" tab and under the "Inbound BizTalk message body" select the "Path" option.
      4. For the "Body path expression enter:  /*[local-name()='string']
      5. For the "Node encoding" select: String
      6. Click OK and then on the Receive Location Properties click OK again.
      7. Enable the WCF Receive Location. This is needed to be able to build the proxy using svcutil.
    1. Run the svcutil.exe to generate the proxy and config file for the WCF Service and build the client. Client should pass the EDI message as a string (in the native EDI format) to the Orchestration.
    2. Go back to the Orchestration and modify the incoming request and the outgoing response from a String to the required EDI formats.
    3. Build and deploy the orchestration. Start everything. Send the EDI message in native format from the client. You should receive the response back in native EDI format.

    Friday, June 20, 2008 5:45 PM

All replies

  •  

    Create a port and receive location that uses the WCF two way Adapter along with the EDI Pipeline. Create another orchestration that contains a two way logical port that binds to the MessageBox. Set it's Request message type to EDI Schema "A" and it's Response message type to EDI Schema B.  Inside the orchestration, use a call orchestration shape to pass into your currently defined orchestration. Bind your WCF Two Way adapter physical port to the logical port of the newly created orchestration. BizTalk uses a generic Message for receiving messages, thus you could just embed the EDI message into the Soap message.

     

    HTH

    Sunday, June 8, 2008 1:43 AM
  • Dwight,

    Thanks for your response. Based on your suggestion, I did the following:

    Created a new Orchestration with a 2 way logical port that binds directly to the MessageBox. The Port takes in a string and returns a string. To make things easier (and for testing your suggestion),  I do not call my original orchestration, but simple return the input message back through the output port (Orchestration flow is as follows: Receive->Construct->Assign->Send).

    I then published the orchestration as a WCF service using the WCF Publishing Wizard and generated a client to test out the service. The call to the orchestration now takes the form void InvokeOrchestration(ref string ediMsg). Next, I modified the WCF recieve location to use the EDIReceive and EDISend pipelines. I then went back to the orchestration and modified the Message types for the Ports and the Orchestration shapes from string to the required EDI XML schema format.

    So in summary, I have an orchestration that takes in an EDI XML document and returns that back. The Receive location has EDIReceive and EDISend pipelines to handle this EDI XML document and the service end points invoke the orchestration passing them strings which are in the Native EDI format. On running messages through this setup I get the followng error:

    There was a failure executing the receive pipeline: "Microsoft.BizTalk.Edi.DefaultPipelines.EdiReceive, Microsoft.BizTalk.Edi.EdiPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "EDI disassembler" Receive Port: "WcfReceivePort_TestService/Test_Orchestrations_TestType_TestService" URI: "/TestService/Test_Orchestrations_TestType_TestService.svc" Reason: No Disassemble stage components can recognize the data.

    Any idea as to what I might have missed?

    Thanks.
    Wednesday, June 11, 2008 9:48 PM
  • OK. Finally got it to work. Here is what I did.

    1. Create an orchestration that takes in a string and return a string. Add a Call Orchestration shape to call into the original orchestration that accepts the EDI in the XML format.
    2. Build and deploy the orchestration.
    3. Run the WCF Service Publishing Wizard to publish the orchestration as a WCF service.
    4. Open the web.config file where the Orchestration is published and add the following under <system.web>
      1. <trust level="Full" originUrl="" />
    1. If Sharepoint is installed on tha machine, open the Sharepoint Central Admin console and go to: "Configure Virtual Server Settings -> "Default Web Site" -> "Define Managed Paths"  and under "Add a New Path" exclude the virtual directory where the WCF Service is hosted.
    2. Go to the BizTalk Server Admin Console, and configure the new WCF Receive Location as follows:
      1. Change Receive Pipeline to EdiReceive. And Send Pipeline to EdiSend.
      2. Under "Transport" -> "Type" click "Configure"
      3. Go to the "Messages" tab and under the "Inbound BizTalk message body" select the "Path" option.
      4. For the "Body path expression enter:  /*[local-name()='string']
      5. For the "Node encoding" select: String
      6. Click OK and then on the Receive Location Properties click OK again.
      7. Enable the WCF Receive Location. This is needed to be able to build the proxy using svcutil.
    1. Run the svcutil.exe to generate the proxy and config file for the WCF Service and build the client. Client should pass the EDI message as a string (in the native EDI format) to the Orchestration.
    2. Go back to the Orchestration and modify the incoming request and the outgoing response from a String to the required EDI formats.
    3. Build and deploy the orchestration. Start everything. Send the EDI message in native format from the client. You should receive the response back in native EDI format.

    Friday, June 20, 2008 5:45 PM
  • Hi ,

     

         I have the same problem could please explain me in detail what is the solution.  I am visualizing two orchestrations so now there will be 2 receive and 2 send ports.  When you publish a WCF you will see the external ports whcih you are having for your normal file transfer.  So how do you configure the internal two edi ports?.  Please let me know if am clear about my question.

     

    Thanks

    Friday, August 15, 2008 6:18 PM
  • Use a Request-Response port instead of a separate Receive and Send port. Make sure your port is marked as public so that the WCF Service publishing wizard can see it. The WCF publishing wizard will expose the Request-Response port as a Static Solicit Response port in BizTalk Admin.

     

    Hope this helps.

    Friday, August 15, 2008 8:56 PM
  • Hi,

     

         Thanks for your response, I was able to do this as you have mentioned.  Let me explain the proper scenario i have to solve.  I have an existing orchestration in 2004 with a request - response port which has custom edi receive and custom edi send pipelines.  So When i publish this orchestration as WCF in 2006 it did show up the port.  What I did with the port is that i added the serivce as a web reference in a new orchestration and and tried to execute it, but the port is of no use because the request and reponse elements type is System.XMLdocument in my case and the request and response methods don't show up when i put this in a new orchestration. 

     

        And I am not sure whether i got your explanation properly.  Considering the situtation i explained to you, could you please rephrase what you did to make it work at your end.

     

    Thanks.

    Monday, August 18, 2008 2:22 PM
  • My initial requirements had changed by the time I came up with a solution for the problem. I ended up publishing just one orchestration that took a string and returned a string via a WCF service. I did not have to deal with two orchestration and referencing the same port in both. Sorry, I don't have a clue about that.

    Monday, August 18, 2008 5:25 PM
  • Hi,

    I am also in the same situation. I designed the orchestration to receive the string and get the response back in string. I exposed it as wcf service and then I changed the orchestration to comsume the edi message. Now when I am supplying the edi message string I am getting following error:

    There was a failure executing the response(send) pipeline: "Microsoft.BizTalk.Edi.DefaultPipelines.EdiSend, Microsoft.BizTalk.Edi.EdiPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "EDI assembler" Receive Port: "WcfReceivePort_ProcessFlatFile/ProcessFlatFile_Orc_Process271String_PortEDI271" URI: "/ProcessFlatFile/ProcessFlatFile_Orc_Process271String_PortEDI271.svc" Reason: A message was encountered with root element name of Envelope. It could not be classified as an X12 or Edifact message. The root namespace was http://schemas.xmlsoap.org/soap/envelope/

    Its taking the input string and converts it to edi format correctly but while returning the edi message back to string, its throwing the above message. I have no clue what I am doing wrong. I am simply returning back the same message.

    Any help would be greatly appreciated.

    Thanks,
    Nilesh
    Sunday, February 1, 2009 2:55 AM
  • Hi all,

     

    I am also working on the same scenario and i found it useful.I have implemented the above steps as is.But have a problem when calling from client.when i invoke  the receive port,   2instances of orchestration are raised as one is consuming a blank message and the other one as edi xml message.Not sure what i am doing wrong .The first instance which is invoking with blank message is suspending the isolated adapter and the second instance is completing successful ,but could not return  the response as the isolated adapter is suspended.

     

    Please techies help me out ,i am running out of time.

     

    Thanks....

    Surya

    • Proposed as answer by SPN Biztalk Tuesday, August 31, 2010 9:43 PM
    Friday, May 28, 2010 7:00 PM