[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:
� � � H DFTACTGRP(*NO) ACTGRP(*new) BNDDIR('HTTPAPI'
)
� � � W*E CRTBNDRPG � get_cities � sr
cfile(*libl/qrpglesrc)
� � � W*E+ � � � DBGVIEW(*SO
URCE)
� � � W*E+ � � � REPLACE(*YE
S)
� � � E*W
� � � /copy HTTPAPI_H
� � � d VARYINGDATAOFFSET...
� � � d � � � � A
533; � � � c � � � � &#
65533; � � � � �
const(2)
� � � d SOAP � � � �
� � s � � � � � 1024a &#
65533; � varying
� � � d rc � � � � &
#65533; � � s � � � � �
� 10i 0
� � � d c_COUNTRY � � � s &#
65533; � � � � � 20a � �
varying
� � � /free
� � � � c_COUNTRY = 'Italy';
� � � � SOAP = '<soap:Envelope'
� � � � � � � + '
xmlns:soap="[4][8]http://www.w3.org/2003/05/soap-envelope'
� � � � � � � + ' xm
lns:web="[5][9]http://www.webserviceX.NET">'
� � � � � � � + ' <s
oap:Header/>'
� � � � � � � + ' &#
65533; <soap:Body>'
� � � � � � � + ' &#
65533; � � <web:GetCitiesByCountry>'
� � � � � � � + ' &#
65533; � � � � <web:CountryName>' + c_Country
� � � � � � � + ' <w
eb:CountryName>'
� � � � � � � + ' &#
65533; � � </web:GetCitiesByCountry>'
� � � � � � � + ' &#
65533; </soap:Body>'
� � � � � � � + '</s
oap:Envelope>';
� � � � // http_setCCSIDs(1208 : 0);
� � � � � � http_debug(*ON:'
/jgvtmp/httpapi_debug1.txt');
� � � � � � rc =
http_post('[6][10]http://www.webserviceX.NET/globalweather.asmx'
� � � � � � � ʏ
33; � � � � � � + '/GetCitiesBy
Country'
� � � � � � � ʏ
33; � � � � � � : %addr(SOAP) +
VARYINGDATAOFFSET
� � � � � � � ʏ
33; � � � � � � : %len(SOAP)
� � � � � � � ʏ
33; � � � � � � :
'/jgvtmp/CitiesByCountry.txt'
� � � � � � � ʏ
33; � � � � � � : HTTP_TIMEOUT
� � � � � � � ʏ
33; � � � � � � : HTTP_USERAGEN
T
� � � � � � � ʏ
33; � � � � � � : 'text/xml;
charset=utf-8'
� � � � � � � ʏ
33; � :
'urn."[7][11]http://www.webserviceX.NET/GetCitiesByCountry"');
� � � � � � if (rc <> 1);
� � � � � � � http_c
rash();
� � � � � � endif;
� � � � � � *inlr = *on;
� � � /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 � : 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> � � � <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.
� � 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
What am I doing wrong?
Best regards
Jan
--------------------------------------------------------------------
---
This is the FTPAPI mailing list. � 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
-----------------------------------------------------------------------