繁体   English   中英

在不带WSDL的Delphi中使用PHP soap服务?

[英]Using PHP soap service with Delphi without WSDL?

当我有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 Web服务,可以更容易地遵循现有的示例/文档,或者(如果两种方法都不够好)使用HTTP代理(fiddler2)记录交互,然后使用您选择的XML库编写通信代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM