当我拥有 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/