Hi there!
I have a SOAP request in my postman that works perfectly
However, when I try to convert it to ABL/4GL code it doesn't work. I'm 100% doing something wrong but i can't seem to find it. I already talked to some colleagues of mine but nobody seems to find the problem.
I used the 'bprowsdldoc ' tool to get the following information:
(Only procedure/method found present in the .wsdl file)


Code i'm using:
Errors i get:


The postman doesn't have any header as well. I can paste it to other request or even SOAPUI and it works just fine.
I've already used this code to consume several SOAP services but the other ones were a lot simpler (ex: 1 string input, 1 logical output).
Can anyone find the error?
I have a SOAP request in my postman that works perfectly
However, when I try to convert it to ABL/4GL code it doesn't work. I'm 100% doing something wrong but i can't seem to find it. I already talked to some colleagues of mine but nobody seems to find the problem.
I used the 'bprowsdldoc ' tool to get the following information:
(Only procedure/method found present in the .wsdl file)


Code i'm using:
Code:
DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE hQdocWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE part AS LONGCHAR NO-UNDO.
DEFINE VARIABLE processQdocMessageReturn AS LONGCHAR NO-UNDO.
DEFINE VARIABLE err AS LOGICAL NO-UNDO.
/* ************************ Function Prototypes ********************** */
FUNCTION getBody RETURNS LONGCHAR ( ) FORWARD.
/* ************************ Main ********************** */
CREATE SERVER hWebService.
hWebService:CONNECT("-WSDL 'http://qad01.prifer.local:22079/qxi/services/QdocWebService?WSDL'") NO-ERROR.
RUN QdocWebService SET hQdocWebService ON hWebService.
part = getBody().
RUN processQdocMessage IN hQdocWebService(INPUT part, OUTPUT processQdocMessageReturn) NO-ERROR.
/*ERRORS*/
RUN ErrorInfo (OUTPUT err).
PROCEDURE ErrorInfo: /*1*/
DEFINE OUTPUT PARAMETER errorfound AS LOGICAL INITIAL FALSE.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE hSOAPFault AS HANDLE NO-UNDO.
DEFINE VARIABLE hSOAPFaultDetail AS HANDLE NO-UNDO.
DEFINE VARIABLE HeaderXML AS LONGCHAR VIEW-AS EDITOR SIZE 70 BY 15 LARGE.
IF ERROR-STATUS:NUM-MESSAGES > 0 THEN
DO:
errorfound = TRUE.
DO i = 1 TO ERROR-STATUS:NUM-MESSAGES:
MESSAGE "Error " + STRING(i) + ": " + ERROR-STATUS:GET-MESSAGE(i) VIEW-AS ALERT-BOX.
END.
/*2*/
IF VALID-HANDLE(ERROR-STATUS:ERROR-OBJECT-DETAIL) THEN
DO:
hSOAPFault = ERROR-STATUS:ERROR-OBJECT-DETAIL.
MESSAGE
"Fault Code: " hSOAPFault:SOAP-FAULT-CODE SKIP
"Fault SUBCode: " hSOAPFault:SOAP-FAULT-SUBCODE SKIP
"Fault String: " hSOAPFault:SOAP-FAULT-STRING SKIP
"Fault Actor: " hSOAPFault:SOAP-FAULT-ACTOR SKIP
"Error Type: " hSOAPFault:TYPE SKIP
"Error FAULT-DETAIL: " hSOAPFault:SOAP-FAULT-DETAIL SKIP
"Error FAULT-ROLE: " hSOAPFault:SOAP-FAULT-ROLE SKIP
"Error SOAP-FAULT-MISUNDERSTOOD-HEADER: " hSOAPFault:SOAP-FAULT-MISUNDERSTOOD-HEADER
VIEW-AS ALERT-BOX
.
/*3*/
IF VALID-HANDLE(hSOAPFault:SOAP-FAULT-DETAIL) THEN
DO:
hSOAPFaultDetail = hSOAPFault:SOAP-FAULT-DETAIL.
MESSAGE "Error Type: " hSOAPFaultDetail:TYPE VIEW-AS ALERT-BOX.
HeaderXML = hSOAPFaultDetail:GET-SERIALIZED().
MESSAGE STRING(HeaderXML) VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
/*DISPLAY HeaderXML LABEL "Serialized SOAP fault detail" WITH FRAME a.
PAUSE. */
END.
END.
END.
END PROCEDURE.
FUNCTION getBody RETURNS LONGCHAR ( ):
RETURN
'
<soapenv:Envelope xmlns:add="http://www.w3.org/2005/08/addressing"
xmlns:qcom="urn:schemas-qad-com:xml-services:common"
xmlns:qdoc="urn:schemas-qad-com:xml-services" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<add:ReferenceParameters>
<qcom:suppressResponseDetail>false</qcom:suppressResponseDetail>
</add:ReferenceParameters>
<add:MessageID/>
<add:To>QADQXO</add:To>
<add:Action/>
</soapenv:Header>
<soapenv:Body>
<queryCostCentreRH xmlns="urn:schemas-qad-com:xml-services">
<dsSessionContext xmlns="urn:schemas-qad-com:xml-services:common">
<ttContext>
<propertyQualifier>QAD</propertyQualifier>
<propertyName>version</propertyName>
<propertyValue>ERP3_1</propertyValue>
</ttContext>
<ttContext>
<propertyQualifier>QAD</propertyQualifier>
<propertyName>domain</propertyName>
<propertyValue>PT10</propertyValue>
</ttContext>
<ttContext>
<propertyQualifier>QAD</propertyQualifier>
<propertyName>username</propertyName>
<propertyValue>mfg</propertyValue>
</ttContext>
<ttContext>
<propertyQualifier>QAD</propertyQualifier>
<propertyName>password</propertyName>
<propertyValue></propertyValue>
</ttContext>
</dsSessionContext>
<dsQueryServiceRequest xmlns="urn:schemas-qad-com:xml-services">
<QueryServiceRequest>
<SourceApplication>QADERP</SourceApplication>
<Profile>CostCentreRH</Profile>
<Filter/>
<MaxRows>0</MaxRows>
<IgnoreBOFilter>false</IgnoreBOFilter>
<IgnoreBOInnerJoin>false</IgnoreBOInnerJoin>
</QueryServiceRequest>
</dsQueryServiceRequest>
</queryCostCentreRH>
</soapenv:Body>
</soapenv:Envelope>
'.
END FUNCTION.
Errors i get:


The postman doesn't have any header as well. I can paste it to other request or even SOAPUI and it works just fine.
I've already used this code to consume several SOAP services but the other ones were a lot simpler (ex: 1 string input, 1 logical output).
Can anyone find the error?
Attachments
Last edited: