Monday, June 20, 2016

Using the XMLSerializer rather than the DataContractSerializer in PowerBuilder.Net WCF web services

By default, WCF services use the DataContractSerializer.   PowerBuilder Classic using ASP.Net web services, which only support the XMLSerializer.  Therefore, if you create a WCF web service using the default settings in PowerBuilder.Net you won't be able to call it from PowerBuilder Classic.

WCF services can be configured to use the XMLSerializer instead.  To do that for PowerBuilder.Net
you'll need to add that option to the WCFAttributes.xml file that PowerBuilder uses to display the options in the IDE.  You should find it in the following location:

<system drive>:\users\<username>\AppData\Local\Sybase directory.

If you add the following into the <Service Attributes> entries:

<ServiceAttribute Name="XmlSerializerFormat"></ServiceAttribute>

Then it will appear in the IDE and you can check it.  Then regenerate the service.  It will now use the XMLSerializer.  At that point you can call it using the PowerBuilder web service client and/or the web service based DataWindow.