Jul 4, 2010

Consuming Web Service with SOAP header by Biztalk 2006

There are a lot of information about this subject on-line,
but I think that it not so correct.

The steps to create a working solution are :

1. You need a WSDL which includes the declaration of the SOAP headers elements that are needed. It won't work if you define an external schema for it. as it is described in many posts.

2. Create a property schema with the target namespace set to http://schemas.microsoft.com/BizTalk/2003/SOAPHeader, the root node name set to exactly the same as the root node name in SOAP header, and the Property Schema Base property set to MessageContextPropertyBase.

3. Set the context of the request message with a XML of the SOAP Header structure.

XMLDOM = new System.Xml.XmlDocument();
XMLDOM.LoadXml(@"123456Silver"); WSReqMsg(SubmitPurchaseOrder.SOAPHeaderPropertySchema.Priority) = XMLDOM.InnerXml;


If you have an WSDL which not defines SOAP Header but it's needed (like WS-Security or WS-addressing) by WS provider you will need to ask the provider to provide updated WSDL or to update it by yourself. Otherwise it won't work in Biztalk 2006 with SOAP adapter.

If you need to update the WSDL I suggest you to do it by exposing Orchestration as Web Service with the Web Service Wizard tool. You can use the defined property schema and you need to define custom schema which will include the needed SOAP Header.
During the wizard you can choose to expose SOAP Headers.

In Biztalk 2006 R2 and later you can use WCF adapter which solve this issue without the need to update WSDL.

Exposing And Consuming Web Services by SAP

You can consume Web Services by SAP framework for web services and also expose RFC as Web Services without any need of external integration tools like SAP netweaver xi.
One of the most impotent things in SOA solution is the ability to monitor the traffic.
There is a great logging tool out of the box which is provided as part of SAP WAS, SOA Management. it's provide information on the calls time and also it's can capture the requests/responses.

The process of consuming or exposing Web Services is not difficult at all, it evolves work with:
- Wizards : Creating the BAPI objects or exposing existing RFC.
- BAPI : Developing the Web Service proxy for consuming, working with objects and types created by the Wizard.
- SOA Management : Deploying the WSDLs/Exposing RFC , configure the logs.


There is some interoperability issues that you need to keep in mind when going for this solutions:

- We didn't find a solution for consuming an existing WSDL as an interface and implement it.

- xsi:nil attribute is not supported, opened OSS, waiting for SAP response.

- You can't generate custom Namespace.

There are more...

The throughput was much more faster than thru XI. (10 times faster).

In conclusion it is more than possible to expose SAP structures and types as standard Web Services and to consume them.
So if synchronous solution is suite for you you don't need to use adapters or XI.

If you need help on this fill free to contact me for forward details.