webservice soap over http调用问题:怎么传递中文参数?
无论我用urlencode处理与否,几乎都存在中文参数无法传递的问题。
(备注:为什么说几乎呢,是因为比如“你好”之类的中文参数居然OK,莫名其妙)
调用URL如下:
http://.../services/MyService?method=update&person=张三李四
或者使用了URLEncode了之后的参数进行传递:
http://.../services/MyService?method=update&person=%D2%FC%B0%D8%C8%AA
都不行,输出如下:
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.</faultstring>
- <detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">nci-phhnx8ls5m1</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>