Reputation: 760
I have problem with geting full response from SOAP WS in Progress OpenEdge. "bprowsdldoc" app generated full call and output structure to DATASET, but in DATASET I have only last element of "document" type. Response looks like this:
<GetDocumentsResponse>
<documentsCount>3</documentsCount>
<document>
<content filename="file1.xml" mime="application/xml"> [base64] </content>
</document>
<document>
<content filename="file2.xml" mime="application/xml"> [base64] </content>
</document>
<document>
<content filename="file3.xml" mime="application/xml"> [base64] </content>
</document>
<documentsInfo>All done.</documentsInfo>
</GetDocumentsResponse>
My goal is to get all "document" elements in output DATASET (count of 3 is only a sample) or get full response XML as LONGCHAR. Any help will be appreciated.
EDIT:
Web service is internal in my company and calling it requiers VPN connection, so I can't give You link. But bprowsdldoc generated a code like this for method "GetDocuments":
DEFINE VARIABLE dateStart AS DATE NO-UNDO.
DEFINE VARIABLE dateEnd AS DATE NO-UNDO.
DEFINE VARIABLE documentsCount AS INT64 NO-UNDO.
DEFINE TEMP-TABLE document NO-UNDO
FIELD docId AS CHARACTER.
DEFINE TEMP-TABLE content NO-UNDO
FIELD filename AS CHARACTER
XML-NODE-TYPE "ATTRIBUTE"
FIELD mime AS CHARACTER
XML-NODE-TYPE "ATTRIBUTE"
FIELD content_Text AS RAW
XML-NODE-TYPE "TEXT"
FIELD document_id AS RECID
XML-NODE-TYPE "HIDDEN" .
DEFINE DATASET documentDset
XML-NODE-TYPE "HIDDEN"
FOR document, content
PARENT-ID-RELATION RELATION1 FOR document, content
PARENT-ID-FIELD document_id.
DEFINE VARIABLE documentsInfo AS CHARACTER NO-UNDO.
RUN GetDocuments IN hDocumentHandlingPort(INPUT dateStart, INPUT dateEnd, OUTPUT documentsCount, OUTPUT DATASET documentDset, OUTPUT documentsInfo).
After calling this method I get proper response for variables documentsCount and documentsInfo but in TEMP-TABLE content I got only one row with document element from response (there should be 3 for dates from 2017-03-16 to 2017-03-16 as ine example response on the top of my post).
Response in WSDL looks like this:
<xs:element name="GetDocumentsResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="documentsCount" type="xs:long"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="document" type="ns1:documentType"/>
<xs:element minOccurs="0" name="documentsInfo" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
I think that problem may be related to maxOccurs attribute of element document - it's unbounded and maybe there should be some numeric value...
Can You help mi handle this problem?
Upvotes: 0
Views: 1119
Reputation: 760
Due to defect PSC00323593, described in knowledge base, this situation is a bug. But there is always light in the dark, so there is also workaround for it:
Use the WSDL Analyzer (bprowsdldoc) with -show100style parameter to generate documentation. Using the older syntax works as desired, returning all expected records.
In the scenario encountered, the alternate documentation uses type LONGCHAR for parameters. It was then possible to combine code from original documentation (specifically the TEMP-TABLE and DATASET definitions) with the code from the -show100style documentation. The READ-XML method was used to read the LONGCHAR output parameter into the DATASET.
or
Add APPEND option to the DATASET parameter.
You can find full article here.
Upvotes: 0