使用 SOAP 网络服务 [英] consume SOAP web service

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

问题描述

我如何使用这个 SOAP 网络服务?如何添加请求标头?

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

https://www.eway.com.au/gateway/ManagedPaymentService/test/managedCreditCardPayment.asmx?op=CreateCustomer

REF: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 中,右键单击您的项目引用并添加服务引用".为其提供服务 URL 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.

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

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