Search code examples
wcfwsdlasmxdatacontractserializerxmlserializer

wcf service calling an ASMX web service which returns IPropertyChangedEventHandler


Ok this is kind of a complicated situation so let me start by laying out what I'm trying to do.

I have a WCF web service that is using DataContractFormat to serialize requests as JSON. One of the clients of the web service generates a reference file using my wsdl and uses the soap endpoint on his end to make calls back and forth. Until now, this has been working great because we have had the ability to provide support for SOAP and also REST/JSON requests.

Our current project required us to include methods from RSA which exposes their webservice with a wsdl. So we are basically doing SOAP calls to them, and generating a reference file on our end and then using the classes and methods generated in our web service.

The problem we are getting is that the client is getting build errors in reference to not being able to serialize IPropertyChangedEventHandler which is included in all of RSA's classes. What I suspect is the problem is that RSA's classes are all defined using the System.Xml.Serialization methods and my web service is written to use the DataContractFormat instead of XMLSerializerFormat so it doesn't know how to serialize the classes. How do I get around this without completely rewriting the reference file using DataContract? Or is there possibly something else I might be overlooking?

Let me know if you need more details.


Solution

  • A coworker was able to figure out how to generate the RSA wsdl without the PropertyChangeEventHandler in the methods. We were able to get the reference file to generate without PropertyChanged by changing the svcmap file under the Service Reference folder

    <EnableDataBinding>false</EnableDataBinding>
    

    After changing this, we updated the service reference and all the PropertyChanged stuff was gone and we no longer got build errors.