Search code examples
.netwcfbiztalkproxy-classes

Using proxy class in Biztalk


I've got a proxy class (created with WDSL).

Now i want to use this for developing a Biztalk Application.

How can i use the proxy class for sending and receiving messages. I know the process of configuring the ports with the proxy class. The only problem i've got is using the proxy class for my messages?


Solution

  • I assume you want to call a web service from Biztalk? If so you can either

    1. Generate your proxy class and then use this from in .Net class library called from an orchestration
    2. Use Biztalk's Consume Service wizard to generate the schemas, orchestrations amd run-time bindings needed to call the service.

    If you want to go the first route, create a class library which makes the web service call by exposing a method which can be called by your orchestration. If you need to pass Biztalk messages as arguments to the method use the XLANGMessage type found in Microsoft.XLANGs.BaseTypes library. You will first need to generate a .net representation of your message schema (using xsd.exe or svcutil.exe) so that you can deserialise the message using XLANGPart.RetrieveAs(typeOf(xxx)). If you need to pass the web service response out into another message then you can make your .net method return type XmlDocument and as long as the response maps to a message schema, BizTalk will take care of the conversion for you.

    If you want to go the second route, then it's generally easier because BizTalk will generate all the artifacts you need to make a call to the service without any coding needed. This is the best approach if you don't have to do anything fancy like change the web service endpoint address at runtime.

    Hope this helps. TC