Axis产生的输出有奇怪问题

zephyr_zhao 2004-09-11 08:06:35
我的WebService部署在Axis上,产生的响应输出如下:
1a7
<?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>
<AuthenticateResponse xmlns="urn:authentication.soap.sforce.com">
<Authenticated xsi:type="xsd:boolean">true</Authenticated>
</AuthenticateResponse>
</soapenv:Body>
</soapenv:Envelope>
0

前面多了1a7.
我用.NET做客户端,得到的返回值总是false,但没有异常。
不知道和前面的1a7有没有关系。
...全文
112 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zephyr_zhao 2004-09-14
  • 打赏
  • 举报
回复
搞定了,是.NET客户端的问题
和chunk encoding倒没什么关系(MS的Soap Trace Utility太差,不能Decode)
是VS 2003根据wsdl生产的代码不好,有的Attribute的值不对
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="urn:authentication.soap.sforce.com", ResponseElementName="AuthenticateResult", ResponseNamespace="urn:authentication.soap.sforce.com", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("Authenticated")]
public bool Authenticate(string username, string password, string sourceIp, [System.Xml.Serialization.XmlAnyElementAttribute()] System.Xml.XmlElement[] Any) {
。。。

其中ResponseElementName="AuthenticateResult" 应该是 ResponseElementName="AuthenticateResponse"

好像规范应该是<method name>Response
zephyr_zhao 2004-09-14
  • 打赏
  • 举报
回复
那个1a7应该是Http Reply得消息长度

The HTTP specification does not provide a way to guarantee reliable transmission of replies. The HTTP 1.1 specification adds transfer encoding as a way to make it possible to safely transport messages that are sent through HTTP (see RFC 2068). "Chunked" is a type of transfer encoding by which the message body is transmitted to the client as chunks that are stamped with the size of the chunks (see section 14.40 of RFC 2068). With chunked transfer encoding, the client can make sure that it has received all of the data that the server sends.

usabcd 2004-09-13
  • 打赏
  • 举报
回复
正常现象。
HTTP Header中出现Transfer-Encoding: chunked等标头时
就会出现。具体代表的意义不太清楚,要查一下RFC文档。
好像是HTTP1.1的feature
但至少可以肯定,这时正常现象,另一端读不了是它的设置问题。
91大白兔奶糖 2004-09-13
  • 打赏
  • 举报
回复
从来没碰到过。
以前有这种问题吗??
zephyr_zhao 2004-09-11
  • 打赏
  • 举报
回复
Axis高人过来啊

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