SoapServer ISO-8859-1 encoding doesn't seem to work

View: New views
3 Messages — Rating Filter:   Alert me  

SoapServer ISO-8859-1 encoding doesn't seem to work

by Bruce Bailey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi

I'm using php 5.2.3 (also tested on php 5.2.9).  For some reason, even though I am setting the reply encoding:

ini_set("soap.wsdl_cache_enabled", "0"); // disable WSDL caching

$server = new SoapServer("test.wsdl", array('encoding'=>'ISO-8859-1'));
$server->setClass("ManualService");
$server->handle();

The reply from the server is:

Date: Wed, 27 May 2009 15:30:08 GMT
Server: Apache/1.3.37 (Unix) mod_gzip/1.3.26.1a PHP/5.2.9
X-Powered-By: PHP/5.2.9
Content-Length: 1058
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8


<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<SOAP-ENV:Envelope   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                     xmlns:ns1="http://www.test.com/test/"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <SOAP-ENV:Body>
    <ns1:SyUserGetResponse>
      <UserGetResponse>

         -- trimmed and formatted for readability --

      </UserGetResponse>
    </ns1:SyUserGetResponse>
  </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

What am I doing wrong?

Thanks in advance,

Bruce


_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009

Re: SoapServer ISO-8859-1 encoding doesn't seem to work

by Richard Quadling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/5/27 Bruce Bailey <bruce1828@...>:

>
> Hi
>
> I'm using php 5.2.3 (also tested on php 5.2.9).  For some reason, even though I am setting the reply encoding:
>
> ini_set("soap.wsdl_cache_enabled", "0"); // disable WSDL caching
>
> $server = new SoapServer("test.wsdl", array('encoding'=>'ISO-8859-1'));
> $server->setClass("ManualService");
> $server->handle();
>
> The reply from the server is:
>
> Date: Wed, 27 May 2009 15:30:08 GMT
> Server: Apache/1.3.37 (Unix) mod_gzip/1.3.26.1a PHP/5.2.9
> X-Powered-By: PHP/5.2.9
> Content-Length: 1058
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: text/xml; charset=utf-8
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
> <SOAP-ENV:Envelope   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>                     xmlns:ns1="http://www.test.com/test/"
>                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>  <SOAP-ENV:Body>
>    <ns1:SyUserGetResponse>
>      <UserGetResponse>
>
>         -- trimmed and formatted for readability --
>
>      </UserGetResponse>
>    </ns1:SyUserGetResponse>
>  </SOAP-ENV:Body>
>
> </SOAP-ENV:Envelope>
>
> What am I doing wrong?
>
> Thanks in advance,
>
> Bruce
>
>
> _________________________________________________________________
> Hotmail® has ever-growing storage! Don’t worry about storage limits.
> http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009


The documentation says "... internal character encoding (encoding), ...".

This suggests that this is NOT the encoding used externally.

What happens to data which is NOT ISO-8859-1?

Does it go through cleanly?

Is there a reason why you are not using UTF-8?

--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: SoapServer ISO-8859-1 encoding doesn't seem to work

by Bruce Bailey :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Richard

Thanks for the reply.  The primary reason I'd like to use ISO-8859-1 is to save the overhead of scanning and replacing ASCII characters (in the range of 128-255, 0x080-0x0ff) that is required in UTF-8 encoding.

Since there is some percent of my data that will contain these characters, my thought is that performance would be a bit better and my code a bit simpler.

More than anything else, this is for convenience.


Bruce

> From: rquadling@...
> Date: Thu, 28 May 2009 10:02:19 +0100
> To: bruce1828@...
> CC: soap@...
> Subject: Re: [SOAP] SoapServer ISO-8859-1 encoding doesn't seem to work
>
> 2009/5/27 Bruce Bailey <bruce1828@...>:
> >
> > Hi
> >
> > I'm using php 5.2.3 (also tested on php 5.2.9).  For some reason, even though I am setting the reply encoding:
> >
> > ini_set("soap.wsdl_cache_enabled", "0"); // disable WSDL caching
> >
> > $server = new SoapServer("test.wsdl", array('encoding'=>'ISO-8859-1'));
> > $server->setClass("ManualService");
> > $server->handle();
> >
> > The reply from the server is:
> >
> > Date: Wed, 27 May 2009 15:30:08 GMT
> > Server: Apache/1.3.37 (Unix) mod_gzip/1.3.26.1a PHP/5.2.9
> > X-Powered-By: PHP/5.2.9
> > Content-Length: 1058
> > Keep-Alive: timeout=15, max=100
> > Connection: Keep-Alive
> > Content-Type: text/xml; charset=utf-8
> >
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
> > <SOAP-ENV:Envelope   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> >                     xmlns:ns1="http://www.test.com/test/"
> >                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >
> >  <SOAP-ENV:Body>
> >    <ns1:SyUserGetResponse>
> >      <UserGetResponse>
> >
> >         -- trimmed and formatted for readability --
> >
> >      </UserGetResponse>
> >    </ns1:SyUserGetResponse>
> >  </SOAP-ENV:Body>
> >
> > </SOAP-ENV:Envelope>
> >
> > What am I doing wrong?
> >
> > Thanks in advance,
> >
> > Bruce
> >
> >
> > _________________________________________________________________
> > Hotmail® has ever-growing storage! Don’t worry about storage limits.
> > http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009
>
>
> The documentation says "... internal character encoding (encoding), ...".
>
> This suggests that this is NOT the encoding used externally.
>
> What happens to data which is NOT ISO-8859-1?
>
> Does it go through cleanly?
>
> Is there a reason why you are not using UTF-8?
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009