php - 在没有 WSDL 的情况下将 PHP Soap 服务与 Delphi 一起使用?

标签 php delphi soap

当我拥有 WSDL 时,我对在 Delphi 中使用 Web 服务非常熟悉。我只需使用向导,几秒钟后我就可以启动并运行。

我现在面临一个挑战,我得到了一个用 PHP 编写的 SOAP 界面,没有任何 WSDL 架构。

给我的 PHP 示例是:

<?php
// The xml to be sent to the webService
$reqest_string = <<<XML
<test_api>
    <request>1</request>
</test_api>
XML;

// create web service client
$client = new WSClient(array("to" => "http://api.infax.co.za/edge_api.php"));

//  send request to the web service
$reply = $client->request($reqest_string);

// display the responce from the webservice
$xml_str = simplexml_load_string($reply->str);

// display response on screen
echo "Came from server = ".$xml_str->response."<br>";
?>

我尝试将 xml 发布到 url,但收到关于不存在的函数的 SOAP 错误。

有什么想法吗?

最佳答案

对于非常简单的 SOAP Web 服务,遵循现有示例/文档或(如果两者都不够好)使用 HTTP 代理 (fiddler2) 记录交互可能会更容易,然后使用您的 XML 库对通信进行编码选择。

关于php - 在没有 WSDL 的情况下将 PHP Soap 服务与 Delphi 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7753660/

相关文章:

php - 优化EXCEL+MySQL处理

c# - 在 Delphi 中使用 C# DLL 只使用第一个函数参数

c# - 创建 SOAP 请求

python - 将 perl soap 应用程序移植到 python

PHP SoapClient 构造函数极慢

php - Jquery (Datatables) 功能没有完全初始化? PHP/MySQL

php - CodeIgniter 中的完全动态 URL

PHP Paypal IPN 处理不起作用

delphi - Delphi 程序终止时向用户显示消息

delphi - 动态数组长度的32位和64位不同类型?