Progress Web Service: Passing Parameters

kirsch59

Member
I created a web service using Openedge 10.1C03. How do I pass a temp table for a Doc/Lit Web service? I would like to take advantage of the built-in XML formatting.

In my client code I have the following:

DEFINE TEMP-TABLE b-test LIKE test.

RUN XYZ IN hXYZObj(OUTPUT result, OUTPUT TABLE b-test ) NO-ERROR.

In the web service I have the following:

DEFINE TEMP-TABLE b-test LIKE test .
DEFINE OUTPUT PARAMETER TABLE FOR b-test.

Populate b-test.


The code compiles. When I run it I’m able to connect to the web service; however, I get the following runtime error:

Invalid handle. Not initialized or points to a deleted object (3135)

Cannot access the SOAP-FAULT-CODE attribute because the widget does not exist. (3140).

When I access the web service using soapUI it looks like I’m getting a good response.

Thanks
 

kskib046

New Member
is hXYZObj set to the port name from the wsdl? you need to post more code, and the wsdl.

<code>
DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE hXYZObj AS HANDLE NO-UNDO.

DEFINE VARIABLE result AS INT NO-UNDO.


DEFINE TEMP-TABLE b-test LIKE test.
CREATE SERVER hWebService.
hWebService:CONNECT("-WSDL 'http://../wsdl?'").

IF hWebService:CONNECTED() THEN
DO:
RUN wsdl-port-name-from-wsdl SET hXYZObj ON hWebService.
RUN XYZ IN hXYZObj(OUTPUT result, OUTPUT TABLE b-test ) NO-ERROR.
END.
</code>
 

kirsch59

Member
When I run the web service I get the following runtime error:

Invalid handle. Not initialized or points to a deleted object (3135)
Cannot access the SOAP-FAULT-CODE attribute because the widget does not exist. (3140).

Here's some of the code and the wsdl.

DEFINE VARIABLE Cono AS INTEGER NO-UNDO.
DEFINE VARIABLE Custno AS INTEGER NO-UNDO.
DEFINE VARIABLE result AS CHARACTER NO-UNDO.
DEFINE TEMP-TABLE b-zorderform LIKE zorderform .

Connect to web service(....)

RUN OrderFormXObj SET hOrderFormXObj ON hWebService NO-ERROR.
RUN OrderFormX IN hOrderFormXObj(Input Cono, INPUT Custno, OUTPUT result, INPUT-OUTPUT TABLE b-zorderform ) NO-ERROR.

Here's the wsdl. If needed I can post parts of bprowsdldoc's output.


<?xml version="1.0" encoding="UTF-8" ?>
- <definitions name="OrderFormX" targetNamespace="urn:XXX-org" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:prodata="urn:schemas-progress-com:xml-prodata:0001" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:XXX-org" xmlns:S2="urn:XXX-org:OrderFormX" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:S1="urn:soap-fault:details" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:documentation>Author=XXX, EncodingType=DOC_LITERAL, WSA_Product=10.1C03 - N/A</wsdl:documentation>
- <types>
- <schema elementFormDefault="unqualified" targetNamespace="urn:soap-fault:details" xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="FaultDetail">
- <complexType>
- <sequence>
<element name="errorMessage" type="xsd:string" />
<element name="requestID" type="xsd:string" />
</sequence>
</complexType>
</element>
</schema>
- <schema elementFormDefault="qualified" targetNamespace="urn:XXX-org:OrderFormX" xmlns="http://www.w3.org/2001/XMLSchema">
- <complexType name="OrderFormX_bZorderformRow">
- <sequence>
<element name="cono" nillable="true" type="xsd:int" />
<element name="Name" nillable="true" type="xsd:string" />
<element name="custno" nillable="true" type="xsd:decimal" />
<element name="shipto" nillable="true" type="xsd:string" />
<element name="prod" nillable="true" type="xsd:string" />
<element name="lastpurdt" nillable="true" type="xsd:date" />
<element name="qty12month" nillable="true" type="xsd:decimal" />
<element name="budget" nillable="true" type="xsd:int" />
<element name="maxqty" nillable="true" type="xsd:int" />
<element name="publishfl" nillable="true" type="xsd:boolean" />
<element name="operinit" nillable="true" type="xsd:string" />
<element name="transdt" nillable="true" type="xsd:date" />
<element name="transtm" nillable="true" type="xsd:string" />
<element name="createdt" nillable="true" type="xsd:date" />
<element name="wsdt" nillable="true" type="xsd:date" />
<element name="qtyytd" nillable="true" type="xsd:decimal" />
</sequence>
</complexType>
- <complexType name="OrderFormX_bZorderformParam">
- <sequence>
<element maxOccurs="unbounded" minOccurs="0" name="bZorderformRow" type="S2:OrderFormX_bZorderformRow" />
</sequence>
</complexType>
- <element name="OrderFormX">
- <complexType>
- <sequence>
<element name="Cono" nillable="true" type="xsd:int" />
<element name="Custno" nillable="true" type="xsd:int" />
</sequence>
</complexType>
</element>
- <element name="OrderFormXResponse">
- <complexType>
- <sequence>
<element name="result" nillable="true" type="xsd:string" />
<element name="bZorderform" nillable="true" type="S2:OrderFormX_bZorderformParam" />
</sequence>
</complexType>
</element>
</schema>
</types>
- <message name="OrderFormX_OrderFormXResponse">
<part name="parameters" element="S2:OrderFormXResponse" />
</message>
- <message name="FaultDetailMessage">
<part name="FaultDetail" element="S1:FaultDetail" />
</message>
- <message name="OrderFormX_OrderFormX">
<part name="parameters" element="S2:OrderFormX" />
</message>
- <portType name="OrderFormXObj">
- <operation name="OrderFormX">
<input message="tns:OrderFormX_OrderFormX" />
<output message="tns:OrderFormX_OrderFormXResponse" />
<fault name="OrderFormXFault" message="tns:FaultDetailMessage" />
</operation>
</portType>
- <binding name="OrderFormXObj" type="tns:OrderFormXObj">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <operation name="OrderFormX">
<soap:eek:peration soapAction="" style="document" />
- <input>
<soap:body use="literal" />
</input>
- <output>
<soap:body use="literal" />
</output>
- <fault name="OrderFormXFault">
<soap:fault name="OrderFormXFault" use="literal" />
</fault>
</operation>
</binding>
- <service name="OrderFormXService">
- <port name="OrderFormXObj" binding="tns:OrderFormXObj">
<wsdl:documentation />
<soap:address location="http://XXX-W45/wsa/wsa1" />
</port>
</service>
</definitions>
 

kirsch59

Member
I solved the problem.

After the RUN statement that calls the web service's method I got the following error:

Error 11762 followed by message: cannot match signature for operation
<operation name> calling a WebServices from 4GL.

This error message normally means that one or more of the RUN statement parameters
were not sent properly. The error occurred because I used INPUT-OUTPUT TABLE xyz instead of OUTPUT TABLE xyz.
 
Top