如何理解要发送到ASMX Web服务的XML? [英] How to understand what XML to send to an ASMX web service?

查看:104
本文介绍了如何理解要发送到ASMX Web服务的XML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在控制台应用程序中使用一些.asmx服务(稍后我将使用代码制作dll并将其用于其他地方).

I am trying to consume some .asmx service in a console application (I will later use the code to make a dll and use it somewhere else).

但是我不知道Web服务的架构是什么.我只知道该服务的URL,使用浏览器进行导航时会给出一个页面,其中列出了Web服务的功能.单击功能后,我将获得一个页面,页面标题为

But I don't know what the schema of the web service is. I just know the URL of the service which on navigating using the browser gives a page which enlists the functions of the web service. On clicking on a function I get a page with this written under the heading

SOAP 1.1:

SOAP 1.1:

以下是SOAP 1.1请求和响应的示例.显示的占位符需要替换为实际值.

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

然后是一些带有<soap:Envelope><soap:body>等标记的XML.但是我不能使用这些XML ...

And after this there is some XML with tags like <soap:Envelope>, <soap:body> etc. But I can't use those XMLs...

我如何理解仅具有此信息的呼叫所需的XML?

How do I understand the XML required for a call having only this info?

推荐答案

您需要在该页面中查找服务描述"链接.

You need to look for the "Service Description" link in that page.

ASP.NET生成这些页面以允许您测试服务.在页面中,有一个指向Web服务的 WSDL 的链接(通常是带有?wsdl附加在其上.)

ASP.NET generates those pages to allow you to test the service. In the pages there is a link to the WSDL of the web service (normally the endpoint address with ?wsdl appended to it).

WSDL是生成客户端以与Web服务进行交互所需要的全部.将其输入到 svcutil 这样的工具中,您将获得客户端代码并配置

The WSDL is all you need to generate a client to interact with the web service. Feed that to a tool like svcutil and you get back client code and configuration.

这篇关于如何理解要发送到ASMX Web服务的XML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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