Having had a little look about on the old internet, I’ve found that anytime anyone seem to ask the question about calling webserivces, all of the answers come back and say “Hey, use and orchestration and do x, y, and z!”. This is a good way to go about it, but it should not be the only way.
Consider the scenario that all that you want to do is call this web service and do nothing else. Is it not a rather expensive operation to create a Orchestration? The messaging service is pretty quick, so that is all I want to use; I have no need for an Orchestrtion here.
Basically, what I need is:
- A receive location to pick up my inbound message.
- A map to transform the data in the inbound message to the parameters for the web method that I want to call.
- A send port to call the web service using the SOAP adapter.
Hmm, all fine I suppose. But hang on, the second bullet mentions using a map. Now, I have not created a schema for my web service. OK, no big problem, VS.Net lets me do this. I already have a BizTalk project so that I could create my inbound document schema, so all I need to do is add a web reference to my web service and VS.Net will create the XSD for me. Very nice :)
I can now referencethe schema in the web reference in my map. This can lead to some issues, but I’ll cover those in Part II.
OK, so all mapped up. And ready to rock; we get a nice XML representation of the web service parameter (specifically theparameter; singular). Deploy this schema and map to BizTalk and you can go about setting up the messaging. I’ll fluff over it here, as Part II will go in to more detail.
Simply create a receive location and port, using the Xml receive pipeline and the map that we created. Selecting the map should auto-populate the schemas, but you may want to double check that the inbound message schema and the web service schema are selected. Next, create your send port. Just subscribe to the messages from your receive port and use the SOAP transport protocol. In the SOAP setting, specify your web service URI and pick up the Assembly file the we created at the web service proxy.
That is it, job done.
Part II, as I mentioned will go in to more detail should you need it although if you already know a little about BizTalk, this should be plenty to run on.