Monday, June 27, 2005

Web Services and Correlation

For the past few weeks I've been trying to use web services and correlation. The problem I was facing was that I had two web services. The first web service would accept data from BizTalk and the second web service would send data back to BizTalk. The web services were two seperate entities and the response back to BizTalk was initiated by a manual process. Basically someone is going to be looking at the data that was sent to them and either accepting the data or rejecting the data. There was a LoadRef number in both processes that required correlation. Lastly, the web services used the type of XmlDocument.

The first issue I ran into was to correlate on the outgoing send shape. This required that I change parameter in the web service to a strongly typed parameter. The xsd is then created in the web reference of the project. Using the xsd I am set the promoted property on the reference xsd. In the orchestration I was then able to set the incoming message to a message of the web service request. Since the web service requires that the incoming variable be of a type of XmlDocument, in the web service mehtod I immediatly change the strongly typed item to XmlDocument using XmlSerializer.

The second issue I had was correlating on the return data. I could not change the format from XmlDocument. I discovered that two items needed to be set in order for correlation to work. First, the namespace must be the same namespace. Second, the qualified name must be set to the assembly properties that can be found in the GAC or properties in the BizTalk explorer. The Microsoft.XLANGS.BaseType.Any would not work. When set to type of Microsoft.XLANGs... the promoted property could not be found. On the receive SOAP adapter set the pipeline to XMLReceive.

No comments: