Not sure how to exactly ask this, but I have a subprocedure that calls a web service. Within the data structure, there are 3 arrays. The program will compile fine until it hits the arrays and then will error on me. Any suggestions on what I can do to fix this? I'm including all 3 programs used through this and I apologize for the length, but I wasn't sure what would be needed.
PROGRAM 1:
PROGRAM 2:
PROGRAM 3:
PROGRAM 1:
Code:
H/copy SOURCE/QRPGLESRC,RPGLEHSpec H NOMAIN //******************************************************************* // Prototype definition for GetCustInf * //******************************************************************* /copy /WebServices/Customer/CustomerWS37.rpgleinc /copy MAIN/QRPGLESRC,GetCustInf P GetCustInf B EXPORT D GetCustInf PI LIKEDS(CustomerOutput) // calling program should pass D $CustAcctNum 10A D $CompanyCode 6A D $SalesOrg 4A D $DistributionChannel... D 2A D $Division 2A // $ReturnDS is local, and therefore initialized on every call D $ReturnDS DS LIKEDS(CustomerOutput) D $WsStub DS LIKEDS(This_t) D $Input DS LIKEDS(CustomerInput_t) D $Result DS LIKEDS(CustomerOutput_t) /FREE // Get a Web service stub. You can pass // blanks and endpoint in the WSDL file will be used. CLEAR $WsStub; CLEAR $Input; // Set the stock name to be quoted by the web service. To test just the // web service, XXX is being used. This should return a stock quote. $Input.custAcctNum.value = $CustAcctNum; $Input.companyCode.value = $CompanyCode; $Input.salesOrg.value = $SalesOrg; $Input.distributionChannel.value = $DistributionChannel; $Input.division.value = $Division; IF (stub_create_CustomerWS($WsStub) = *ON); // Invoke the StockQuote Web service operation. IF ( stub_op_Get_SAP_Customer($WsStub:$Input:$Result) = *ON); $ReturnDS.customerExists = $Result.customerExists.value; $ReturnDS.companyCode = $Result.companyCode.value; $ReturnDS.custName1 = $Result.custName1.value; $ReturnDS.custName2 = $Result.custName2.value; $ReturnDS.POBox = $Result.POBox.value; $ReturnDS.street1 = $Result.street1.value; $ReturnDS.street2 = $Result.street2.value; $ReturnDS.city = $Result.city.value; $ReturnDS.state = $Result.state.value; $ReturnDS.zip = $Result.zip.value; $ReturnDS.country = $Result.country.value; $ReturnDS.county = $Result.county.value; $ReturnDS.zipCodeDeliveryPoint = $Result.zipCodeDeliveryPoint.value; $ReturnDS.membershipStatus = $Result.membershipStatus.value; $ReturnDS.horizonMailingCode = $Result.horizonMailingCode.value; $ReturnDS.phoneNumbers = $Result.phoneNumbers.value; $ReturnDS.email = $Result.email.value; $ReturnDS.salesArea = $Result.salesArea.value; ENDIF; // Return the customer information RETURN $ReturnDS; // Destroy Web service stubs. stub_destroy_CustomerWS($WsStub); ENDIF; *INLR=*ON; /END-FREE P GetCustInf E
Code:
////////////////////////////////////////////////////////////////////// // This is a copy book of the data structure needed for this prototype // and the programs that use this prototype ////////////////////////////////////////////////////////////////////// /copy MAIN/QRPGLESRC,CustInfo2 ///////////////////////////////////////////////////////////////////// // Prototype definition ///////////////////////////////////////////////////////////////////// D GetCustInf PR LIKEDS(CustomerOutput) // calling program should pass these // parameters D $CustAcctNum 10A D $CompanyCode 6A D $SalesOrg 4A D $DistributionChannel... D 2A MJH D $Division 2A
Code:
D************************************************************** D* C U S T I N F O 2 D* D CustomerOutput DS D custAcctNum 10 D companyCode 6 D customerExists... D 1 D custName1 35 D custName2 35 D POBox 10 D street1 60 D street2 40 D city 35 D state 3 D zip 10 D country 3 D county 15 D distributionChannel... D 2 D zipCodeDeliveryPoint... D 15 D membershipStatus... D 2 D horizonMailingCode... D 2 D phoneNumbers 30 Dim(30) D email 241 Dim(20) D salesArea 7 Dim(15) D*
Comment