![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, i wrote this simple Procedure to consume a WebService. When I call it it throws an Error 415 because of an unexpected charset (see Log below) How must I change the procedure to set the charset to utf-8? If I create a new database with utf-8 collation the procedure works fine. ALTER PROCEDURE "entwickler"."StringReverser.ReverseString"( value long varchar ) url 'http://localhost:8000/Reverse' type 'SOAP OC' set'SOAP(OP=ReverseString)' header 'SOAPAction:"http://tempuri.org/IStringReverser/ReverseString"' namespace 'http://tempuri.org/' ?xml version="1.0"? SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://tempuri.org/" SOAP-ENV:Body m:ReverseString m:value>test</m:value /m:ReverseString /SOAP-ENV:Body /SOAP-ENV:Envelope [connid = 14, 02.09 10:00:51.178, RESPONSE] HTTP/1.1 415 Cannot process the message because the content type 'text/xml; charset=ISO-8859-15' was not the expected type 'text/xml; charset=utf-8'. Keep-Alive: true Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 Date: Thu, 02 Sep 2010 08:00:51 GMT Connection: close Thanks |
#3
| |||
| |||
|
|
This sounds like it could be something as simple as adding HEADER Accept-Charset=utf8 after your type 'SOAP OC'http://dcx.sybase.com/index.html#110....html*d5e32090 http://dcx.sybase.com/index.html#110...ders-http.html http://www.w3.org/Protocols/rfc2616/...4.html#sec14.2 "Arndt" <elke-arndt (AT) web (DOT) de> wrote in message news:4c7f5cfb$1 (AT) forums-1-dub (DOT) .. Hi, i wrote this simple Procedure to consume a WebService. When I call it it throws an Error 415 because of an unexpected charset (see Log below) How must I change the procedure to set the charset to utf-8? If I create a new database with utf-8 collation the procedure works fine. ALTER PROCEDURE "entwickler"."StringReverser.ReverseString"( value long varchar ) url 'http://localhost:8000/Reverse' type 'SOAP OC' set'SOAP(OP=ReverseString)' header 'SOAPAction:"http://tempuri.org/IStringReverser/ReverseString"' namespace 'http://tempuri.org/' ?xml version="1.0"? SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://tempuri.org/" SOAP-ENV:Body m:ReverseString m:value>test</m:value /m:ReverseString /SOAP-ENV:Body /SOAP-ENV:Envelope [connid = 14, 02.09 10:00:51.178, RESPONSE] HTTP/1.1 415 Cannot process the message because the content type 'text/xml; charset=ISO-8859-15' was not the expected type 'text/xml; charset=utf-8'. Keep-Alive: true Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 Date: Thu, 02 Sep 2010 08:00:51 GMT Connection: close Thanks Thanks Nick, |
OC' set
#4
| |||
| |||
|
|
Am 02.09.2010 23:17, schrieb Nick Elson [Sybase An SAP Company]: This sounds like it could be something as simple as adding HEADER Accept-Charset=utf8 after your type 'SOAP OC'http://dcx.sybase.com/index.html#110....html*d5e32090 http://dcx.sybase.com/index.html#110...ders-http.html http://www.w3.org/Protocols/rfc2616/...4.html#sec14.2 "Arndt" <elke-arndt (AT) web (DOT) de> wrote in message news:4c7f5cfb$1 (AT) forums-1-dub (DOT) .. Hi, i wrote this simple Procedure to consume a WebService. When I call it it throws an Error 415 because of an unexpected charset (see Log below) How must I change the procedure to set the charset to utf-8? If I create a new database with utf-8 collation the procedure works fine. ALTER PROCEDURE "entwickler"."StringReverser.ReverseString"( value long varchar ) url 'http://localhost:8000/Reverse' type 'SOAP OC' set'SOAP(OP=ReverseString)' header 'SOAPAction:"http://tempuri.org/IStringReverser/ReverseString"' namespace 'http://tempuri.org/' ?xml version="1.0"? SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://tempuri.org/" SOAP-ENV:Body m:ReverseString m:value>test</m:value /m:ReverseString /SOAP-ENV:Body /SOAP-ENV:Envelope [connid = 14, 02.09 10:00:51.178, RESPONSE] HTTP/1.1 415 Cannot process the message because the content type 'text/xml; charset=ISO-8859-15' was not the expected type 'text/xml; charset=utf-8'. Keep-Alive: true Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 Date: Thu, 02 Sep 2010 08:00:51 GMT Connection: close Thanks Thanks Nick, but I don't get it to work. Your links are very informatively. I think the right syntax has to be: ALTER PROCEDURE "entwickler"."StringReverser.ReverseString"( value long varchar ) url 'http://localhost:8000/Reverse' type 'SOAP OC' set'SOAP(OP=ReverseString)' header 'Accept-Charset:utf-8\nSOAPAction:"http://tempuri.org/IStringReverser/ReverseString"' namespace 'http://tempuri.org/' I tried several others, but the Error is still the same. |
#5
| |||
| |||
|
|
It seems you will want to investigate the use of sa_set_http_option( ) for this. In my rush I rejected that thinking it would only be of use for HTTP responses but according to the docs the Accept-Charset request header can also be set using this (that and the very next paragraph describes the behaviour you are currently seeing as well). http://dcx.sybase.com/index.html#110...p-option1.html Hope that helps. "Arndt" <elke-arndt (AT) web (DOT) de> wrote Am 02.09.2010 23:17, schrieb Nick Elson [Sybase An SAP Company]: This sounds like it could be something as simple as adding HEADER Accept-Charset=utf8 after your type 'SOAP OC'http://dcx.sybase.com/index.html#110....html*d5e32090 http://dcx.sybase.com/index.html#110...ders-http.html http://www.w3.org/Protocols/rfc2616/...4.html#sec14.2 "Arndt" <elke-arndt (AT) web (DOT) de> wrote in message news:4c7f5cfb$1 (AT) forums-1-dub (DOT) .. Hi, i wrote this simple Procedure to consume a WebService. When I call it it throws an Error 415 because of an unexpected charset (see Log below) How must I change the procedure to set the charset to utf-8? If I create a new database with utf-8 collation the procedure works fine. ALTER PROCEDURE "entwickler"."StringReverser.ReverseString"( value long varchar ) url 'http://localhost:8000/Reverse' type 'SOAP OC' set'SOAP(OP=ReverseString)' header 'SOAPAction:"http://tempuri.org/IStringReverser/ReverseString"' namespace 'http://tempuri.org/' ?xml version="1.0"? SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://tempuri.org/" SOAP-ENV:Body m:ReverseString m:value>test</m:value /m:ReverseString /SOAP-ENV:Body /SOAP-ENV:Envelope [connid = 14, 02.09 10:00:51.178, RESPONSE] HTTP/1.1 415 Cannot process the message because the content type 'text/xml; charset=ISO-8859-15' was not the expected type 'text/xml; charset=utf-8'. Keep-Alive: true Content-Length: 0 Server: Microsoft-HTTPAPI/2.0 Date: Thu, 02 Sep 2010 08:00:51 GMT Connection: close Thanks Thanks Nick, but I don't get it to work. Your links are very informatively. I think the right syntax has to be: ALTER PROCEDURE "entwickler"."StringReverser.ReverseString"( value long varchar ) url 'http://localhost:8000/Reverse' type 'SOAP OC' set'SOAP(OP=ReverseString)' header 'Accept-Charset:utf-8\nSOAPAction:"http://tempuri.org/IStringReverser/ReverseString"' namespace 'http://tempuri.org/' I tried several others, but the Error is still the same. Hi Nick, |
![]() |
| Thread Tools | |
| Display Modes | |
| |