One of the new features introduced with PowerBuilder.Net 12.5 was the ability to create WCF web services. The version of the product also introduced a client for REST web services as well, and a WCF client had been introduce in an earlier version. One frequent question I heard when presenting the new features in conference or online sessions was when PowerBuilder.Net would provide the capability to create REST services, not just consume them.
Perhaps what few people realized (including myself at the time) is that WCF web services isn't just for creating SOAP services. Since .Net 3.0, they have been capable of creating REST services as well. So we've actually have had the capability to create REST web services with PowerBuilder.Net since 12.5 was released. In this blog post we'll look at how we do that.
Recently someone asked me how they could get the output from PBDOM used from a PowerBuilder Classic Win32 application formatted with white space as PBDOM doesn't include it. I gave them a number of options, particularlyMSXML through OLE Automation or using a .Net class like XmlTextWriter. Normally if you were going to try to access a .Net assembly from a PowerBuilder Classic Win32 application, you would do it via a COM Callable Wrapper. However, for something this simple I thought there had to be a more lightweight way to accomplish it. One particular lighterweight way that occurred to be would be to have the application launch a Windows PowerShell script that would then use the .Net class in question. We're going to look at an example of how that's done.