使用涉及枚举的 PHP 调用 Web 服务 (SOAP) [英] Calling web service (SOAP) with PHP involving enums

查看:22
本文介绍了使用涉及枚举的 PHP 调用 Web 服务 (SOAP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用 SOAP 从 PHP 调用 Web 服务(使用包含的 SOAP 扩展).有问题的网络服务是 http://www.webservicex.net/CurrencyConvertor.asmx

I wish to call a web service, using SOAP, from PHP (using the included SOAP extension). The web service in question is http://www.webservicex.net/CurrencyConvertor.asmx

现在货币类型是一个枚举,我无法弄清楚如何在 PHP 中使用它们以便能够调用ConversionRate"函数.我知道我必须用班级地图做一些事情,但我只能找到关于这个主题的有限且无用的信息.任何人都可以帮忙吗?也许是一个工作示例?

Now the Currency type is an enum, and I cannot figure out how to work with these in PHP in order to be able to call the 'ConversionRate' function. I know I have to do something with a class map, but I can only find limited and unhelpful information on this topic. Can anyone help? A working example maybe?

谢谢!!!!

推荐答案

这里的枚举只定义合法的值,也就是说你的数据类型实际上是这些值之一的字符串.

The enum here only defines legitimate values, that is your data type is actually a string of one of those values.

这里有一些伪代码可以帮助您:

Here's some psuedo-code to get you on your way:

$from_currency = "AFA";

$from_currency = "AFA";

$to_current = "ALL";

$to_current = "ALL";

$soap_handler->ConversionRate($from_currency, $to_currency);

$soap_handler->ConversionRate($from_currency, $to_currency);

$exchange_rate = $soap_handler->response();

$exchange_rate = $soap_handler->response();

这篇关于使用涉及枚举的 PHP 调用 Web 服务 (SOAP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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