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

Help with a very particular case of HTTPAPI



   ---------- Forwarded message ----------
   From: Jeffreehy Talavera <[1]jeffreehy@xxxxxxxxx>
   Date: Mar 26, 2007 12:21 AM
   Subject: Help whit a very particular case of HTTPAPI
   To: [2]ftpapi@xxxxxxxxxxxxx

   Hi All,

   I'm trying to consume a Web Service but I'm getting an error message,
   for me this is a diferent caind of Web Service in my opinion, because
   the message is a XML string message encapsulated in XML , I tryed to
   consume it in two diferent forms:



   1. using SOAP protocol I have attached the WSDL, Program and error
   message on the httpapi_debug(SOAP).txt file. I have changed the name
   just to information purposes:



         a. citas.wsdl

         b. pasport7       the program

         c. httpapi_debug(SOAP).txt   the return [3]error.in the error
   message you can notice that is pointing to the <ciudadano> tag but
   this an valid tag, I can't find what the error is.



   2. using POST here is a particular scenario, I have to modify the
   peValue field size , that is in the http_url_encoder_addvar_s
   routine from 256 to 32767, in order to move the contents of the string
   XML data into it, into HTTPAPI_H and ENCODERR4 members.



        a. pasport6 program

        b. httpapi_debug(POST).txt



   if you take a look in the error file you can see the
   stringXML=%3C%3Fxml+version%3D1.0+encoding%3Dutf-8%3F%3E%... etc  that
   is not translating correctly because it supposed to be: stringXML<?xml
   version=1.0 encoding=utf-8?>'<cita ciudad=3 tipoCita...etc

   I think the error from the server is caused because the translation to
   the encoded variable stringXML



   I really want to know the reasons in the two situations but I'll say
   that my priority is for the POST message, because the nature of this
   specific Web Service, I don't know why they did it in this way. can
   some body give me a hand?

   thank you in advance.



   P.S. I also attached the XML message that is supposed to be received:
   XML Bancos.doc



   Jeffreehy Talavera Díaz
   Consultor Especialista
   S390, iSeries & Open Systems

   --
   Consultor Especialista
   S390, iSeries & Open Systems

References

   1. mailto:jeffreehy@xxxxxxxxx
   2. mailto:ftpapi@xxxxxxxxxxxxx
   3. http://error.in/
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:s="http://www.w3.org/2001/XMLSchema"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:tns="http://tempuri.org/ws_MotorSINGEC/Citas"; xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; targetNamespace="http://tempuri.org/ws_MotorSINGEC/Citas"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/ws_MotorSINGEC/Citas";>
      <s:element name="RecibeXML">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="stringXML" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="RecibeXMLResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="RecibeXMLResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="RecibeXMLSoapIn">
    <wsdl:part name="parameters" element="tns:RecibeXML" />
  </wsdl:message>
  <wsdl:message name="RecibeXMLSoapOut">
    <wsdl:part name="parameters" element="tns:RecibeXMLResponse" />
  </wsdl:message>
  <wsdl:portType name="CitasSoap">
    <wsdl:operation name="RecibeXML">
      <wsdl:input message="tns:RecibeXMLSoapIn" />
      <wsdl:output message="tns:RecibeXMLSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="CitasSoap" type="tns:CitasSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="document" />
    <wsdl:operation name="RecibeXML">
      <soap:operation soapAction="http://tempuri.org/ws_MotorSINGEC/Citas/RecibeXML"; style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Citas">
    <wsdl:port name="CitasSoap" binding="tns:CitasSoap">
      <soap:address location="http://172.30.7.2/singecmotorcitas/citas.asmx"; />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
     H DFTACTGRP(*NO) BNDDIR('LIBHTTP/HTTPAPI')

 

      /copy libhttp/qrpglesrc,httpapi_h



     D SOAP            s          32767A   varying
     D rc              s             10I 0

     D msg             s             50A
     D wait            s              1A
 
     D size            s             10I 0

     D CRLF            C                   CONST(x'0d25')

      /free


       SOAP =
         '<?xml version="1.0" encoding="utf-8"?>'+ CRLF
        +'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; '
        +CRLF +'xmlns:xsd="http://www.w3.org/2001/XMLSchema";'+ CRLF
        +'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>'+ CRLF
        +' <soap:Body>'+ CRLF
        +'  <RecibeXML xmlns="http://tempuri.org/ws_MotorSINGEC/Citas";>'+ CRLF
        +'   <stringXML>'
        +'<cita ciudad="3" tipoCita="" numTransaccion="" idCita="" fechaCita=""'
        +' horaCita="" confirm="" estatusConfirm=""> '+ CRLF
        +' ' +CRLF
        +'    <ciudadano>'
        +'<numeroIdentidad>0101-1978-01018</numeroIdentidad>'
        +'<nombreCompleto>AMERICA IVONNE ALEMAN ARGUETA </nombreCompleto>'
        +'<numeroIdentificacion></numeroIdentificacion>'
        +'    </ciudadano>'
        +'<datosTransaccion>'
        +'<fechaTransaccion>08/24/04</fechaTransaccion>'
        +'<idSucursal>314</idSucursal>'
        +'<duracionPasaporte>1</duracionPasaporte>'
        +'<costoPasaporte></costoPasaporte>'
        +'<costoCita></costoCita>'
        +'<montoCredito></montoCredito>'
        +'<totalTransaccion></totalTransaccion>'
        +'<tipoCambio>18.182</tipoCambio>'
        +'<folioTGR1>0</folioTGR1>'
        +'<transaccionExtranjero>'
        +'<pais></pais>'
        +'<ciudad></ciudad>'
        +'<tipoServicio></tipoServicio>'
        +'<numDocPago></numDocPago>'
        +'<comentarioPago></comentarioPago>'
        +'<montoPago></montoPago>'
        +'</transaccionExtranjero>'
        +'</datosTransaccion>'
        +'<pasaporteAnterior>'
        +'<libretaAnterior>B038626 </libretaAnterior>'
        +'<fechaExpedicion>02/04/2004</fechaExpedicion>'
        +'<fechaVencimiento>02/04/2009</fechaVencimiento>'
        +'<tiempoVigencia></tiempoVigencia>'
        +'<mesesVigencia></mesesVigencia>'
        +'</pasaporteAnterior>'
        //</cita>';
        +'</cita></stringXML>' + CRLF
        +'  </RecibeXML>' + CRLF
        +' </soap:Body>' + CRLF
        +'</soap:Envelope>';
       rc = http_url_post(
                  'http://172.30.7.2/singecmotorcitas/citas.asmx'
                         : %addr(SOAP) + 2
                         : %len(SOAP)
                         : '/tmp/Citas.xml'
                         : HTTP_TIMEOUT
                         : HTTP_USERAGENT
                         : 'text/xml'
                         : 'http://tempuri.org/ws_MotorSINGEC/'+
                           'Citas/RecibeXML');
       if (rc <> 1);
          msg = http_error();
       else;
   
          msg = 'Ok';
       endif;

 
       *inlr = *on;

HTTPAPI Ver 1.13.1 released 2006-01-03

New tables set, ASCII=QTCPASC. EBCDIC=QTCPEBC
http_url_post(): entered
http_persist_open(): entered
http_long_ParseURL(): entered
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /singecmotorcitas/citas.asmx HTTP/1.1
Host: 172.30.7.2
User-Agent: http-api/1.14
Content-Type: text/xml
SOAPAction: http://tempuri.org/ws_MotorSINGEC/Citas/RecibeXML
Expect: 100-continue
Content-Length: 1431


recvresp(): entered
HTTP/1.1 100 Continue
Via: 1.1 P-ISASERVER


SetError() ¬13: HTTP/1.1 100 Continue
senddoc(): entered
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
 <soap:Body>
  <RecibeXML xmlns="http://tempuri.org/ws_MotorSINGEC/Citas";>
   <stringXML><cita ciudad="3" tipoCita="" numTransaccion="" idCita="" fechaCita="" horaCita="" confirm="" estatusConfirm=""> 
 
    <ciudadano><numeroIdentidad>0101-1978-01018</numeroIdentidad><nombreCompleto>AMERICA IVONNE ALEMAN ARGUETA </nombreCompleto><numeroIdentificacion></numeroIdentificacion>    </ciudadano><datosTransaccion><fechaTransaccion>08/24/04</fechaTransaccion><idSucursal>314</idSucursal><duracionPasaporte>1</duracionPasaporte><costoPasaporte></costoPasaporte><costoCita></costoCita><montoCredito></montoCredito><totalTransaccion></totalTransaccion><tipoCambio>18.182</tipoCambio><folioTGR1>0</folioTGR1><transaccionExtranjero><pais></pais><ciudad></ciudad><tipoServicio></tipoServicio><numDocPago></numDocPago><comentarioPago></comentarioPago><montoPago></montoPago></transaccionExtranjero></datosTransaccion><pasaporteAnterior><libretaAnterior>B038626 </libretaAnterior><fechaExpedicion>02/04/2004</fechaExpedicion><fechaVencimiento>02/04/2009</fechaVencimiento><tiempoVigencia></tiempoVigencia><mesesVigencia></mesesVigencia></pasaporteAnterior></cita></stringXML>
  </RecibeXML>
 </soap:Body>
</soap:Envelope>

recvresp(): entered
HTTP/1.1 500 Internal Server Error.
Connection: Keep-Alive
Content-Length: 535
Date: Sat, 24 Mar 2007 12:19:33 GMT
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private


SetError() ¬13: HTTP/1.1 500 Internal Server Error.
recvdoc parms: identity 535
recvdoc(): entered
SetError() ¬0:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Client</faultcode>
      <faultstring>Server was unable to read request. --&gt; There is an error in XML document (9, 6). --&gt; 'Element' is an invalid node type. Line 9, position 6.</faultstring>
      <detail />
    </soap:Fault>
  </soap:Body>
</soap:Envelope>
SetError() ¬13: HTTP/1.1 500 Internal Server Error.
http_close(): entered
     H DFTACTGRP(*NO) BNDDIR('LIBHTTP/HTTPAPI')

     D/copy libhttp/qrpglesrc,httpapi_h

     D cmd             pr                  extpgm('QCMDEXC')
     D  command                     200A   const
     D  length                       15P 5 const

     D rc              s             10I 0
     D msg             s             52A
     d Enc             s                   like(HTTP_URL_ENCODER)
     D CRLF            C                   CONST(x'0d25')
     d
     D data            S               *
     D size            S             10I 0

 

     D SOAP            s          32767A   varying

      /free
       SOAP =
         '<?xml version=1.0 encoding=utf-8?>'
        +'<cita ciudad=3 tipoCita= numTransaccion= idCita= fechaCita='
        +' horaCita= confirm= estatusConfirm=>'
        +'<ciudadano>'
        +'<numeroIdentidad>0101-1978-01018</numeroIdentidad>'
        +'<nombreCompleto>AMERICA IVONNE ALEMAN ARGUETA </nombreCompleto>'
        +'<numeroIdentificacion></numeroIdentificacion>'
        +'</ciudadano>'
        +'<datosTransaccion>'
        +'<fechaTransaccion>08/24/04</fechaTransaccion>'
        +'<idSucursal>314</idSucursal>'
        +'<duracionPasaporte>1</duracionPasaporte>'
        +'<costoPasaporte></costoPasaporte>'
        +'<costoCita></costoCita>'
        +'<montoCredito></montoCredito>'
        +'<totalTransaccion></totalTransaccion>'
        +'<tipoCambio>18.182</tipoCambio>'
        +'<folioTGR1>0</folioTGR1>'
        +'<transaccionExtranjero>'
        +'<pais></pais>'
        +'<ciudad></ciudad>'
        +'<tipoServicio></tipoServicio>'
        +'<numDocPago></numDocPago>'
        +'<comentarioPago></comentarioPago>'
        +'<montoPago></montoPago>'
        +'</transaccionExtranjero>'
        +'</datosTransaccion>'
        +'<pasaporteAnterior>'
        +'<libretaAnterior>B038626 </libretaAnterior>'
        +'<fechaExpedicion>02/04/2004</fechaExpedicion>'
        +'<fechaVencimiento>02/04/2009</fechaVencimiento>'
        +'<tiempoVigencia></tiempoVigencia>'
        +'<mesesVigencia></mesesVigencia>'
        +'</pasaporteAnterior>'
        +'</cita>';
      /end-free
     c
     c                   eval      *inlr = *on
     c                   eval      Enc=HTTP_url_encoder_new
     c                   callp     http_url_encoder_addvar_s(
     c                                Enc  : 'stringXML': %trim(SOAP))
     c
     c                   callp     http_url_encoder_getptr(
     c                                Enc  : data : size )
     c
     c                   eval      rc=http_url_post(
     c                                'http://172.30.7.2/singecmotorcitas/'+
     c                                'citas.asmx'+
     c                                '/RecibeXML'
     c                                : data
     c                                : size
     c                                : '/tmp/httptest.html'
     c                                : HTTP_TIMEOUT
     c                                : HTTP_USERAGENT
     c                                : 'application/x-www-form-urlencoded')
     c
     c
     c                   callp     http_url_encoder_free(Enc)
     c
     c*                  dsply                   msg
     c                   if        rc <> 1
     c                   eval      msg = http_error
     c                   dsply                   msg
     c     msg           dsply
     c     'ERROR'       dsply
     c                   return
     c                   endif
     c*    'OK'          dsply

     c                   callp     cmd('DSPF ''/tmp/httptest.html''': 200)
     c                   return
http_url_post(): entered
http_persist_open(): entered
http_long_ParseURL(): entered
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /singecmotorcitas/citas.asmx/RecibeXML HTTP/1.1
Host: 172.30.7.2
User-Agent: http-api/1.14
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue
Content-Length: 1399


recvresp(): entered
HTTP/1.1 100 Continue
Via: 1.1 P-ISASERVER


SetError() ¬13: HTTP/1.1 100 Continue
senddoc(): entered
stringXML=%3C%3Fxml+version%3D1.0+encoding%3Dutf-8%3F%3E%3Ccita+ciudad%3D3+tipoCita%3D+numTransaccion%3D+idCita%3D+fechaCita%3D+horaCita%3D+confirm%3D+estatusConfirm%3D%3E%3Cciudadano%3E%3CnumeroIdentidad%3E0101-1978-01018%3C%2FnumeroIdentidad%3E%3CnombreCompleto%3EAMERICA+IVONNE+ALEMAN+ARGUETA+%3C%2FnombreCompleto%3E%3CnumeroIdentificacion%3E%3C%2FnumeroIdentificacion%3E%3C%2Fciudadano%3E%3CdatosTransaccion%3E%3CfechaTransaccion%3E08%2F24%2F04%3C%2FfechaTransaccion%3E%3CidSucursal%3E314%3C%2FidSucursal%3E%3CduracionPasaporte%3E1%3C%2FduracionPasaporte%3E%3CcostoPasaporte%3E%3C%2FcostoPasaporte%3E%3CcostoCita%3E%3C%2FcostoCita%3E%3CmontoCredito%3E%3C%2FmontoCredito%3E%3CtotalTransaccion%3E%3C%2FtotalTransaccion%3E%3CtipoCambio%3E18.182%3C%2FtipoCambio%3E%3CfolioTGR1%3E0%3C%2FfolioTGR1%3E%3CtransaccionExtranjero%3E%3Cpais%3E%3C%2Fpais%3E%3Cciudad%3E%3C%2Fciudad%3E%3CtipoServicio%3E%3C%2FtipoServicio%3E%3CnumDocPago%3E%3C%2FnumDocPago%3E%3CcomentarioPago%3E%3C%2FcomentarioPago%3E%3CmontoPago%3E%3C%2FmontoPago%3E%3C%2FtransaccionExtranjero%3E%3C%2FdatosTransaccion%3E%3CpasaporteAnterior%3E%3ClibretaAnterior%3EB038626+%3C%2FlibretaAnterior%3E%3CfechaExpedicion%3E02%2F04%2F2004%3C%2FfechaExpedicion%3E%3CfechaVencimiento%3E02%2F04%2F2009%3C%2FfechaVencimiento%3E%3CtiempoVigencia%3E%3C%2FtiempoVigencia%3E%3CmesesVigencia%3E%3C%2FmesesVigencia%3E%3C%2FpasaporteAnterior%3E%3C%2Fcita%3E

recvresp(): entered
HTTP/1.1 500 Internal Server Error
Connection: Keep-Alive
Content-Length: 3042
Date: Sun, 25 Mar 2007 07:24:20 GMT
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private


SetError() ¬13: HTTP/1.1 500 Internal Server Error
recvdoc parms: identity 3042
recvdoc(): entered
SetError() ¬0:
<html>
    <head>
        <title>Runtime Error</title>
        <style>
        	body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
        	p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
        	b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
        	H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
        	H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
        	pre {font-family:"Lucida Console";font-size: .9em}
        	.marker {font-weight: bold; color: black;text-decoration: none;}
        	.version {color: gray;}
        	.error {margin-bottom: 10px;}
        	.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/SINGECMotorCitas' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>Runtime Error</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
            <br><br>

            <b>Details:</b> To enable the details of this specific error message to be viewable on remote machines, please create a &lt;customErrors&gt; tag within a &quot;web.config&quot; configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its &quot;mode&quot; attribute set to &quot;Off&quot;.<br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

&lt;!-- Web.Config Configuration File --&gt;

&lt;configuration&gt;
    &lt;system.web&gt;
        &lt;customErrors mode=&quot;Off&quot;/&gt;
    &lt;/system.web&gt;
&lt;/configuration&gt;</pre></code>

                  </td>
               </tr>
            </table>

            <br>

            <b>Notes:</b> The current error page you are seeing can be replaced by a custom error page by modifying the &quot;defaultRedirect&quot; attribute of the application's &lt;customErrors&gt; configuration tag to point to a custom error page URL.<br><br>

            <table width=100% bgcolor="#ffffcc">
               <tr>
                  <td>
                      <code><pre>

&lt;!-- Web.Config Configuration File --&gt;

&lt;configuration&gt;
    &lt;system.web&gt;
        &lt;customErrors mode=&quot;RemoteOnly&quot; defaultRedirect=&quot;mycustompage.htm&quot;/&gt;
    &lt;/system.web&gt;
&lt;/configuration&gt;</pre></code>

                  </td>
               </tr>
            </table>

            <br>

    </body>
</html>

SetError() ¬13: HTTP/1.1 500 Internal Server Error
http_close(): entered

Attachment: XML Bancos.doc
Description: MS-Word document

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