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

Re: Consume WCF web service with .svc extension



   With a quick glace, the code looks fine.
   Not sure what your log says as it just came thru to me as a bunch of
   icons...
   Which leads me to suspect that there's a CCSID issue.
   In the job you are running HTTPAPI from, do a DSPJOB and select option
   2-Display job definition attributes, page down a few times and what do
   you see for:
   Language identifier . . . . . . . . . . . . . . . : � ENU�   Country or region identifier �. . . . . . . . . . : � US �   Coded character set identifier �. . . . . . . . . : � 37 �   Default coded character set identifier �. . . . . : � 37 �   I suspect that at least the next to last will be 65535...
   You might try changing your job to the correct CCSID value (CHGJOB
   CCSID(xx))
   Also, you might need to recompile your RPG program using the job with
   the CCSID set properly. �Here's the bigging of a good set of articles
   that talk about RPG literals and CCSID.
   [1]http://www.mcpressonline.com/programming/rpg/when-ccsid-constants-va
   ry-part-i.html
   Charles

   On Thu, Aug 28, 2014 at 1:34 AM, Nikhil Rustagi <[2]nik.rust@xxxxxxxxx>
   wrote:

     � �Hi,
     � �Still I am getting the same error. Below are the details from
     my debug
     � �log. Also attached is the program which I modified using your
     example16
     � �from LIBHTTP. Would be really grateful if you can help me
     understand my
     � �error.ย
     � �HTTPAPI Ver 1.24 released 2012-01-23 ย ย
     � �OS/400 Ver V5R4M0 ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย
     � �http_persist_open(): entered ย� ย� ย� ย� ย ย
     � �http_long_ParseURL(): entered ย� ย� ย� ย� ย
     � �DNS resolver retrans: 2 ย� ย� ย� ย� ย� ย�     ย� ย
     � �DNS resolver retry ย : 2 ย� ย� ย� ย� ย� ย�     ย� ย
     � �DNS resolver options: x'00000136' ย� ย� ย
     � �DNS default domain: [1][3]AON.COM ย� ย� ย� ย� ย�     ย
     � �DNS server found: 10.191.2.65 ย� ย� ย� ย� ย
     � �DNS server found: 10.184.2.65 ย� ย� ย� ย� ย
     � �DNS server found: 10.178.200.20 ย� ย� ย� ย
     � �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 /wcf/CurrencyService.svc HTTP/1.1ย
     � �POST /wcf/CurrencyService.svc HTTP/1.1 ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย
     � �Host: [2][4]www.restfulwebservices.net ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย
     � �User-Agent: http-api/1.24 ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย ย
     � �Content-Type: text/xml ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย
     � �SOAPAction: GetConversionRate ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย ย
     � �Content-Length: 393 ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย ย
     � �senddoc(): entered ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย
     � �<?xml version="1.0" encoding="iso-8859-1"
     � �standalone="no"?><soapenv:Envelope
     �     �xmlns:soapenv="[1][3][5]http://schemas.xmlsoap.org/soap/envellope/
     "
     �     �xmlns:ns="[2][4][6]http://www.restfulwebservices.net/ServiceContra
     cts/2008

   �   �/01"><soapenv:Header/><soapenv:Body><ns:GetConversionRate><ns:FromCur
   re
   �   �ncy>USD</ns:FromCurrency><ns:ToCurrency>EUR</ns:ToCurrency></ns:GetCo
   nv
   � �ersionRate></soapenv:Body></soapenv:Envelope>

     � �recvresp(): entered ย� ย� ย� ย� ย� ย� ย�     ย
     � �HTTP/1.1 400 Bad Request ย� ย� ย� ย� ย ย
     � �Server: Microsoft-IIS/7.0 ย� ย� ย� ย� ย
     � �X-Powered-By: [5][7]ASP.NET ย� ย� ย� ย� ย� ย�     ย
     � �Date: Thu, 28 Aug 2014 05:19:45 GMT
     � �Content-Length: 0 ย� ย� ย� ย� ย� ย� ย�     ย� ย
     � �Connection: Keep-Alive ย� ย� ย� ย� ย� ย ย
     � �ย� ย� ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย� ย� ย� ย� ย� ย ย
     � �SetError() #13: HTTP/1.1 400 Bad Request
     � �recvresp(): end with 400 ย� ย� ย� ย� ย� ย�     ย� ย
     � �recvdoc parms: identity 0 ย� ย� ย� ย� ย� ย�     ย ย
     � �header_load_cookies() entered ย� ย� ย� ย� ย ย
     � �recvdoc(): entered ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย
     � �SetError() #0: ย� ย� ย� ย� ย� ย� ย� ย�     ย� ย� ย� ย� ย
     � �SetError() #13: HTTP/1.1 400 Bad Request
     � �http_close(): entered ย� ย� ย� ย� ย� ย� ย�     ย� ย ย
     � �Thanks,
     � �Nikhil
     � �On Thu, Aug 28, 2014 at 1:21 AM, Charles Wilt
     � �<[6][8]charles.wilt@xxxxxxxxx> wrote:
     � � �ย� ย The extension doesn't matter...it's a standard
     SOAP web service
     � � �ย� ย ร (though there is a REST version also)
     � � �ย� ย Sending it an XML like so:
     � � �ย� ย <soapenv:Envelope
     � � �ย� ย
     xmlns:soapenv="[1][7][9]http://schemas.xmlsoap.org/soap/envelope/";
     � � �ย
     � � �ย
     xmlns:ns="[2][8][10]http://www.restfulwebservices.net/ServiceContrac
     ts
     � � �/2008/01
     � � �ย� ย ">
     � � �ย� ย รย� ร <soapenv:Header/>
     � � �ย� ย รย� ร <soapenv:Body>
     � � �ย� ย รย� รย� รย� <ns:GetConversionRate>
     � � �ย� ย รย� รย� รย� รย� ร
     <ns:FromCurrency>USD</ns:FromCurrency>
     � � �ย� ย รย� รย� รย� รย� ร
     <ns:ToCurrency>EUR</ns:ToCurrency>
     � � �ย� ย รย� รย� รย� </ns:GetConversionRate>
     � � �ย� ย รย� ร </soapenv:Body>
     � � �ย� ย </soapenv:Envelope>
     � � �ย� ย Gets a response back of:
     � � �ย� ย <s:Envelope
     � �     �xmlns:s="[3][9][11]http://schemas.xmlsoap.org/soap/envelope/";>
     � � �ย� ย รย� ร <s:Body>
     � � �ย� ย รย� รย� รย�     <GetConversionRateResponse
     � � �ย
     � � �ย
     xmlns="[4][10][12]http://www.restfulwebservices.net/ServiceContracts
     /2
     � � �008/01">
     � � �ย� ย รย� รย� รย� รย� ร
     <GetConversionRateResult
     � � �ย
     � � �ย
     xmlns:a="[5][11][13]http://www.restfulwebservices.net/DataContracts/
     20
     � � �08/01"
     � � �ย� ย
     xmlns:i="[6][12][14]http://www.w3.org/2001/XMLSchema-instance";>
     � � �ย� ย รย� รย� รย� รย� รย�     รย� <a:FromCurrency>USD</a:FromCurrency>
     � � �ย� ย รย� รย� รย� รย� รย�     รย� <a:ToCurrency>EUR</a:ToCurrency>
     � � �ย� ย รย� รย� รย� รย� รย�     รย� <a:Rate>0.7577</a:Rate>
     � � �ย� ย รย� รย� รย� รย� ร
     </GetConversionRateResult>
     � � �ย� ย รย� รย� รย�     </GetConversionRateResponse>
     � � �ย� ย รย� ร </s:Body>
     � � �ย� ย </s:Envelope>
     � � �ย� ย Scott's presentation on consuming Web services is
     a good place
     � � �to start
     � � �ย� ย
     [7][13][15]http://www.scottklement.com/presentations/#HTTPAPI
     � � �ย� ย Otherwise, turn on HTTP debuging
     � � �ย� ย callp http_debug(*ON);
     � � �ย� ย And post the resulting log
     � � �ย� ย /tmp/httpapi_debug.txt
     � � �ย� ย Charles
     � � �ย� ย On Wed, Aug 27, 2014 at 12:58 PM, Nikhil Rustagi
     � � �ย� ย <[8][14][16]nik.rust@xxxxxxxxx> wrote:
     � � �ย� ย� ย รย� ร Hi,
     � � �ย� ย� ย รย� ร I have been trying to consume a
     wcf service using
     � � �HTTPAPI, but
     � � �ย� ย� ย have
     � � �ย� ย� ย รย� ร been consistently getting error
     code 400 'Bad
     � � �Request'. Is ร
     � � �ย� ย� ย there any
     � � �ย� ย� ย รย� ร example which I can use to
     consume a wcf service. The
     � � �current
     � � �ย� ย� ย examples
     � � �ย� ย� ย รย� ร all use .asmx services.ร
     � � �ย� ย� ย รย� ร I tried with the below service:
     � � �ย� ย� ย รย� ร
     � �     �[1][9][15][17]http://www.restfulwebservices.net/wcf/CurrencyServic
     e.svc
     � � �ย� ย� ย รย� ร Nikhil
     � � �ย� ย� ย References
     � � �ย� ย� ย รย� ร 1.
     � � �ย� ย
     � � �ย
     [10][16][18]http://www.restfulwebservices.net/wcf/CurrencyService.sv
     c?
     � � �wsdl
     � � �ย� ย
     � � �ย
     ------------------------------------------------------------------
     � � �--
     � � �ย� ย� ย ---
     � � �ย� ย� ย This is the FTPAPI mailing list.รย� To
     unsubscribe, please
     � � �go to:
     � � �ย� ย� ย
     [11][17][19]http://www.scottklement.com/mailman/listinfo/ftpapi
     � � �ย� ย
     � � �ย
     ------------------------------------------------------------------
     � � �--
     � � �ย� ย� ย ---
     � � �References
     � � �ย� ย 1.
     [18][20]http://schemas.xmlsoap.org/soap/envelope/
     � � �ย� ย 2.
     � �     �[19][21]http://www.restfulwebservices.net/ServiceContracts/2008/01
     � � �ย� ย 3.
     [20][22]http://schemas.xmlsoap.org/soap/envelope/
     � � �ย� ย 4.
     � �     �[21][23]http://www.restfulwebservices.net/ServiceContracts/2008/01
     � � �ย� ย 5.
     [22][24]http://www.restfulwebservices.net/DataContracts/2008/01
     � � �ย� ย 6.
     [23][25]http://www.w3.org/2001/XMLSchema-instance
     � � �ย� ย 7.
     [24][26]http://www.scottklement.com/presentations/#HTTPAPI
     � � �ย� ย 8. mailto:[25][27]nik.rust@xxxxxxxxx
     � � �ย� ย 9.
     � �     �[26][28]http://www.restfulwebservices.net/wcf/CurrencyService.svc
     � � �ย� 10.
     � �     �[27][29]http://www.restfulwebservices.net/wcf/CurrencyService.svc?
     wsdl
     � � �ย� 11.
     [28][30]http://www.scottklement.com/mailman/listinfo/ftpapi
     � �     �------------------------------------------------------------------
     --
     � � �---
     � � �This is the FTPAPI mailing list.ย� To unsubscribe, please
     go to:
     � � �[29][31]http://www.scottklement.com/mailman/listinfo/ftpapi
     � �     �------------------------------------------------------------------
     --
     � � �---
     References
     � �1. [32]http://AON.COM/
     � �2. [33]http://www.restfulwebservices.net/
     � �3. [34]http://schemas.xmlsoap.org/soap/envellope/
     � �4.
     [35]http://www.restfulwebservices.net/ServiceContracts/2008/01
     � �5. [36]http://ASP.NET/
     � �6. mailto:[37]charles.wilt@xxxxxxxxx
     � �7. [38]http://schemas.xmlsoap.org/soap/envelope/
     � �8.
     [39]http://www.restfulwebservices.net/ServiceContracts/2008/01
     � �9. [40]http://schemas.xmlsoap.org/soap/envelope/
     � 10.
     [41]http://www.restfulwebservices.net/ServiceContracts/2008/01
     � 11. [42]http://www.restfulwebservices.net/DataContracts/2008/01
     � 12. [43]http://www.w3.org/2001/XMLSchema-instance
     � 13. [44]http://www.scottklement.com/presentations/#HTTPAPI
     � 14. mailto:[45]nik.rust@xxxxxxxxx
     � 15. [46]http://www.restfulwebservices.net/wcf/CurrencyService.svc
     � 16.
     [47]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
     � 17. [48]http://www.scottklement.com/mailman/listinfo/ftpapi
     � 18. [49]http://schemas.xmlsoap.org/soap/envelope/
     � 19.
     [50]http://www.restfulwebservices.net/ServiceContracts/2008/01
     � 20. [51]http://schemas.xmlsoap.org/soap/envelope/
     � 21.
     [52]http://www.restfulwebservices.net/ServiceContracts/2008/01
     � 22. [53]http://www.restfulwebservices.net/DataContracts/2008/01
     � 23. [54]http://www.w3.org/2001/XMLSchema-instance
     � 24. [55]http://www.scottklement.com/presentations/#HTTPAPI
     � 25. mailto:[56]nik.rust@xxxxxxxxx
     � 26. [57]http://www.restfulwebservices.net/wcf/CurrencyService.svc
     � 27.
     [58]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
     � 28. [59]http://www.scottklement.com/mailman/listinfo/ftpapi
     � 29. [60]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---
     This is the FTPAPI mailing list.� To unsubscribe, please go to:
     [61]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---

