SOAP Webservice Progress Error

Jochen0911

New Member
Hello,

i want to send a Dataset to an webservice with

{y/gateway/incl/yg_ano01.pds &ippNoReferenceOnlySwitch = yes}
{call dsGetAngebot fillDataset}.
lvh_ds = dataset dsGetAngebot:handle.
lvh_ds:write-xml ('file':U,'C:/temp/dsGetAngebot.xml':U,true).
lvh_ds:write-xml ('longchar':U, /* Zieltyp */
lvcl_sendit_in, /* Ziel */
false, /* formatiert (sonst ohne Zeilenvorschub) */
'UTF-8':U, /* Codepage */
'':U, /* Schema-Location */
false, /* write-xmlschema */
false, /* min-xmlschema */
false, /* write-before-image */
false). /* omit-initial-values */

/* Fuer SOAP fertig machen */
assign
lvcl_sendit_in = replace (lvcl_sendit_in,'dsGetAngebot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">':U,'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">':U)
lvcl_sendit_in = replace (lvcl_sendit_in,'/dsGetAngebot':U,'/soap:Envelope':U)
lvcl_sendit_in = replace (lvcl_sendit_in,'Body':U,'soap:Body':U)
lvcl_sendit_in = replace (lvcl_sendit_in,'</>':U,' ':U).

COPY-LOB lvcl_sendit_in TO FILE 'C:/temp/dsGetAngebot_ls.xml':U.
lvc_ws_connect = 'http://xxx:8901/SpecificationAutomation?singleWsdl'.
create server lvh_webserver.

lvh_webserver:connect('-WSDL ':U + lvc_ws_connect).
run IHttpConnectorService set lvh_sendit_ws on lvh_webserver no-error.
run value (lvc_datasetname) in lvh_sendit_ws (input lvcl_sendit_in,output lvcl_sendit_out) no-error.


And hier comes the error. See attachement. When i use the saved file from copy-lob and send it with SOAPUI in the environment, i´ll get a response.

The XML content:
<?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> <EditSpecification><projectName>order</projectName><transitionName>SendOrder</transitionName><specificationName>Order 18494</specificationName><specificationId>18494</specificationId><operationName> </operationName><values> </values></EditSpecification></soap:Body></soap:Envelope>

Response in SOAPUI.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<EditSpecificationResponse>
<EditSpecificationResult xmlns:a="http://schemas.datacontract.org/2004/07/DriveWorks.Applications.Autopilot.Connectors.Http" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:SpecificationName i:nil="true"/>
<a:Status>FailedInvalidTransitionNameOrTransitionDisabledByConditions</a:Status>
</EditSpecificationResult>
</EditSpecificationResponse>
</s:Body>
</s:Envelope>


It´s very strange. I cannot find the difference between SOAPUI and Progress, what´s going wrong. Any hints? I would expect to get the response into lvcl_sendit_out.

Jochen
 

Attachments

  • 2020-11-16 14_10_07-CheckPoint - Viscosity [wird ausgeführt] - Oracle VM VirtualBox.png
    2020-11-16 14_10_07-CheckPoint - Viscosity [wird ausgeführt] - Oracle VM VirtualBox.png
    296.1 KB · Views: 10

Jochen0911

New Member
I find out, that something went wrong with the xml. Now when i start my script, it generate

<?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> <EditSpecification><projectName>order</projectName><transitionName>SendOrder</transitionName><specificationName>Order 18494</specificationName><specificationId>18494</specificationId><operationName> </operationName><values> </values></EditSpecification></soap:Body></soap:Envelope>

Now i get the error 11767 by calling procedure. 'Error sending Web Service Request: An error occurred processing SOAP Request Headers'

Any idea?
 

Cecil

19+ years progress programming and still learning.
Is it possible to include the WSDL +xsd? Or, butter a public facing WDSL URL?

I'm a Developer Experience manager for New Zealand Inland Revenue and I support developers all over the world on how to consume SOAP Web Services.

Have you tried using Progress SOAPspy to see the interaction between client and server?
 

Jochen0911

New Member
Hi,
thank you for answering! I have not the experience about webservices with progress. I don´t know this tool, but i got help from another progress developer. In the error message it shows the datatype 'dictionary 2 values'. It is a special array / object of c# or java.

I know that he was using the bprowsdldoc.bat to analyse the wsdl. It was a litle bit difficult but he got the solution.

Instead of
run value (lvc_datasetname) in lvh_sendit_ws (input lvcl_sendit_in,output lvcl_sendit_out) no-error.

i must
DEFINE TEMP-TABLE KeyValueOfstringstring NO-UNDO
NAMESPACE-URI "http://schemas.microsoft.com/2003/10/Serialization/Arrays"
FIELD Key AS CHARACTER
FIELD Value1 AS CHARACTER
XML-NODE-NAME "Value" .

DEFINE DATASET values NAMESPACE-URI "http://schemas.microsoft.com/2003/10/Serialization/Arrays"
FOR KeyValueOfstringstring.

DEFINE VARIABLE EditSpecificationResult AS LONGCHAR NO-UNDO.

/* Procedure invocation of EditSpecification operation. */
RUN EditSpecification IN hIHttpConnectorService(INPUT projectName, INPUT transitionName, INPUT specificationName, INPUT specificationId, INPUT operationName, INPUT DATASET values, OUTPUT EditSpecificationResult).

