ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Problems with a Subprocedure, that includes arrays, calling a web service

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with a Subprocedure, that includes arrays, calling a web service

    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:

    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
    PROGRAM 2:

    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
    PROGRAM 3:

    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*
    .

  • #2
    Re: Problems with a Subprocedure, that includes arrays, calling a web service

    Hey bud, put the snippet of the spool with the error.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: Problems with a Subprocedure, that includes arrays, calling a web service

      Code:
      ID		MESSAGE					                  SEVERITY	        LINE	        LOCATION
      RNS9308 Compilation stopped. Severity 30 errors found in program               50		   0		MAIN/QRPGLESRC(ZZP032)
      RNF7030 The name or indicator ZIP is not defined.			       30		 111		MAIN/QRPGLESRC(ZZP032)
      RNF7030 The name or indicator ZIPCODE... is not defined.		       30		 114		MAIN/QRPGLESRC(ZZP032)
      RNF7503 Expression contains an operand that is not defined.	               30                102	        MAIN/QRPGLESRC(ZZP032)
      RNF7503 Expression contains an operand that is not defined.	               30                103        	MAIN/QRPGLESRC(ZZP032)
      RNF7503 Expression contains an operand that is not defined.	               30	         104	        MAIN/QRPGLESRC(ZZP032)
      RNF7503 Expression contains an operand that is not defined.	               30		 105		MAIN/QRPGLESRC(ZZP032)
      RNF7503 Expression contains an operand that is not defined.	               30		 106		MAIN/QRPGLESRC(ZZP032)
      .

      Comment


      • #4
        Re: Problems with a Subprocedure, that includes arrays, calling a web service

        I don't see "CustomerOutput_t" defined as a Data structor.
        Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

        Comment


        • #5
          Re: Problems with a Subprocedure, that includes arrays, calling a web service

          Code:
                * ********************************************************************
                * This file was auto-generated by the WSDL2RPG Web Service
                * Generator.
                *
                * This file contains Client Stub procedure prototypes for a
                * remote web service.
                *
                * ********************************************************************
          
             /copy CustomerWS_xsdtypes37.rpgleinc
          
                * ********************************************************************
                * ********************************************************************
                * C O N S T A N T S
                * ********************************************************************
                * ********************************************************************
          
          
                * ********************************************************************
                * ********************************************************************
                * D A T A   T Y P E S
                * ********************************************************************
                * ********************************************************************
          
                * **************************************************************
                * RPG type : CustomerOutput_t
                * **************************************************************
               D CustomerOutput_t...
               D                 DS                  qualified template
               D isNil_CustomerOutput_t...
               D                                1n
               D custAcctNum                         likeds(xsd_string)
               D companyCode                         likeds(xsd_string)
               D customerExists                      likeds(xsd_string)
               D custName1                           likeds(xsd_string)
               D custName2                           likeds(xsd_string)
               D POBox                               likeds(xsd_string)
               D street1                             likeds(xsd_string)
               D street2                             likeds(xsd_string)
               D city                                likeds(xsd_string)
               D state                               likeds(xsd_string)
               D zip                                 likeds(xsd_string)
               D country                             likeds(xsd_string)
               D county                              likeds(xsd_string)
               D zipCodeDeliveryPoint...
               D                                     likeds(xsd_string)
               D membershipStatus...
               D                                     likeds(xsd_string)
               D horizonMailingCode...
               D                                     likeds(xsd_string)
               D phoneNumbers                        likeds(customerOutput_phoneNumbers...
               D                                     _Array_t)
               D email                               likeds(customerOutput_email_Array_...
               D                                     t)
               D salesArea                           likeds(customerOutput_salesArea_Ar...
               D                                     ray_t)
          
                * **************************************************************
                * RPG type : CustomerInput_t
                * **************************************************************
               D CustomerInput_t...
               D                 DS                  qualified template
               D isNil_CustomerInput_t...
               D                                1n
               D custAcctNum                         likeds(xsd_string)
               D companyCode                         likeds(xsd_string)
               D salesOrg                            likeds(xsd_string)
               D distributionChannel...
               D                                     likeds(xsd_string)
               D division                            likeds(xsd_string)
          
                * **************************************************************
                * RPG type : customerOutput_phoneNumbers_Array_t
                * **************************************************************
               D customerOutput_phoneNumbers_Array_t...
               D                 DS                  qualified template
               D isNil_customerOutput_phoneNumbers_Array_t...
               D                                1n
               D array                               likeds(customerOutput_phoneNumbers...
               D                                     _t)
               D                                     dim(30)
               D size                          10i 0
               D type                          10i 0
          
                * **************************************************************
                * RPG type : customerOutput_salesArea_Array_t
                * **************************************************************
               D customerOutput_salesArea_Array_t...
               D                 DS                  qualified template
               D isNil_customerOutput_salesArea_Array_t...
               D                                1n
               D array                               likeds(customerOutput_salesArea_t)
               D                                     dim(30)
               D size                          10i 0
               D type                          10i 0
          
                * **************************************************************
                * RPG type : customerOutput_salesArea_t
                * **************************************************************
               D customerOutput_salesArea_t...
               D                 DS                  qualified template
               D isNil_customerOutput_salesArea_t...
               D                                1n
               D salesOrg                            likeds(xsd_string)
               D distributionChannel...
               D                                     likeds(xsd_string)
               D division                            likeds(xsd_string)
               D salesDistrict                       likeds(xsd_string)
               D salesOffice                         likeds(xsd_string)
               D salesGroup                          likeds(xsd_string)
          
                * **************************************************************
                * RPG type : customerOutput_email_t
                * **************************************************************
               D customerOutput_email_t...
               D                 DS                  qualified template
               D isNil_customerOutput_email_t...
               D                                1n
               D address                             likeds(xsd_string)
               D primary                             likeds(xsd_string)
          
                * **************************************************************
                * RPG type : customerOutput_phoneNumbers_t
                * **************************************************************
               D customerOutput_phoneNumbers_t...
               D                 DS                  qualified template
               D isNil_customerOutput_phoneNumbers_t...
               D                                1n
               D number                              likeds(xsd_string)
               D primary                             likeds(xsd_string)
          
                * **************************************************************
                * RPG type : customerOutput_email_Array_t
                * **************************************************************
               D customerOutput_email_Array_t...
               D                 DS                  qualified template
               D isNil_customerOutput_email_Array_t...
               D                                1n
               D array                               likeds(customerOutput_email_t)
               D                                     dim(30)
               D size                          10i 0
               D type                          10i 0
          
          
                * ********************************************************************
                * ********************************************************************
                * P R O T O T Y P E S
                * ********************************************************************
                * ********************************************************************
          
                * ********************************************************************
                * WEB SERVICE CLIENT STUB PROTOTYPES
                * ********************************************************************
          
                * **************************************************************
                * RPG Call : stub_create_CustomerWS
                *  parm in : This_t this
                *  return  : *ON = connected
                *          : *OFF = connect failed
                * **************************************************************
               D stub_create_CustomerWS...
               D                 PR             1N   extproc('stub_create_CustomerWS@')
               D this                                likeds(This_t)
          
                * **************************************************************
                * RPG Call : stub_destroy_CustomerWS
                *  parm in : This_t this
                *  return  : *ON = destroyed
                *          : *OFF = destroy failed
                * **************************************************************
               D stub_destroy_CustomerWS...
               D                 PR             1N   extproc('stub_destroy_CustomerWS@')
               D this                                likeds(This_t)
          
                * ********************************************************************
                * WEB SERVICE OPERATION PROTOTYPES
                * ********************************************************************
          
          
                * **************************************************************
                * RPG call : stub_op_Get_SAP_Customer
                *  parm in : This_t this
                *  parm in : CustomerInput Value0
                *  parm out: CustomerOutput out
                *  return  : *ON = success
                *          : *OFF = failure
                * **************************************************************
               D stub_op_Get_SAP_Customer...
               D                 PR             1N   extproc('Get_SAP_Customer@')
               D this                                likeds(This_t)
               D Value0                              likeds(CustomerInput_t)
               D out                                 likeds(CustomerOutput_t)
          .

          Comment


          • #6
            Re: Problems with a Subprocedure, that includes arrays, calling a web service

            Does Customer_Output need to be defined as qualified?

            Comment

            Working...
            X