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

Re: Consume WCF web service with .svc extension



   Ok, so it is in his code...
   Yeah, those need to be removed.
   Charles

   On Thu, Aug 28, 2014 at 10:41 AM, Charles Wilt
   <[1]charles.wilt@xxxxxxxxx> wrote:

   gmail adds those to the email...
   It's not in his code..
   Charles

   On Thu, Aug 28, 2014 at 10:11 AM, Scott Mildenberger
   <[2]SMildenberger@xxxxxxxxxxxxxxxxxx> wrote:

     You have a [1] and [2] in your soap variable just before http,
     remove those.
     Scott

   -----Original Message-----
   From: [3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [mailto:[4]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Nikhil
   Rustagi
   Sent: Wednesday, August 27, 2014 11:35 PM
   To: HTTPAPI and FTPAPI Projects
   Subject: Re: Consume WCF web service with .svc extension
   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: [5]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: [6]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]
     [7]http://schemas.xmlsoap.org/soap/envellope/"; xmlns:ns="[2]
     [8]http://www.restfulwebservices.net/ServiceContracts/2008/01
     "><soapenv:Header/><soapenv:Body><ns:GetConversionRate><ns:FromCurre
     ncy>USD</ns:FromCurrency><ns:ToCurrency>EUR</ns:ToCurrency></ns:GetC
     onversionRate></soapenv:Body></soapenv:Envelope>
     recvresp(): entered
     HTTP/1.1 400 Bad Request
     Server: Microsoft-IIS/7.0
     X-Powered-By: [9]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
     <[10]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][11]http://schemas.xmlsoap.org/soap/envelope/";
     >� �     xmlns:ns="[2][12]http://www.restfulwebservices.net/ServiceContracts/
     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][13]http://schemas.xmlsoap.org/soap/envelope/";>
     >� � �  �<s:Body>
     >� � �  �  �  <GetConversionRateResponse
     >� �     xmlns="[4][14]http://www.restfulwebservices.net/ServiceContracts/200
     8/01">
     >� � �  �  �  �  �<GetConversionRateResult
     >� �     xmlns:a="[5][15]http://www.restfulwebservices.net/DataContracts/2008
     /01"
     >� � xmlns:i="[6][16]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][17]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][18]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][19]http://www.restfulwebservices.net/wcf/CurrencyService.svc
     >� � � �  �Nikhil
     >� � � References
     >� � � �  �1.
     >� � �     [10][20]http://www.restfulwebservices.net/wcf/CurrencyService.svc?ws
     dl
     >� � �     --------------------------------------------------------------------
     >� � � ---
     >� � � This is the FTPAPI mailing list.�  To unsubscribe, please
     go to:
     >� � �     [11][21]http://www.scottklement.com/mailman/listinfo/ftpapi
     >� � �     --------------------------------------------------------------------
     >� � � ---
     >
     > References
     >
     >� � 1. [22]http://schemas.xmlsoap.org/soap/envelope/
     >� � 2.
     [23]http://www.restfulwebservices.net/ServiceContracts/2008/01
     >� � 3. [24]http://schemas.xmlsoap.org/soap/envelope/
     >� � 4.
     [25]http://www.restfulwebservices.net/ServiceContracts/2008/01
     >� � 5.
     [26]http://www.restfulwebservices.net/DataContracts/2008/01
     >� � 6. [27]http://www.w3.org/2001/XMLSchema-instance
     >� � 7. [28]http://www.scottklement.com/presentations/#HTTPAPI
     >� � 8. mailto:[29]nik.rust@xxxxxxxxx
     >� � 9.
     [30]http://www.restfulwebservices.net/wcf/CurrencyService.svc
     >� �10.
     [31]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
     >� �11. [32]http://www.scottklement.com/mailman/listinfo/ftpapi
     >
     >
     --------------------------------------------------------------------
     --
     > - This is the FTPAPI mailing list.� To unsubscribe, please go to:
     > [33]http://www.scottklement.com/mailman/listinfo/ftpapi
     >
     --------------------------------------------------------------------
     --
     > -
     >
     >
     --------------------------------------------------------------------
     ---
     This is the FTPAPI mailing list.� To unsubscribe, please go to:
     [34]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---

References

   1. mailto:charles.wilt@xxxxxxxxx
   2. mailto:SMildenberger@xxxxxxxxxxxxxxxxxx
   3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   4. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   5. http://AON.COM/
   6. http://www.restfulwebservices.net/
   7. http://schemas.xmlsoap.org/soap/envellope/
   8. http://www.restfulwebservices.net/ServiceContracts/2008/01
   9. http://ASP.NET/
  10. mailto:charles.wilt@xxxxxxxxx
  11. http://schemas.xmlsoap.org/soap/envelope/
  12. http://www.restfulwebservices.net/ServiceContracts/2008/01
  13. http://schemas.xmlsoap.org/soap/envelope/
  14. http://www.restfulwebservices.net/ServiceContracts/2008/01
  15. http://www.restfulwebservices.net/DataContracts/2008/01
  16. http://www.w3.org/2001/XMLSchema-instance
  17. http://www.scottklement.com/presentations/#HTTPAPI
  18. mailto:nik.rust@xxxxxxxxx
  19. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  20. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
  21. http://www.scottklement.com/mailman/listinfo/ftpapi
  22. http://schemas.xmlsoap.org/soap/envelope/
  23. http://www.restfulwebservices.net/ServiceContracts/2008/01
  24. http://schemas.xmlsoap.org/soap/envelope/
  25. http://www.restfulwebservices.net/ServiceContracts/2008/01
  26. http://www.restfulwebservices.net/DataContracts/2008/01
  27. http://www.w3.org/2001/XMLSchema-instance
  28. http://www.scottklement.com/presentations/#HTTPAPI
  29. mailto:nik.rust@xxxxxxxxx
  30. http://www.restfulwebservices.net/wcf/CurrencyService.svc
  31. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
  32. http://www.scottklement.com/mailman/listinfo/ftpapi
  33. http://www.scottklement.com/mailman/listinfo/ftpapi
  34. 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
-----------------------------------------------------------------------