php4 中的 Web 服务调用

发布于 2024-09-16 22:43:16 字数 487 浏览 8 评论 0原文

我在 php5 中为自己的服务器编写了这段代码,但是当我尝试部署它时,我发现测试和生产服务器是 php4(我的错!)。所以我现在需要谁来转换它以在 php4 中运行它。

以下代码在 php5 上运行正常:

<?php

$wsdl = 'http://blahblah:8081/services/LoginWebService?wsdl';

$client = new SoapClient($wsdl);

$params->username = 'an_user';
$params->password = 'a_pass';

$res = $client->login($params);
// ak auth key
$ak = $res->loginReturn;
echo $ak;
?>

有没有一种简单的方法将其转换为 php4?

注意: 升级服务器不是由我决定的:(

I did this code for my own server in php5, but when I tried to deploy it, I found that the test and production server are php4 (my fault!). So I need to now who to convert this to run it in php4.

The following code works OK on php5:

<?php

$wsdl = 'http://blahblah:8081/services/LoginWebService?wsdl';

$client = new SoapClient($wsdl);

$params->username = 'an_user';
$params->password = 'a_pass';

$res = $client->login($params);
// ak auth key
$ak = $res->loginReturn;
echo $ak;
?>

Is there an easy way to translate it to php4?

NOTE: Is not up to me to decide upgrading the server :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滿滿的愛 2024-09-23 22:43:16

使用NuSOAP

NuSOAP 是 SOAPx4 的重写,由 NuSphere 和 Dietrich Ayala 提供。它是一组 PHP 类(无需 PHP 扩展),允许开发人员创建和使用基于 SOAP 1.1、WSDL 1.1 和 HTTP 1.0/1.1 的 Web 服务。

Use NuSOAP.

NuSOAP is a rewrite of SOAPx4, provided by NuSphere and Dietrich Ayala. It is a set of PHP classes - no PHP extensions required - that allow developers to create and consume web services based on SOAP 1.1, WSDL 1.1 and HTTP 1.0/1.1.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文