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

Re: Webservice getCitiesByCountry



   Thank you Charles for your mail.
   I made the change, but unfortunately I get the same error:
    HTTPAPI Ver 1.24 released 2012-01-23
   OS/400 Ver V6R1M0
   http_url_post(): entered
   http_persist_open(): entered
   http_long_ParseURL(): entered
   DNS resolver retrans: 2
   DNS resolver retry  : 2
   DNS resolver options: x'00000136'
   DNS default domain: WEMAG.ch
   DNS server found: 195.186.1.110
   http_persist_post(): entered
   http_persist_req(POST) entered.
   http_long_ParseURL(): entered
   do_oper(POST): entered
   There are 0 cookies in the cache
   POST /globalweather.asmx/GetCitiesByCountry HTTP/1.1
   Host: [1]www.webserviceX.NET
   User-Agent: http-api/1.24
   Content-Type: text/xml; charset=utf-8
   SOAPAction: urn.[2]"http://www.webserviceX.NET/GetCitiesByCountry";
   Content-Length: 278
   senddoc(): entered
   <soap:Envelope xmlns:soap=[3]"http://www.w3.org/2003/05/soap-envelope";
   xmlns:web=[4]"http://www.webserviceX.NET";> <soap:Header/>
   <soap:Body>      <web:GetCitiesByCountry>
   <web:CountryName>Italy</web:CountryName>
   </web:GetCitiesByCountry>   </soap:Body></soap:Envelope>
   recvresp(): entered
   HTTP/1.1 500 Internal Server Error
   Cache-Control: private
   Content-Length: 236
   Content-Type: text/plain; charset=utf-8
   Server: Microsoft-IIS/7.0
   X-AspNet-Version: 4.0.30319
   X-Powered-By: ASP.NET
   Date: Fri, 11 Jul 2014 13:55:03 GMT
   SetError() #13: HTTP/1.1 500 Internal Server Error
   recvresp(): end with 500
   recvdoc parms: identity 236
   header_load_cookies() entered
   recvdoc(): entered
   SetError() #0:
   System.InvalidOperationException: Request format is invalid: text/xml;
   charset=utf-8.
      at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
      at
   System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
   SetError() #13: HTTP/1.1 500 Internal Server Error
   http_close(): entered
   I still don't see the error.
   Best regards
   Jn

   Am 11.07.2014 14:41, schrieb Charles Wilt:

   You are not posting a proper XML document
   If you use SoapUI to examine the WSDL
   ([1][5]http://www.webservicex.net/globalweather.asmx?WSDL)
   You'll see
   <web:CountryName>?</web:CountryName>
   Your doc is missing the / in the closing tag.
   Charles

   On Fri, Jul 4, 2014 at 9:05 AM, Jan Grove Vejlstrup [6]<[2]jgv@xxxxxxxx>
   wrote:

     Hello
     I'm trying to use HTTPAPI to consume this webservice:
     [3][7]http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCount
     ry
     This is my little program:
     &#65533;  &#65533;  &#65533; H DFTACTGRP(*NO) ACTGRP(*new) BNDDIR('HTTPAPI'
)
     &#65533;  &#65533;  &#65533; W*E CRTBNDRPG &#65533; get_cities &#65533;  sr
cfile(*libl/qrpglesrc)
     &#65533;  &#65533;  &#65533; W*E+ &#65533;  &#65533;  &#65533;  DBGVIEW(*SO
URCE)
     &#65533;  &#65533;  &#65533; W*E+ &#65533;  &#65533;  &#65533;  REPLACE(*YE
S)
     &#65533;  &#65533;  &#65533; E*W
     &#65533;  &#65533;  &#65533;  /copy HTTPAPI_H
     &#65533;  &#65533;  &#65533; d VARYINGDATAOFFSET...
     &#65533;  &#65533;  &#65533; d &#65533;  &#65533;  &#65533;  &#65533;  &#65
