[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Consume WCF web service with .svc extension
It appears that this web service does not like the
encoding="iso-8859-1" that you have specified in your XML processing
instructions (the first line of the XML document you're sending.
Probably it doesn't want the document to send an encoding (instead it
expects the encoding to be within the HTTP transaction, if necessary).
Please remove the encoding (just delete it) from your XML processing
instructions, recompile your RPG, and try again.
On 8/28/2014 12:34 AM, Nikhil Rustagi 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 � � � � � 
5533; � �
DNS resolver retry � : 2 � � � � ʏ
33; � � �
DNS resolver options: x'00000136' � � �
DNS default domain: [1]AON.COM � � � � ᦙ
3; �
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 � � � � � A
533; � � �
There are 0 cookies in the cache � � � �
POST /wcf/CurrencyService.svc HTTP/1.1�
POST /wcf/CurrencyService.svc HTTP/1.1 � � � �
� � � � � � �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � �
Host: [2]www.restfulwebservices.net � � � � &
#65533; � � � � � � �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � �
User-Agent: http-api/1.24 � � � � � &
#65533; � � � � � � � &
#65533; �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � �
Content-Type: text/xml � � � � � A
533; � � � � � � � A
533; � �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � �
SOAPAction: GetConversionRate � � � � �
; � � � � � � � �
; �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � �
Content-Length: 393 � � � � � �
; � � � � � � � �
; � � �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � � �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � � �
; � � �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � � �
; � � �
senddoc(): entered � � � � � �
� � � � � � � �
� � �
� � � � � � � �
; � � � � � � � �
; � � � � � � � �
;
� � � � � � � �
; � � � � � � � �
;
<?xml version="1.0" encoding="iso-8859-1"
standalone="no"?><soapenv:Envelope
xmlns:soapenv="[1][3][1]http://schemas.xmlsoap.org/soap/envellope/"
xmlns:ns="[2][4][2]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:GetConv
ersionRate></soapenv:Body></soapenv:Envelope>
recvresp(): entered � � � � � �
; � �
HTTP/1.1 400 Bad Request � � � � � 
5533;
Server: Microsoft-IIS/7.0 � � � � �
X-Powered-By: [5]ASP.NET � � � � � &#
65533; �
Date: Thu, 28 Aug 2014 05:19:45 GMT
Content-Length: 0 � � � � � �
� � �
Connection: Keep-Alive � � � � � A
533; �
� � � � � � � �
; � � � � � � � �
; � � � � �
SetError() #13: HTTP/1.1 400 Bad Request
recvresp(): end with 400 � � � � � &#
65533; � �
recvdoc parms: identity 0 � � � � � &
#65533; � �
header_load_cookies() entered � � � � �
; �
recvdoc(): entered � � � � � �
� � � � �
SetError() #0: � � � � � � &#
65533; � � � � � �
SetError() #13: HTTP/1.1 400 Bad Request
http_close(): entered � � � � � ʏ
33; � � � �
Thanks,
Nikhil
On Thu, Aug 28, 2014 at 1:21 AM, Charles Wilt
[3]<[6]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][4]http://schemas.xmlsoap.org/soap/
envelope/"
�
� xmlns:ns="[2][8][5]http://www.restfulwebservices.net/ServiceContra
cts
/2008/01
� � ">
� � �� � <soapenv:Header/>
� � �� � <soapenv:Body>
� � �� �� �� <n
s:GetConversionRate>
� � �� �� �� &#
65533;� � <ns:FromCurrency>USD</ns:FromCurrency>
� � �� �� �� &#
65533;� � <ns:ToCurrency>EUR</ns:ToCurrency>
� � �� �� �� </
ns:GetConversionRate>
� � �� � </soapenv:Body>
� � </soapenv:Envelope>
� � Gets a response back of:
� � <s:Envelope
xmlns:s="[3][9][6]http://schemas.xmlsoap.org/soap/envelope/">
� � �� � <s:Body>
� � �� �� �� <G
etConversionRateResponse
�
� xmlns="[4][10][7]http://www.restfulwebservices.net/ServiceContract
s/2
008/01">
� � �� �� �� &#
65533;� � <GetConversionRateResult
�
� xmlns:a="[5][11][8]http://www.restfulwebservices.net/DataContracts
/20
08/01"
� � xmlns:i="[6][12][9]http://www.w3.org/2001/XMLSchema-inst
ance">
� � �� �� �� &#
65533;� �� �� <a:FromCurrency>USD</a:FromC
urrency>
� � �� �� �� &#
65533;� �� �� <a:ToCurrency>EUR</a:ToCurre
ncy>
� � �� �� �� &#
65533;� �� �� <a:Rate>0.7577</a:Rate>
� � �� �� �� &#
65533;� � </GetConversionRateResult>
� � �� �� �� </
GetConversionRateResponse>
� � �� � </s:Body>
� � </s:Envelope>
� � Scott's presentation on consuming Web services is a good
place
to start
� � [7][13][10]http://www.scottklement.com/presentations/#HT
TPAPI
� � 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
� � [11]<[8][14]nik.rust@xxxxxxxxx> wrote:
� � � �� � Hi,
� � � �� � I have been trying
to consume a wcf service using
HTTPAPI, but
� � � have
� � � �� � been consistently g
etting error code 400 'Bad
Request'. Is �
� � � there any
� � � �� � example which I can
use to consume a wcf service. The
current
� � � examples
� � � �� � all use .asmx servi
ces.�
� � � �� � I tried with the be
low service:
� � � �� �
[1][9][15][12]http://www.restfulwebservices.net/wcf/CurrencyService.svc
� � � �� � Nikhil
� � � References
� � � �� � 1.
� �
� [10][16][13]http://www.restfulwebservices.net/wcf/CurrencyService.
svc?
wsdl
� �
� ------------------------------------------------------------------
--
� � � ---
� � � This is the FTPAPI mailing list.�ᦙ
3; To unsubscribe, please
go to:
� � � [11][17][14]http://www.scottklement.com/mailma
n/listinfo/ftpapi
� �
� ------------------------------------------------------------------
--
� � � ---
References
� � 1. [18][15]http://schemas.xmlsoap.org/soap/envelope/
� � 2.
[19][16]http://www.restfulwebservices.net/ServiceContracts/2008/01
� � 3. [20][17]http://schemas.xmlsoap.org/soap/envelope/
� � 4.
[21][18]http://www.restfulwebservices.net/ServiceContracts/2008/01
� � 5. [22][19]http://www.restfulwebservices.net/DataContrac
ts/2008/01
� � 6. [23][20]http://www.w3.org/2001/XMLSchema-instance
� � 7. [24][21]http://www.scottklement.com/presentations/#HT
TPAPI
� � 8. mailto:[[22]25]nik.rust@xxxxxxxxx
� � 9.
[26][23]http://www.restfulwebservices.net/wcf/CurrencyService.svc
� 10.
[27][24]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
� 11. [28][25]http://www.scottklement.com/mailman/listinfo/ftpapi
--------------------------------------------------------------------
---
This is the FTPAPI mailing list.� To unsubscribe, please go to:
[29][26]http://www.scottklement.com/mailman/listinfo/ftpapi
--------------------------------------------------------------------
---
References
1. [27]http://AON.COM/
2. [28]http://www.restfulwebservices.net/
3. [29]http://schemas.xmlsoap.org/soap/envellope/
4. [30]http://www.restfulwebservices.net/ServiceContracts/2008/01
5. [31]http://ASP.NET/
6. [32]mailto:charles.wilt@xxxxxxxxx
7. [33]http://schemas.xmlsoap.org/soap/envelope/
8. [34]http://www.restfulwebservices.net/ServiceContracts/2008/01
9. [35]http://schemas.xmlsoap.org/soap/envelope/
10. [36]http://www.restfulwebservices.net/ServiceContracts/2008/01
11. [37]http://www.restfulwebservices.net/DataContracts/2008/01
12. [38]http://www.w3.org/2001/XMLSchema-instance
13. [39]http://www.scottklement.com/presentations/#HTTPAPI
14. [40]mailto:nik.rust@xxxxxxxxx
15. [41]http://www.restfulwebservices.net/wcf/CurrencyService.svc
16. [42]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
17. [43]http://www.scottklement.com/mailman/listinfo/ftpapi
18. [44]http://schemas.xmlsoap.org/soap/envelope/
19. [45]http://www.restfulwebservices.net/ServiceContracts/2008/01
20. [46]http://schemas.xmlsoap.org/soap/envelope/
21. [47]http://www.restfulwebservices.net/ServiceContracts/2008/01
22. [48]http://www.restfulwebservices.net/DataContracts/2008/01
23. [49]http://www.w3.org/2001/XMLSchema-instance
24. [50]http://www.scottklement.com/presentations/#HTTPAPI
25. [51]mailto:nik.rust@xxxxxxxxx
26. [52]http://www.restfulwebservices.net/wcf/CurrencyService.svc
27. [53]http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
28. [54]http://www.scottklement.com/mailman/listinfo/ftpapi
29. [55]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[56]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. http://schemas.xmlsoap.org/soap/envellope/
2. http://www.restfulwebservices.net/ServiceContracts/2008
3. mailto:[6]charles.wilt@xxxxxxxxx
4. http://schemas.xmlsoap.org/soap/envelope/
5. http://www.restfulwebservices.net/ServiceContracts
6. http://schemas.xmlsoap.org/soap/envelope/
7. http://www.restfulwebservices.net/ServiceContracts/2
8. http://www.restfulwebservices.net/DataContracts/20
9. http://www.w3.org/2001/XMLSchema-instance
10. http://www.scottklement.com/presentations/#HTTPAPI
11. mailto:[8][14]nik.rust@xxxxxxxxx
12. http://www.restfulwebservices.net/wcf/CurrencyService.svc
13. http://www.restfulwebservices.net/wcf/CurrencyService.svc
14. http://www.scottklement.com/mailman/listinfo/ftpapi
15. http://schemas.xmlsoap.org/soap/envelope/
16. http://www.restfulwebservices.net/ServiceContracts/2008/01
17. http://schemas.xmlsoap.org/soap/envelope/
18. http://www.restfulwebservices.net/ServiceContracts/2008/01
19. http://www.restfulwebservices.net/DataContracts/2008/01
20. http://www.w3.org/2001/XMLSchema-instance
21. http://www.scottklement.com/presentations/#HTTPAPI
22. mailto:25]nik.rust@xxxxxxxxx
23. http://www.restfulwebservices.net/wcf/CurrencyService.svc
24. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
25. http://www.scottklement.com/mailman/listinfo/ftpapi
26. http://www.scottklement.com/mailman/listinfo/ftpapi
27. http://AON.COM/
28. http://www.restfulwebservices.net/
29. http://schemas.xmlsoap.org/soap/envellope/
30. http://www.restfulwebservices.net/ServiceContracts/2008/01
31. http://ASP.NET/
32. mailto:charles.wilt@xxxxxxxxx
33. http://schemas.xmlsoap.org/soap/envelope/
34. http://www.restfulwebservices.net/ServiceContracts/2008/01
35. http://schemas.xmlsoap.org/soap/envelope/
36. http://www.restfulwebservices.net/ServiceContracts/2008/01
37. http://www.restfulwebservices.net/DataContracts/2008/01
38. http://www.w3.org/2001/XMLSchema-instance
39. http://www.scottklement.com/presentations/#HTTPAPI
40. mailto:nik.rust@xxxxxxxxx
41. http://www.restfulwebservices.net/wcf/CurrencyService.svc
42. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
43. http://www.scottklement.com/mailman/listinfo/ftpapi
44. http://schemas.xmlsoap.org/soap/envelope/
45. http://www.restfulwebservices.net/ServiceContracts/2008/01
46. http://schemas.xmlsoap.org/soap/envelope/
47. http://www.restfulwebservices.net/ServiceContracts/2008/01
48. http://www.restfulwebservices.net/DataContracts/2008/01
49. http://www.w3.org/2001/XMLSchema-instance
50. http://www.scottklement.com/presentations/#HTTPAPI
51. mailto:nik.rust@xxxxxxxxx
52. http://www.restfulwebservices.net/wcf/CurrencyService.svc
53. http://www.restfulwebservices.net/wcf/CurrencyService.svc?wsdl
54. http://www.scottklement.com/mailman/listinfo/ftpapi
55. http://www.scottklement.com/mailman/listinfo/ftpapi
56. 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
-----------------------------------------------------------------------