Search code examples
visual-studiowcfwse

WSE 2.0 web service client in Visual Studio 2013


I'm trying to consume an old web service provided by a third party.
This WS uses DIME for attachments.

AFAIK in WCF is not possible for application/dime response content type to work, so I added a Framework 2.0 class library to my solution in order to use WSE obsolete web service client and proxy classes.

Can I build a client to consume a WS with DIME attachments? If so, how can I build an obsolete WSE 2.0 client in a recent Visual Studio environment?


Solution

  • I found a working solution to this problem, using WSE 3.0.
    Using WSE it can be changed the default service proxy, as described here. Basically:

    • Add reference to Microsoft.Web.Services2.dll
    • Add service reference to the service with DIME attachments
    • Manually change the extended class in the auto-generated Reference.cs file to Microsoft.Web.Services2.WebServicesClientProtocol

    This will give you access to the ResponseSoapContext member of the service client.
    The ResponseSoapContext contains the Attachments member: it's a collection of the DIME attachments of the last executed web method.