533;  &#65533;  &#65533;  &#65533;  c &#65533;  &#65533;  &#65533;  &#65533;  &#
65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;
     const(2)
     &#65533;  &#65533;  &#65533; d SOAP &#65533;  &#65533;  &#65533;  &#65533;
 &#65533;  &#65533; s &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  1024a &#
65533;  &#65533;  varying
     &#65533;  &#65533;  &#65533; d rc &#65533;  &#65533;  &#65533;  &#65533;  &
#65533;  &#65533;  &#65533; s &#65533;  &#65533;  &#65533;  &#65533;  &#65533;
&#65533;  10i 0
     &#65533;  &#65533;  &#65533; d c_COUNTRY &#65533;  &#65533;  &#65533;  s &#
65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  20a &#65533;  &#65533;
  varying
     &#65533;  &#65533;  &#65533;  /free
     &#65533;  &#65533;  &#65533;  &#65533;  c_COUNTRY = 'Italy';
     &#65533;  &#65533;  &#65533;  &#65533;  SOAP = '<soap:Envelope'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + '
     xmlns:soap="[4][8]http://www.w3.org/2003/05/soap-envelope'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' xm
lns:web="[5][9]http://www.webserviceX.NET";>'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' <s
oap:Header/>'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' &#
65533;  <soap:Body>'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' &#
65533;  &#65533;  &#65533; <web:GetCitiesByCountry>'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' &#
65533;  &#65533;  &#65533;  &#65533;  &#65533; <web:CountryName>' + c_Country
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' <w
eb:CountryName>'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' &#
65533;  &#65533;  &#65533; </web:GetCitiesByCountry>'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + ' &#
65533;  </soap:Body>'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; + '</s
oap:Envelope>';
     &#65533;  &#65533;  &#65533;  &#65533;  // http_setCCSIDs(1208 : 0);
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; http_debug(*ON:'
/jgvtmp/httpapi_debug1.txt');
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; rc =
     http_post('[6][10]http://www.webserviceX.NET/globalweather.asmx'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  + '/GetCitiesBy
Country'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  : %addr(SOAP) +
     VARYINGDATAOFFSET
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  : %len(SOAP)
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  :
     '/jgvtmp/CitiesByCountry.txt'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  : HTTP_TIMEOUT
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  : HTTP_USERAGEN
T
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  : 'text/xml;
     charset=utf-8'
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#655
33;  &#65533; :
     'urn."[7][11]http://www.webserviceX.NET/GetCitiesByCountry";');
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; if (rc <> 1);
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; http_c
rash();
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; endif;
     &#65533;  &#65533;  &#65533;  &#65533;  &#65533;  &#65533; *inlr = *on;
     &#65533;  &#65533;  &#65533;  /end-free
     And this is the resulting debug-file:
     HTTPAPI Ver 1.24 released 2012-01-23
     OS/400 Ver V6R1M0
     New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819.
     ProtLoc=0
     http_url_post(): entered
     http_persist_open(): entered
     http_long_ParseURL(): entered
     DNS resolver retrans: 2
     DNS resolver retry &#65533; : 2
     DNS resolver options: x'00000136'
     DNS default domain: WEMAG.ch
     DNS server found: 195.186.1.110
     http_persist_post(): entered
     http_persist_req(POST) entered.
     http_long_ParseURL(): entered
     do_oper(POST): entered
     There are 0 cookies in the cache
     POST /globalweather.asmx/GetCitiesByCountry HTTP/1.1
     Host: [8]www.webserviceX.NET
     User-Agent: http-api/1.24
     Content-Type: text/xml; charset=utf-8
     SOAPAction: urn."[9][12]http://www.webserviceX.NET/GetCitiesByCountry";
     Content-Length: 277
     senddoc(): entered
     <soap:Envelope
     xmlns:soap="[10][13]http://www.w3.org/2003/05/soap-envelope
     xmlns:web="[11][14]http://www.webserviceX.NET";> <soap:Header/>
     <soap:Body> &#65533;  &#65533;  &#65533; <web:GetCitiesByCountry> <web:Coun
tryName>Italy
     <web:CountryName> </web:GetCitiesByCountry>
     </soap:Body></soap:Envelope>
     recvresp(): entered
     HTTP/1.1 500 Internal Server Error
     Cache-Control: private
     Content-Length: 236
     Content-Type: text/plain; charset=utf-8
     Server: Microsoft-IIS/7.0
     X-AspNet-Version: 4.0.30319
     X-Powered-By: [12]ASP.NET
     Date: Fri, 04 Jul 2014 12:58:25 GMT
     SetError() #13: HTTP/1.1 500 Internal Server Error
     recvresp(): end with 500
     recvdoc parms: identity 236
     header_load_cookies() entered
     recvdoc(): entered
     SetError() #0:
     System.InvalidOperationException: Request format is invalid:
     text/xml; charset=utf-8.
     &#65533;  &#65533; at
     System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
     &#65533;  &#65533; at
     System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
     SetError() #13: HTTP/1.1 500 Internal Server Error
     http_close(): entered
     What am I doing wrong?
     Best regards
     Jan
     --------------------------------------------------------------------
     ---
     This is the FTPAPI mailing list. &#65533; To unsubscribe, please go to:
     [13][15]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---

References

   1. [16]http://www.webservicex.net/globalweather.asmx?WSDL
   2. [17]mailto:jgv@xxxxxxxx
   3. [18]http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCountry
   4. [19]http://www.w3.org/2003/05/soap-envelope
   5. [20]http://www.webserviceX.NET/
   6. [21]http://www.webserviceX.NET/globalweather.asmx
   7. [22]http://www.webserviceX.NET/GetCitiesByCountry
   8. [23]http://www.webserviceX.NET/
   9. [24]http://www.webserviceX.NET/GetCitiesByCountry
  10. [25]http://www.w3.org/2003/05/soap-envelope
  11. [26]http://www.webserviceX.NET/
  12. [27]http://ASP.NET/
  13. [28]http://www.scottklement.com/mailman/listinfo/ftpapi


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

References

   1. http://www.webserviceX.NET/
   2. http://www.webserviceX.NET/GetCitiesByCountry
   3. http://www.w3.org/2003/05/soap-envelope
   4. http://www.webserviceX.NET/
   5. http://www.webservicex.net/globalweather.asmx?WSDL
   6. mailto:[2]jgv@xxxxxxxx
   7. http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCount
   8. http://www.w3.org/2003/05/soap-envelope
   9. http://www.webserviceX.NET/
  10. http://www.webserviceX.NET/globalweather.asmx
  11. http://www.webserviceX.NET/GetCitiesByCountry
  12. http://www.webserviceX.NET/GetCitiesByCountry
  13. http://www.w3.org/2003/05/soap-envelope
  14. http://www.webserviceX.NET/
  15. http://www.scottklement.com/mailman/listinfo/ftpapi
  16. http://www.webservicex.net/globalweather.asmx?WSDL
  17. mailto:jgv@xxxxxxxx
  18. http://www.webservicex.net/globalweather.asmx?op=GetCitiesByCountry
  19. http://www.w3.org/2003/05/soap-envelope
  20. http://www.webserviceX.NET/
  21. http://www.webserviceX.NET/globalweather.asmx
  22. http://www.webserviceX.NET/GetCitiesByCountry
  23. http://www.webserviceX.NET/
  24. http://www.webserviceX.NET/GetCitiesByCountry
  25. http://www.w3.org/2003/05/soap-envelope
  26. http://www.webserviceX.NET/
  27. http://ASP.NET/
  28. http://www.scottklement.com/mailman/listinfo/ftpapi
  29. 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
-----------------------------------------------------------------------