如何查看调用WebService时发送的报文,,急!!!!!!!!!!!!!! 如何查看调用WebService时发送的报文,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有个软件叫 httpWatch Professional 可以监测浏览器的发送和接收的信息 你如果需要我发个使用教程给你 很简单 你用浏览器看下 asmx, 里头列出了每个函数的发送报文格式,根据那个格式自己构造报文, 用 telnet 也行, putty 也行, 发送到服务器,就能看到完整的服务器响应咬!以这个为例: [ WebMethod] public string Time() { return Context.Timestamp.TimeOfDay.ToString(); }我用浏览器查看http://localhost:8080/hello.asmx?op=Time其中 soap2 格式请求格式为:POST /hello.asmx HTTP/1.1Host: localhostContent-Type: application/soap+xml; charset=utf-8Content-Length: length<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <Time xmlns="http://tempuri.org/" /> </soap12:Body></soap12:Envelope>注意上面有个文字需要修改, 就是那个 Content-Length: length那个长度是 http body 的长度, 我将上面的文字复制入 UltraEdit, 选中 <?xml 到结束的 Envelope> 得知字节数为 308于是, 我们的请求 (http request header + request body )就变为POST /hello.asmx HTTP/1.1Host: localhostContent-Type: application/soap+xml; charset=utf-8Content-Length: 308<?xml version="1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <Time xmlns="http://tempuri.org/" /> </soap12:Body></soap12:Envelope>于是, 我用 putty 连接到 web server: 这时, putty 连接上等待我输入东西, 将上面的文字全部复制, 粘贴入 putty:回车:调用成功了, putty 窗口中显示结果了(为了便于查看, 我把xml 加换行空格了):HTTP/1.1 200 OKServer: Cassini/2.0.60306.0Date: Mon, 25 May 2009 09:06:30 GMTX-AspNet-Version: 2.0.50727Cache-Control: private, max-age=0Content-Type: application/soap+xml; charset=utf-8Content-Length: 334Connection: Close<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body> <TimeResponse xmlns="http://tempuri.org/"> <TimeResult>17:06:29</TimeResult></TimeResponse> </soap:Body></soap:Envelope>怎么样, 直观吧 为了图方便, 我省略的参数, 不过有参数的 webmethod , 也是如此炮制即可.那个 putty 要用 raw 模式, 同时 close window on exit 要设为 never , 否则, 一收到响应就 '啪' 的关闭了. asp.net控件listbox事件SelectedIndexChanged的问题 如何在a.aspx.cs里面行一次b.aspx的page_load方法。但不跳转到b.aspx页面? 域名的正则表达式 征求一下意见 这种界面是用什么控件做出来的?? 为什么用update修改.dbf表就好使呢??????? 求:一次下载多个Execl文件的例子 求助ooa面向对象概要设计和详细设计模板 下面的代码中,为什么加了一个文件夹目录就显示不了图片了,就路径错误了,要怎么写才可以正常显示,请帮忙 一个头痛的问题! 格式化文本框 又来送分啦 简单问题
根据那个格式自己构造报文,
用 telnet 也行, putty 也行, 发送到服务器,就能看到完整的服务器响应咬!以这个为例: [ WebMethod]
public string Time() {
return Context.Timestamp.TimeOfDay.ToString();
}
我用浏览器查看
http://localhost:8080/hello.asmx?op=Time其中 soap2 格式请求格式为:POST /hello.asmx HTTP/1.1
Host: localhost
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Time xmlns="http://tempuri.org/" />
</soap12:Body>
</soap12:Envelope>
注意上面有个文字需要修改, 就是那个 Content-Length: length
那个长度是 http body 的长度, 我将上面的文字复制入 UltraEdit, 选中 <?xml 到结束的 Envelope> 得知字节数为 308
于是, 我们的请求 (http request header + request body )就变为
POST /hello.asmx HTTP/1.1
Host: localhost
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 308<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Time xmlns="http://tempuri.org/" />
</soap12:Body>
</soap12:Envelope>
于是, 我用 putty 连接到 web server:
这时, putty 连接上等待我输入东西, 将上面的文字全部复制, 粘贴入 putty:回车:
调用成功了, putty 窗口中显示结果了(为了便于查看, 我把xml 加换行空格了):HTTP/1.1 200 OK
Server: Cassini/2.0.60306.0
Date: Mon, 25 May 2009 09:06:30 GMT
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 334
Connection: Close<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<TimeResponse xmlns="http://tempuri.org/">
<TimeResult>17:06:29</TimeResult></TimeResponse>
</soap:Body>
</soap:Envelope>怎么样, 直观吧