【发布时间】:2013-12-02 17:27:02
【问题描述】:
我正在尝试包装一个较新的 .net ASMX Web 服务,以便它可以被较旧的经典 asp 应用程序使用。为此,我找到了一些发送肥皂请求的代码。但是在我的测试中,似乎我的参数都没有到达服务器。
服务器测试代码
<WebMethod()> _
Public Function Ping1(str As String)
If str <> "" Then
Return str
Else
Return "False"
End If
End Function
正在发送的 xml:
<?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>
<Ping1 xmlns="http://tempuri.org">
<str>asdf</str>
</Ping1>
</soap12:Body>
</soap12:Envelope>
页面不断返回“False”,但据我所知,这应该是发送参数的正确格式。任何帮助,将不胜感激。
【问题讨论】:
-
您是否还设置了正确的标题,如here 所示?如果是这样,请尝试将命名空间从
tempuri.org更改为其他名称。 -
成功了,只是不能使用 tempuri,现在我如何将问题标记为已回答:-/(第一篇)
-
您可以将答案标记为已接受,只是添加了一个。
标签: web-services soap asp-classic parameter-passing asmx