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.

2 comments:

avpinheiro said...


Hello,

I'm user of version 11.1 Build 8123, not found in drive WCFAttributes.xml
What to do? What was missing install?

Thank you.

Pinheiro

Bruce Armstrong said...

The WCF capability was provided in PowerBuilder.Net in 12.5. You have to be using at least that version and the .Net IDE to do what I described.

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01261.1252/doc/html/den1305657411821.html