Test a BizTalk orchestration exposed as a SOAP web service using a WCF Port

Posted: November 21, 2007  |  Categories: BizTalk Uncategorized WCF

 So you have an orchestration that has been exposed as a web service using BizTalk’s Web Publishing Wizard. It created the proxy files, the virtual directory and the web application, and you have a receive port configured with the SOAP adapter. In my case this was part of an upgrade from BizTalk 2004 to BizTalk 2006 R2. We won’t be upgrading the adapters for now, but that doesn’t mean we can’t test this with a BizTalk send port using WCF, does it? Here are the few things I had to do to get it working:

 – We had a few elements in the schema being received by the orchestration that had an enumeration restriction. I had to browse to where the web service proxy files were created, opened DataTypes.cs under the App_Code folder, and remove “AnonymousType=true” on the enumerated fields. If you don’t do this it will show the elements as expecting a “bytes” type instead of an enumeration of strings.

– I created a file receive port and location using the passthrough pipeline and a send port with a passthrough pipeline using the WCF BasicHTTP adapter:

– Paste the URI of the web service into the BasicHTTP “Address URI”. Example:

http://localhost/Order_Proxy/OrderOrchestration_OrderServicePort.asmx

– On the BasicHTTP “SOAP Action header” paste the soap action that you can get from when you browse to the web service, example:  

http://OrderTest/OrderOrchestration_OrderServicePort/OrderServiceOperation

– As a last step, I added the operation to the root node of the test file.

For example, the instance of the schema expected by the SOAP receive port is:

<Order xmlns=”http://OrderTest“>
        <OrderHeader xmlns=””>
          <OrderName>string</OrderName>
          …
        </OrderHeader> 
<Order>

And the SOAP operation page shows that the web service expects something like:

<OrderServiceOperation xmlns=”http://OrderTest“>
      <Order>
        <OrderHeader xmlns=””>
        …
        </OrderHeader> 
     </Order>
</OrderServiceOperation>

So I used a file like this to test it:

<OrderServiceOperation xmlns=”http://OrderTest”  xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema“>
 <Order>
   <OrderHeader xmlns=””>
   …
   </OrderHeader> 
 </Order>
</OrderServiceOperation>

When I drop the test message it is picked up by the passthrough receive port, picked up by the WCF send port and sent to the web service which then kicks off an instance of the orchestration! Cool.

A friend from work also pointed me to this great post by the WCF Adapter master Sonu Arora: Consume WCF Service Wizard generates port binding configuration files for import into BizTalk Server. This way you can’t get the binding wrong!

As a little side note mini hidden blog post:

To debug a custom pipeline component used inside one of the normal isolated host adapters (SOAP, HTTP, WCF), I had to do the following: update the output of the pipeline component project to the BizTalk pipeline components folder. Make sure no process is using the pipeline component (restart IIS and its application pools and restart BizTalk host instances). Add a breakpoint to your code. Rebuild the project. From the debug menu inside visual studio, attach to the w3wp.exe process (you might have to put a file through first so the process starts before you can attach to it).

1 thought on “Test a BizTalk orchestration exposed as a SOAP web service using a WCF Port”

Comments are closed.

BizTalk360
BizTalk Server

Over 500+ customers across
30+ countries depend on BizTalk360

Learn More
Serverless360
Azure

Manage and monitor serverless
components effortlessly

Learn More
Atomicscope
Business Users

Monitor your Business Activity in iPaaS
or Hybrid integration solutions

Learn More

Back to Top