如何通过 HTTP 和 HTTPS 协议发送 xml 文件并获取结果
我想通过 HTTP 发送带有用户 ID 和密码的 xml 文件,然后使用 POST 方法在 HTTP 上发送所有其他 xml 文件,并以 xml 文件形式获取响应。在 ASP.NET 中(首选 vb.net)
我想要将 xml 文件发送到的 url 是:http://www.hostelspoint.com/xml/xml.php 执行 xml 文件模式是:
<?xml version="1.0" encoding="UTF-8"?>
<OTA_PingRQ xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05OTA_PingRQ.xsd"
TimeStamp="2003-03-17T11:09:47-05:00"
Target="Production" Version="1.001" PrimaryLangID="en"
EchoToken="testtoken12">
<EchoData>Hello</EchoData>
</OTA_PingRQ>
i want to send xml file with userid and password over HTTPs and then send all other xml file on HTTP using POST method and get the response as a xml file back. in ASP.NET (with vb.net preferred)
The url to which i want to send my xml file is:http://www.hostelspoint.com/xml/xml.php
exect xml file pettern is:
<?xml version="1.0" encoding="UTF-8"?>
<OTA_PingRQ xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05OTA_PingRQ.xsd"
TimeStamp="2003-03-17T11:09:47-05:00"
Target="Production" Version="1.001" PrimaryLangID="en"
EchoToken="testtoken12">
<EchoData>Hello</EchoData>
</OTA_PingRQ>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该查看 WCF REST 入门工具包,并观看 HTTP 纯 XML (POX) 服务 逐步解释了如何做到这一点 - 创建一个将接受和处理纯 XML 流的 WCF REST 服务。
强烈推荐 Pluralsight 的所有 WCF 和 WCF REST 截屏视频!这是关于如何开始和使用 WCF 的优秀材料。
除此之外,如果您有任何问题或了解更多信息,MSDN WCF 开发人员中心是您的第一联系点关于 WCF 和 WCF REST。
You should check out the WCF REST Starter Kit, and watch the screencast on HTTP Plain XML (POX) Services which explains step by step how to do just that - create a WCF REST service that will accept and process a plain XML stream.
All the WCF and WCF REST screencasts by Pluralsight are highly recommended! It's excellent material on how to get started and work with WCF.
In addition to that, the MSDN WCF Developer Center is your first point of contact for any questions or more information on WCF and WCF REST.
我不知道为什么你从这里删除了正确答案,但昨天我在这里得到了正确答案。它是:-(谁能告诉我如何使用 HTTPS 协议做同样的事情?)
i don't know why u removed correct answer from here but yesterday i got correct answer here. and it is:- (can any one tell me how to do same with HTTPS protocol?)
是的,您可以使用 HTTPS 协议做同样的事情。您必须在请求之前添加此代码:
Yes, you can do same thing using HTTPS protocol. You have to add this code before request: