开发者

Using PHP soap service with Delphi without WSDL?

I'm quite familiar with using web services in Delphi when I have a WSDL. I simply use the wizard and in a few secs I'm up and running.

I now have a challenge where I'm given a soap interface written in PHP, without any WSDL schema.

The sample given to me for PHP is:

<?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>";
?>

I've tried just post-ing the xml to the url, but I get a soap error back about a function that does not exist.

Any ideas??


For very simple SOAP web services, it could be easier to follow existing examples / documentation or (if neither is good enough) record the interaction using a HTTP proxy (fiddler2), and then code the communciation using a XML library of your choice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