Any suggestions/solutions/tips will be much appreciated.
I'm using PowerBuilder 12.5 to call a .Net Web Service and the call works and is received by the WS who send a valid XML response but the response object when loaded by PB is null.
The proxy project is using .Net option to generate PB proxies. Some WS methods work fine and response object is accessible in PB code but when calling some of the other WS methods the PB object assigned to hold the WS method's response is null even though the response XML is correct and contains the expected values (captured using fiddler). On visual examination the proxies generated by PB appear to match the WSDL definition.
I need to be able to check the WS method call's response in the code so the application can take appropriate action if it fails.
The WSDL is: http://cbre.truelogic.com.au/service.asmx?WSDL
Example PB code:
Same WS, 1st method call to GroupInsert()
works but although the 2nd method call to ContactBulkImportWithGroups()
works, PB fails to interpret the method response and load the response object (even though response XML is correct).
// Web Service = lws_cl, already created earlier in script.
// Get Group ID - This WS method call works
wspn_campaignlogic_group ln_ret_group
decimal ldc_groupID[1]
ln_ret_group = lws_cl.GroupInsert(ls_groupName)
if isValid(ln_ret_group.GroupResults) then
if ln_ret_group.GroupResults.ResultCode = 1 then
ldc_groupID[1] = ln_ret_group.GroupID
end if
end if
// Contacts - This WS method returns null
wspn_campaignlogic_contactbulkimporter ln_ret_contact
any la_xml
ln_ret_contact = create wspn_campaignlogic_contactbulkimporter
la_xml = '<contacts><c><f>Jill</f><l>Jackson</l><e>jj@yahoo.com</e><comp>Acme Solutions</comp><sal></sal><p>(02) 8080 1111</p><m></m></c></contacts>'
ln_ret_contact = lws_cl.ContactBulkImportWithGroups(3, ldc_groupID, la_xml, "dd/mm/yyyy")
// Check results
if NOT isValid(ln_ret_contact) then
// Error - execution goes in here because ln_ret_contact is null so result cannot be checked by code
else
// OK
end if
XML Response: captured by Fiddler:
HTTP/1.1 200 OK
Date: Fri, 06 Jul 2012 04:39:42 GMT
Server: Microsoft-IIS/6.0
X-UA-Compatible: IE=8
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 688
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><ContactBulkImportWithGroupsResponse xmlns="http://new.cl.truelogic.com.au/"><ContactBulkImportWithGroupsResult><ImportResults><InvalidContacts><contacts xmlns=""></contacts></InvalidContacts><Updated>1</Updated><Inserted>0</Inserted></ImportResults><ContactImportResults><ResultCode>1</ResultCode><ResultDescription>Success.</ResultDescription></ContactImportResults></ContactBulkImportWithGroupsResult></ContactBulkImportWithGroupsResponse></soap:Body></soap:Envelope>