Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Using DIME to send attachments to a Web service

I want to use DIME to send attachments to a Web Service. When I add a Web Reference to the WSDL in a .NET client application, the proxy generated does not provide DIME support. How do I enable this support for WSE?

Normally when you add a Web Reference, the generated proxy derives from System.Web.Services.Protocols.SoapHttpClientProtocol. This base class uses a strongly typed instance of the XML serializer to automagically serialize the parameters posted to a Web service endpoint, and deserialize the return value. The base class that supports emerging standards is from a different library, however. It is part of the WSE library: Microsoft.Web.Services.WebServicesClientProtocol (for WSE 1.0) or Microsoft.Web.Services2.WebServicesClientProtocol (for WSE 2.0).

If you add support for WSE to the client prior to adding a Web Reference, two proxies should be generated, one for non-WSE support (the former), another for WSE support. When you installed WSE (presumably 2.0) you should have installed development (IDE) support so that the plug-in to Visual Studio is installed. If you right-click the project in the Solution Explorer, you should see a menu item at the bottom of the context menu, for WSE settings. Select that, and from the first tab you can enable WSE support for the client application. This will add a reference to the WSE assembly that is installed to the Global Assembly Cache, and it will modify your app.config (or create one) to support the WSE configuration section.

Dig Deeper on Topics Archive