For me as webservice beginner i never could find it out. Thank you for all who want´s to help!
 

Cecil

19+ years progress programming and still learning.
I find out, that something went wrong with the xml. Now when i start my script, it generate

<?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> <EditSpecification><projectName>order</projectName><transitionName>SendOrder</transitionName><specificationName>Order 18494</specificationName><specificationId>18494</specificationId><operationName> </operationName><values> </values></EditSpecification></soap:Body></soap:Envelope>

Now i get the error 11767 by calling procedure. 'Error sending Web Service Request: An error occurred processing SOAP Request Headers'

Any idea?


Your SOAP envelope does not contain any SOAP header: <soapHeader></soapHeader>

What the specifications required?


<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> <EditSpecification> <projectName>order</projectName> <transitionName>SendOrder</transitionName> <specificationName>Order 18494</specificationName> <specificationId>18494</specificationId> <operationName></operationName> <values></values> </EditSpecification> </soap:Body> </soap:Envelope>
 

Jochen0911

New Member
Hello, sample for SoapUI.


<?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>
<EditSpecification>
<projectName>order</projectName>
<transitionName>MyOrder</transitionName>
<specificationName>Order 34921</specificationName>
<specificationId>34921</specificationId><operationName>
</operationName>
<values>
<KeyValueOfstringstring xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<Key>OrderNumberErp</Key>
<Value>2143643</Value>
</KeyValueOfstringstring>

</values>
</EditSpecification></soap:Body></soap:Envelope>

That works and the 'values' construct received by target successful.

The interesting part is that array construct on c#. After running progress utility, i have to implemnt progress code like


def temp-table tt_KeyValueOfstringstring no-undo
namespace-uri 'Error
field schluessel as char /* xml-node-name 'Key':U */
field wert as char xml-node-name 'Value':U.

def dataset ds_values namespace-uri 'Error

for tt_KeyValueOfstringstring.

YMAIN: do on error undo, leave:

lvc_datasetname = 'EditSpecification':U.

/* Fuer andere Projekte in die VAR nehmen */
lvc_ws_connect = {&YG_URL_DW_BestellungSenden}.

/* So, jetzt gehts los. Webserver verbinden */
create server lvh_webserver.

lvh_webserver:connect(' -WSDL ':U + lvc_ws_connect) no-error.

if not lvh_webserver:connected()
then do:
/* Fehler beim Verbinden zum Webserver */
message 'error'.

leave YMAIN.

end.

/* an Webservice anbinden */
run IHttpConnectorService set lvh_sendit_ws on lvh_webserver no-error.

if error-status:error or not valid-handle(lvh_sendit_ws)
then do:
message 'error'.

leave YMAIN.

end.



/* Das Dataset entsprechend fuellen, nach Anforderung */
create tt_KeyValueOfstringstring.
assign
tt_KeyValueOfstringstring.schluessel = 'OrderNumberErp':U
tt_KeyValueOfstringstring.wert = string(v_belegkopf.belegnummer).

/* Fuehre nun Webfunktion SendOrder aus, d. h. hole Angebot */
run value (lvc_datasetname) in lvh_sendit_ws (input 'Order':U, /* projectName */
input 'MyOrder':U, /* transitionName */
input 'Order ':U + string(v_belegpos.y_id_driveworks), /* specificationName */
input string(v_belegpos.y_id_driveworks), /* specificationId */
input '':U, /* operationName */
input dataset ds_values /* by-reference */, /* Werte-Array */
output lvcl_sendit_out) no-error.

I get the response 'succeeded'. The request arrived the target. But the target webservice got the dataset values as epmpty. No content. It doesn´t matter wether i send it with 'by-rfererence' or not.

What can i do, that dataset values can receive by target.

Here the construct of Progress analyses.


DEFINE VARIABLE projectName AS CHARACTER NO-UNDO.

DEFINE VARIABLE transitionName AS CHARACTER NO-UNDO.

DEFINE VARIABLE specificationName AS CHARACTER NO-UNDO.

DEFINE VARIABLE specificationId AS CHARACTER NO-UNDO.

DEFINE VARIABLE operationName AS CHARACTER NO-UNDO.



DEFINE TEMP-TABLE KeyValueOfstringstring NO-UNDO

NAMESPACE-URI "http://schemas.microsoft.com/2003/10/Serialization/Arrays"

FIELD Key AS CHARACTER

FIELD Value1 AS CHARACTER

XML-NODE-NAME "Value" .



DEFINE DATASET values NAMESPACE-URI "http://schemas.microsoft.com/2003/10/Serialization/Arrays"

FOR KeyValueOfstringstring.

DEFINE VARIABLE EditSpecificationResult AS LONGCHAR NO-UNDO.





FUNCTION EditSpecification RETURNS LONGCHAR

(INPUT projectName AS CHARACTER,

INPUT transitionName AS CHARACTER,

INPUT specificationName AS CHARACTER,

INPUT specificationId AS CHARACTER,

INPUT operationName AS CHARACTER,

INPUT DATASET values)

IN hIHttpConnectorService.





/* Function invocation of EditSpecification operation. */

EditSpecificationResult = EditSpecification(projectName, transitionName, specificationName, specificationId, operationName, DATASET values).
 
Top