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

RE: Consume WCF web service with .svc extension



Your latest debug shows a misspelling on the namespace that was not there in the code you posted.

 envellope should be envelope

The debug still looks altered. All the URLs have the [#] notation on them. But that is not the problem with the program - just how you are doing the debug.

FWIW. Still using PDM? I created a an option that takes me directly to the debug.

Option  Command                      
  VD    dspf '/tmp/httpapi_debug.txt'

I also at one time set up a "send me the debug using mmail" option. I have to admit I did not know I had this defined (I have not used in a long time). But it does the job very well.

  HE    MMAIL/EMLSTMF SUBJECT('Debug file') FROMNAME('Me') FROMADDR(MK@xxxxx) TO(MK@xxxxx/Me/*TO) STMF('/tmp/httpapi_debug.txt')                                               

 

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Thursday, August 28, 2014 11:24 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Consume WCF web service with .svc extension

That log I can read..

And it clearly shows the encoding line Scott K suggested you remove and the [1],[2] that Scott M said to removed.

You code should be as shown here
http://code.midrange.com/941a2c756b.html

Charles



On Thu, Aug 28, 2014 at 11:08 AM, Nikhil Rustagi <nik.rust@xxxxxxxxx> wrote:

>    Thanks for the help. But just to be double sure, I am attaching the
>    debug log as a .txt document. Let me know if there is anything else
>    also that I need to change.
>    Thanks,
>    Nikhil
>
>    On Thu, Aug 28, 2014 at 8:21 PM, Scott Mildenberger
>    <[1]SMildenberger@xxxxxxxxxxxxxxxxxx> wrote:
>
>      Ok I was wrong, then I was right :)Â  Probably a cut and paste from
>      gmail.
>      Scott
>
>    -----Original Message-----
>    From: [2]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    [mailto:[3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Charles
>    Wilt
>    Sent: Thursday, August 28, 2014 8:43 AM
>    To: HTTPAPI and FTPAPI Projects
>    Subject: 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
>      <[4]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 <
>
>    > [5]SMildenberger@xxxxxxxxxxxxxxxxxx> wrote:
>    >
>    >> You have a [1] and [2] in your soap variable just before http,
>    remove
>    >> those.
>    >>
>    >> Scott
>    >>
>    >> -----Original Message-----
>
>    >> From: [6]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:
>    >> [7]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: [8]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: [9]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]
>
>    >> [10]http://schemas.xmlsoap.org/soap/envellope/"; xmlns:ns="[2]
>
>    >> [11]http://www.restfulwebservices.net/ServiceContracts/2008/01
>    >>
>    >>
>    "><soapenv:Header/><soapenv:Body><ns:GetConversionRate><ns:FromCurren
>    >>
>    cy>USD</ns:FromCurrency><ns:ToCurrency>EUR</ns:ToCurrency></ns:GetCon
>    >> versionRate></soapenv:Body></soapenv:Envelope>
>    >> recvresp(): entered
>    >> HTTP/1.1 400 Bad Request
>    >> Server: Microsoft-IIS/7.0
>
>      >> X-Powered-By: [12]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
>
>      >> <[13]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][14]http://schemas.xmlsoap.org/soap/envelope/";
>    >> >Â  Â  xmlns:ns="[2]
>    >> [15]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][16]http://schemas.xmlsoap.org/soap/envelope/";>
>    >> >Â  Â  ÃÂ  Ã <s:Body>
>    >> >Â  Â  ÃÂ  ÃÂ  ÃÂ  <GetConversionRateResponse
>    >> >
>    >> >
>    xmlns="[4][17]http://www.restfulwebservices.net/ServiceContracts/2008/0
>    >> > 1
>    >> ">
>    >> >Â  Â  ÃÂ  ÃÂ  ÃÂ  ÃÂ  Ã <GetConversionRateResult
>    >> >Â  Â
>    xmlns:a="[5][18]http://www.restfulwebservices.net/DataContracts/2008/01
>    "
>    >> >Â  Â  xmlns:i="[6][19]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][20]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][21]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]
>    >> [22]http://www.restfulwebservices.net/wcf/CurrencyService.svc
>    >> >Â  Â  Â  ÃÂ  Ã Nikhil
>    >> >Â  Â  Â  References
>    >> >Â  Â  Â  ÃÂ  Ã 1.
>    >> >
>    >> >
>    [10][23]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
>    >> >
>
>      >>
>      --------------------------------------------------------------------
>      >> >Â  Â  Â  ---
>      >> >Â  Â  Â  This is the FTPAPI mailing list.ÃÂ  To unsubscribe,
>      please go to:
>      >> >Â  Â  Â
>      [11][24]http://www.scottklement.com/mailman/listinfo/ftpapi
>      >> >
>      >>
>      --------------------------------------------------------------------
>      >> >Â  Â  Â  ---
>      >> >
>      >> > References
>      >> >
>
>    >> >Â  Â  1. [25]http://schemas.xmlsoap.org/soap/envelope/
>    >> >Â  Â  2.
>    [26]http://www.restfulwebservices.net/ServiceContracts/2008/01
>    >> >Â  Â  3. [27]http://schemas.xmlsoap.org/soap/envelope/
>    >> >Â  Â  4.
>    [28]http://www.restfulwebservices.net/ServiceContracts/2008/01
>    >> >Â  Â  5.
>    [29]http://www.restfulwebservices.net/DataContracts/2008/01
>    >> >Â  Â  6. [30]http://www.w3.org/2001/XMLSchema-instance
>    >> >Â  Â  7. [31]http://www.scottklement.com/presentations/#HTTPAPI
>    >> >Â  Â  8. mailto:[32]nik.rust@xxxxxxxxx
>    >> >Â  Â  9.
>    [33]http://www.restfulwebservices.net/wcf/CurrencyService.svc
>    >> >Â  Â 10.
>    [34]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
>
>      >> >Â  Â 11. [35]http://www.scottklement.com/mailman/listinfo/ftpapi
>      >> >
>      >> >
>      -------------------------------------------------------------------
>      >> > ---
>      >> > - This is the FTPAPI mailing list.  To unsubscribe, please go
>      to:
>
>    >> > [36]http://www.scottklement.com/mailman/listinfo/ftpapi
>    >> >
>    -------------------------------------------------------------------
>    >> > ---
>    >> > -
>    >> >
>    >> >
>
>      >>
>      --------------------------------------------------------------------
>      -
>      >> -- This is the FTPAPI mailing list.  To unsubscribe, please go
>      to:
>
>    >> [37]http://www.scottklement.com/mailman/listinfo/ftpapi
>    >>
>    ---------------------------------------------------------------------
>    >> --
>    >>
>    >
>    >
>    
> ----------------------------------------------------------------------
> -
>
>      This is the FTPAPI mailing list.  To unsubscribe, please go to:
>      [38]http://www.scottklement.com/mailman/listinfo/ftpapi
>      --------------------------------------------------------------------
>      ---
>
> References
>
>    1. mailto:SMildenberger@xxxxxxxxxxxxxxxxxx
>    2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    4. mailto:charles.wilt@xxxxxxxxx
>    5. mailto:SMildenberger@xxxxxxxxxxxxxxxxxx
>    6. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    7. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>    8. http://AON.COM/
>    9. http://www.restfulwebservices.net/
>   10. http://schemas.xmlsoap.org/soap/envellope/
>   11. http://www.restfulwebservices.net/ServiceContracts/2008/01
>   12. http://ASP.NET/
>   13. mailto:charles.wilt@xxxxxxxxx
>   14. http://schemas.xmlsoap.org/soap/envelope/
>   15. http://www.restfulwebservices.net/ServiceContracts/2008/01
>   16. http://schemas.xmlsoap.org/soap/envelope/
>   17. http://www.restfulwebservices.net/ServiceContracts/2008/0
>   18. http://www.restfulwebservices.net/DataContracts/2008/01
>   19. http://www.w3.org/2001/XMLSchema-instance
>   20. http://www.scottklement.com/presentations/#HTTPAPI
>   21. mailto:nik.rust@xxxxxxxxx
>   22. http://www.restfulwebservices.net/wcf/CurrencyService.svc
>   23. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
>   24. http://www.scottklement.com/mailman/listinfo/ftpapi
>   25. http://schemas.xmlsoap.org/soap/envelope/
>   26. http://www.restfulwebservices.net/ServiceContracts/2008/01
>   27. http://schemas.xmlsoap.org/soap/envelope/
>   28. http://www.restfulwebservices.net/ServiceContracts/2008/01
>   29. http://www.restfulwebservices.net/DataContracts/2008/01
>   30. http://www.w3.org/2001/XMLSchema-instance
>   31. http://www.scottklement.com/presentations/#HTTPAPI
>   32. mailto:nik.rust@xxxxxxxxx
>   33. http://www.restfulwebservices.net/wcf/CurrencyService.svc
>   34. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
>   35. http://www.scottklement.com/mailman/listinfo/ftpapi
>   36. http://www.scottklement.com/mailman/listinfo/ftpapi
>   37. http://www.scottklement.com/mailman/listinfo/ftpapi
>   38. 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
> ----------------------------------------------------------------------
> -
>
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------