PB Classic 12.5.2 Web Services DW, how to return a validation error?
Windows Clients: Windows 7 and 8.0
Powerbuilder Classic 12.5.2 Build 5583
Visual Studio 2013, .NET 4.5, C# WCF web services
Can anyone point me to how to code the web services side of things so I can return a validation error from web services (we are using C# .NET 4.5 WCF for Web Services) to a web services datawindow .Update statement. Ideally I'd like .Update to return -1 and not update the datawindow row statuses if there was a validation error.
The reason I am asking is this:
I have a web services datawindow, it retrieves and updates wonderfully. Now I add some logic in the web services to validate the incoming data. If some data is invalid I want the update to fail and the user to see a message.
To handle the above scenario I am calling a SOAP Fault in the web services and returning a nice message. Catching it in WSError and handling it in a nice manner. All seemed fine EXCEPT, after I get the error message I fix the problem in the data by setting another column from, for example, A to null, because that would then make the first column valid. What then happens is if I look at the primary buffer of the datawindow just before the .Update is called is has null in it as expected, but if I look at the XML incoming to the web services it has A in it!!!! This only seems to happen if a SOAP Fault was thrown first. Otherwise null is sent as expected.
I have checked, all columns are marked as nullable in both the datawindow definition and the web services, and the datatypes in the web services are nullable datatypes. Saving with null works just fine as longs as, I think, an exception wasn't thrown already. It only seems to be a problem with nulls.
So it has left me with a number of pressing questions:
1. Am I just handling validation wrong, and should not be throwing a SOAP fault? If so, what is the normal way of handling these things?
2. Is this a bug in PB (installing 12.6 + latest EBF as I type)
3. Am I going even more crazy than I already was before I started this project?
If anyone has any input / ideas it would be welcome. Thank you.