References

   1. http://www.mcpressonline.com/programming/rpg/when-ccsid-constants-vary-part-i.html
   2. mailto:nik.rust@xxxxxxxxx
   3. http://AON.COM/
   4. http://www.restfulwebservices.net/
   5. http://schemas.xmlsoap.org/soap/envellope/
   6. http://www.restfulwebservices.net/ServiceContracts/2008
   7. http://ASP.NET/
   8. mailto:charles.wilt@xxxxxxxxx
   9. http://schemas.xmlsoap.org/soap/envelope/
  10. http://www.restfulwebservices.net/ServiceContracts
  11. http://schemas.xmlsoap.org/soap/envelope/
  12. http://www.restfulwebservices.net/ServiceContracts/2
  13. http://www.restfulwebservices.net/DataContracts/20
  14. http://www.w3.org/2001/XMLSchema-instance
  15. http://www.scottklement.com/presentations/#HTTPAPI
  16. mailto:nik.rust@xxxxxxxxx
  17. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  18. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  19. http://www.scottklement.com/mailman/listinfo/ftpapi
  20. http://schemas.xmlsoap.org/soap/envelope/
  21. http://www.restfulwebservices.net/ServiceContracts/2008/01
  22. http://schemas.xmlsoap.org/soap/envelope/
  23. http://www.restfulwebservices.net/ServiceContracts/2008/01
  24. http://www.restfulwebservices.net/DataContracts/2008/01
  25. http://www.w3.org/2001/XMLSchema-instance
  26. http://www.scottklement.com/presentations/#HTTPAPI
  27. mailto:nik.rust@xxxxxxxxx
  28. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  29. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
  30. http://www.scottklement.com/mailman/listinfo/ftpapi
  31. http://www.scottklement.com/mailman/listinfo/ftpapi
  32. http://AON.COM/
  33. http://www.restfulwebservices.net/
  34. http://schemas.xmlsoap.org/soap/envellope/
  35. http://www.restfulwebservices.net/ServiceContracts/2008/01
  36. http://ASP.NET/
  37. mailto:charles.wilt@xxxxxxxxx
  38. http://schemas.xmlsoap.org/soap/envelope/
  39. http://www.restfulwebservices.net/ServiceContracts/2008/01
  40. http://schemas.xmlsoap.org/soap/envelope/
  41. http://www.restfulwebservices.net/ServiceContracts/2008/01
  42. http://www.restfulwebservices.net/DataContracts/2008/01
  43. http://www.w3.org/2001/XMLSchema-instance
  44. http://www.scottklement.com/presentations/#HTTPAPI
  45. mailto:nik.rust@xxxxxxxxx
  46. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  47. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
  48. http://www.scottklement.com/mailman/listinfo/ftpapi
  49. http://schemas.xmlsoap.org/soap/envelope/
  50. http://www.restfulwebservices.net/ServiceContracts/2008/01
  51. http://schemas.xmlsoap.org/soap/envelope/
  52. http://www.restfulwebservices.net/ServiceContracts/2008/01
  53. http://www.restfulwebservices.net/DataContracts/2008/01
  54. http://www.w3.org/2001/XMLSchema-instance
  55. http://www.scottklement.com/presentations/#HTTPAPI
  56. mailto:nik.rust@xxxxxxxxx
  57. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  58. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
  59. http://www.scottklement.com/mailman/listinfo/ftpapi
  60. http://www.scottklement.com/mailman/listinfo/ftpapi
  61. 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
-----------------------------------------------------------------------