使用 ASP.Net 2.0 创建 SOAP 请求

发布于 2024-07-27 05:25:23 字数 751 浏览 1 评论 0原文

我正在与服务器网站的技术联系人交谈,他希望我使用 Visual Studio,而我只想手写脚本。 请参阅下文了解我需要生成的 SOAP 请求。 (我已将实际 URL 替换为虚拟 URL)。 正如您可能猜到的那样,我对 ASP 和 SOAP 还很陌生,并且我尝试在 Google 上搜索示例脚本。

POST /PropertySearchService.asmx HTTP/1.1
Host: portal.someurl.com
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>
    <GetBranches xmlns="http://portal.someurl.com">
      <strClientID>string</strClientID>
    </GetBranches>
  </soap12:Body>
</soap12:Envelope>

I am talking to a technical contact at the Server Website who expects me to be using Visual Studio while I just want to hand write script. See below for the SOAP request I need to generate. (I have replaced the actual URL with a dummy one) . I am pretty new to ASP and SOAP as you might guess and I have tried to Google an example script.

POST /PropertySearchService.asmx HTTP/1.1
Host: portal.someurl.com
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>
    <GetBranches xmlns="http://portal.someurl.com">
      <strClientID>string</strClientID>
    </GetBranches>
  </soap12:Body>
</soap12:Envelope>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦与时光遇 2024-08-03 05:25:23

我正在与技术联系人交谈
希望我的服务器网站
正在使用 Visual Studio,而我只是
想手写脚本

你应该克服这个问题。 您在这里不使用经典 ASP。

不要用谷歌搜索它。 您不会找到任何发送 SOAP 消息的好的示例,因为所有好的示例都让 .NET 为它们构建消息。 使用“添加 Web 引用”并指定您的联系人可能试图向您提供的 URL。 它将生成一个您可以调用的代理类。

请参阅如何使用 Web 服务。 这并不 100% 与您的情况相似,但足够接近,可以让您了解执行这些操作的正确方法。

I am talking to a technical contact at
the Server Website who expects me to
be using Visual Studio while I just
want to hand write script

You should get over that. You're not working with Classic ASP here.

Don't Google it. You won't find any good examples of sending SOAP messages because all the good examples let .NET build the message for them. Use "Add Web Reference" and specify the URL that your contact is probably trying to give you. It will produce a proxy class that you can call.

See How to Consume a Web Service. It's not 100% like your case, but it's close enough to give you an idea of the right way to do these things.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文