创建与ASP.Net 2.0 SOAP请求 [英] Creating a SOAP Request with ASP.Net 2.0

查看:158
本文介绍了创建与ASP.Net 2.0 SOAP请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我说在服务器网站谁希望我使用Visual Studio,而我只是想手工编写脚本是一个技术接触。见下面的SOAP请求我需要生成。 (我已经更换了一个虚构的实际的URL)。我是pretty新ASP和SOAP您可能已经猜到,我曾尝试谷歌一个示例脚本。

  POST /PropertySearchService.asmx HTTP / 1.1
主持人:portal.someurl.com
内容类型:应用程序/肥皂+ xml的;字符集= UTF-8
内容长度:长度
< XML版本=1.0编码=UTF-8&GT?;
< SOAP12:信封的xmlns:XSI =htt​​p://www.w3.org/2001/XMLSchema-instance的xmlns:XSD =htt​​p://www.w3.org/2001/XMLSchema中的xmlns:SOAP12 = http://www.w3.org/2003/05/soap-envelope\">
  < SOAP12:身体与GT;
    < GetBranches的xmlns =htt​​p://portal.someurl.com>
      < strClientID>串LT; / strClientID>
    < / GetBranches>
  < / SOAP12:身体与GT;
< / SOAP12:信封>


解决方案

  

我说一个技术接触的
  谁希望我的网站服务器
  可以使用Visual Studio,而我只是
  要手工编写脚本


您应该克服这一点。你不经典ASP在这里工作。

不要google一下。你不会找到发送SOAP消息中的任何很好的例子,因为所有的好例子让.NET建立消息他们。使用添加Web引用,并指定您的联系可能是想给你的网址。它会产生一个代理类,你可以调用。

请参阅如何消费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. 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>

解决方案

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.

这篇关于创建与ASP.Net 2.0 SOAP请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