[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Webservice - Inputparameter



A idea for you to look at...

The WSDL file you included doesn't look like WSDL to me but rather I think of it as an example. And as such, the parameters shown should be used as shown. The _P0XMLINPUT element should be called that in the SOAP message in HTTPAPI (no _ and small letter p in the HTTPAPI side). Capitalization for many services will not matter; for some it will. It depends on the parsers involved and I don't know enough about the IWS to know which parser IBM used. 

XML is forgiving about missing parameters so skipping the _P0RESULTAT is acceptable but we do not know if it is required or optional for your web service. If the above doesn't help, try adding the _P0RESULTAT element.

Does the debug show that the web service runs fine? What is the result that you get back from the web service?
  

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jan Grove Vejlstrup
Sent: Friday, September 06, 2013 9:32 AM
To: HTTPAPI and FTPAPI Projects
Subject: Webservice - Inputparameter

Hello,

I'm using the integrated Web Service of the IBM i to create a 
webservice: the WSDL-file is:

<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://kis14tra.wsbeans.iseries/xsd";>
    <soapenv:Header/>
    <soapenv:Body>
       <xsd:kis14tra>
          <xsd:args0>
             <xsd:_P0RESULTAT>?</xsd:_P0RESULTAT>
             <xsd:_P0XMLINPUT>?</xsd:_P0XMLINPUT>
          </xsd:args0>
       </xsd:kis14tra>
    </soapenv:Body>
</soapenv:Envelope>

The part of the program, that gets started by the webservice and that 
should receive the input-parameter is:

      d kis14tra        PR                  ExtPgm('KIS14TRA')
      d  Resultat                  32765a
      d  xmlInput                  32765a   const

      d kis14tra        PI
      d  p0Resultat                32765a
      d  p0xmlInput                32765a     const

      d HEX15           c                   x'15'

      d msg             s             52a   varying
      d string          s          32760a   varying
      d stringWithOutHex15...
      d                 s          32760a   varying
      d stringWithOutHex15Utf8...
      d                 s          32760a   varying
      d pointer         s               *
      d buffLen         s             10u 0
      d buffer          s          32760a   based(pointer)
      d stringEnc       s          32760a
      d enclen          s             10i 0

      D from            ds                  likeds(QtqCode_T)
      D                                     inz(*LIKEDS)
      D to              ds                  likeds(QtqCode_T)
      D                                     inz(*LIKEDS)
      D table           ds                  likeds(iconv_t)

      D p_input         s               *
      D inleft          s             10U 0
      D p_output        s               *
      D outleft         s             10U 0
      D len             s             10U 0

      D errMsg          s             50A
      D input_data2     s          32760A   varying
      D output_data2    s          32760A   varying
      d cmd             s           1024a   varying
      d fehlerText      s           1000a   varying
      d firma           s              2a
      d extKdNrAlfa     s              6a
      d LTCode          s              1a
      d verkaufsStelle...
      d                 s              2a
      d werk            s              3a
      d AnzDetPos       s             10i 0
      d transportKosten...
      d                 s             15p 2

       /free

              *inlr = *on;

              cmd = 'call bshop/gisaliba';
              qcmdexc(cmd: %len(cmd));
              msg = 'Hier kommt die lib-list2';
              dsply msg;
              cmd = 'dsplibl output(*print)';
              qcmdexc(cmd: %len(cmd));

             msg = 'xmlInput01*' + %trim(p0XmlInput) + '*';
             dsply msg;


My test-program looks like:

H DFTACTGRP(*NO) actgrp(*new) bnddir('HTTPAPI')
      H copyright('(c) 2013 WEMAG Consulting AG, CH-3122 Kehrsatz')

      W*E CRTBNDRPG  kis143i  srcfile(*libl/qrpglesrc)
      W*E+       DBGVIEW(*SOURCE)
      W*E+       REPLACE(*YES)
      E*W

       *
       /copy HTTPAPI_H
       *
       *
      d kis143i         PR                  ExtPgm('KIS143I')
      d kis143i         PI

      d VARYINGDATAOFFSET...
      d                 c                     const(2)
      d msg             s             52a   varying
      d SOAP            s           1024a     varying
      d rc              s             10i 0
      d len             s             10i 0

       /free


         SOAP=  '<soapenv:Envelope xmlns:soapenv='
              + '"http://schemas.xmlsoap.org/soap/envelope/";'
              + ' xmlns:xsd="http://kis14tra.wsbeans.iseries/xsd";>'
              + '   <soapenv:Header/>'
              + '   <soapenv:Body>'
              + '      <xsd:kis14tra>'
              + '         <xsd:args0>'
              + '            <xsd:p0XMLINPUT>' + 'inputXXMMLL4 '
              + ' </xsd:p0XMLINPUT>'
              + '         </xsd:args0>'
              + '      </xsd:kis14tra>'
              + '   </soapenv:Body>'
              + '</soapenv:Envelope>';

            len = %len(SOAP);
            msg = 'len *' + %char(len) + '*';
            dsply msg;

        //  http_setCCSIDs(1208 : 0);       **************
            http_debug(*ON: '/jgvtmp/kis14Debug.txt');

            rc = http_post('http://chwemag1:10010/web/services/KIS14TRA'
                             : %addr(SOAP) + VARYINGDATAOFFSET
                             : %len(SOAP)
                             : '/jgvtmp/kis14encUtf40.xml'
                             : HTTP_TIMEOUT
                             : HTTP_USERAGENT
                             : 'text/xml; charset=UTF-8'
                             : 'urn.kis14tra');

            if (rc <> 1);
              http_crash();
            endif;


            *inlr = *on;

       /end-free

My problem is, that the program, that is startet by the webservice, 
don't receive the input-parameter. The dsply results in "xmlInput01**" . 
The input parameter should be inputXXMMLL4, but is empty. I cannot find 
the reason for that. What am I doing wrong?

I'm on 6.1 and using HTTPAPI 1.24.

Best regards

Jan




-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------