消费SOAP Web服务 [英] consume SOAP web service

查看:144
本文介绍了消费SOAP Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何消耗这个SOAP的Web服务?如何添加请求头?

How do I consume this SOAP web service? how do I add the request header?

<一个href=\"https://www.eway.com.au/gateway/ManagedPaymentService/test/managedCreditCardPayment.asmx?op=CreateCustomer\">https://www.eway.com.au/gateway/ManagedPaymentService/test/managedCreditCardPayment.asmx?op=CreateCustomer

REF :<一href=\"http://www.eway.com.au/Developer/eway-api/token-payments.aspx\">http://www.eway.com.au/Developer/eway-api/token-payments.aspx

推荐答案

最简单的方法是使用.NET的内置支持。

The easiest way is to use .NET's built-in support.

在Visual Studio中,右键点击你的项目引用和添加服务引用。给它的服务网址<一个href=\"https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx\">https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx它会为你生成一个代理类,将完成所有的工作。然后,您可以只例如。

In Visual Studio, right click on your project references and 'Add Service Reference'. Give it the service URL https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx and it will generate a proxy class for you that will do all the work. You can then just e.g.

var client = new eWayServiceReference.managedCreditCardPaymentSoapClient();
client.CreateCustomer(...);

另外,您可以使用 SvcUtil工具生成从VS命令提示符代理类。

Alternatively you can generate the proxy class from a VS command prompt using svcutil.

这篇关于消费SOAP Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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