You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Daniel Kasmeroglu <Da...@Kasisoft.net> on 2007/03/07 02:07:29 UTC
A matter of understanding
Hi there,
I've got an issue and I've got a workaround for this. I simply want to understand what's wrong.
My project provides a simple service which allows to return an attribute within a XML file. This
is the way the API is looking:
String getAttribute( String xmldoc );
It is also specified that the input and the output of this function MUST be UTF-8 encoded. My
problem occures when it comes to using this service with PHP. When I'm using the Axis2 Client
I can pull in my XML document in UTF-8 and retrieve the attribute value as UTF-8 encoded (as expecteD).
But when I'm using PHP (5.2) the service gets a decoded String (in effect non UTF-8) so the XML
parser claims an invalid UTF-8 byte sequence since the encoding for the parsing process is still
specified in the document.
I can workaround this when I'm using PHP by simply encoding the document a second time and decoding
the result.
What I don't understand is: WHY ?
Why is it necessary to encode the message (which already comes in UTF-8) a second time before I'm
invoking the SOAP request using PHP.
I would appreciate if anyone could give me an answer on this issue ?
The people I'm discussing about this issue do claim that PHP behaves perfectly correct and since I'm
no SOAP expert I'm not sure whether they're right or not. But at least I want to understand this
behaviour.
A corresponding project (with additional infos) can be downloaded at:
http://www.kasisoft.net/getattr.zip (something about 50k).
Thanks for the help.
Ciao
Kasimir
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: A matter of understanding
Posted by Thilina Gunarathne <cs...@gmail.com>.
> But when I'm using PHP (5.2) the service gets a decoded String (in effect non UTF-8) so >the XML parser claims an invalid UTF-8 byte sequence since the encoding for the parsing >process is still specified in the document.
Can you please explain the above part a bit.. Which XML parser (Axis2
or the PHP one).. Also is this happening when your are receiving the
response..
Just trying to understand what's going wrong..
Also the request/response message snapshots would be a great addition
for our understanding.. You can use tcpmon
(http://ws.apache.org/tcpmon) to capture the messages..
Thanks,
Thilina
> I can workaround this when I'm using PHP by simply encoding the document a second time and decoding
> the result.
>
> What I don't understand is: WHY ?
>
> Why is it necessary to encode the message (which already comes in UTF-8) a second time before I'm
> invoking the SOAP request using PHP.
> I would appreciate if anyone could give me an answer on this issue ?
> The people I'm discussing about this issue do claim that PHP behaves perfectly correct and since I'm
> no SOAP expert I'm not sure whether they're right or not. But at least I want to understand this
> behaviour.
> A corresponding project (with additional infos) can be downloaded at:
>
> http://www.kasisoft.net/getattr.zip (something about 50k).
>
> Thanks for the help.
>
> Ciao
> Kasimir
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org