Yossi Dahan [BizTalk]


Thursday, September 14, 2006

Enums in web services and BizTalk

With a standard .net project when you add a web reference, a proxy class is generated for you and is added to your project.

This way you can easily create instances of any classes declared by the web service and use them as you need (mainly in order to pass them to the actual web method, but not necessarily)

With BizTalk, however, things are slightly different. A proxy class is still being generated behind the scenes, but it is not added to your project. Instead the equivalent schemas are being generated and added and of course web port types and multi part message types are being created for you.

Generally this is all right, but there are a few cases where the fact you don't actually have access to the proxy is a bit of a pain.

An example of such a case is when the web service takes in a few parameters (represented by a few parts in the request message) and one of them is an enum.

In a standard .net project you could simply use the enum to select the value you want to pass, in BizTalk, when assigning values to the part, the enum is not available for you as the proxy class is not available.

You have to resort to putting in the value you need which kind of defeats the purpose of using an enum in the first place.

This could be solved if the types added in the proxy will be come available as variables in the orchestrations, ideally non initialized (as in many cases you don't actually need them)


Post a Comment

<< Home