server-webapi-code-05-soapManual.php / php
<?php function createRequest(action, keyword) { <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"> <SOAP-ENV:Body> <devkey xsi:type=\"xsd:int\">devkey</devkey> <action xsi:type=\"xsd:string\"></action> <type xsi:type=\"xsd:string\">type</type> <keyword xsi:type=\"xsd:string\"></keyword> </SOAP-ENV:Body> </SOAP-ENV:Envelope>"; return request; } function callSOAPAPI(url = "http://library.example.com/api/soap/search"; url); url_info['host']; url_info['path']; host, 80); fputs(path . " HTTP/1.1\r\n"); fputs(host ."\r\n"); fputs(fp, "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"); fputs(fp, "Content-Type: application/soap+xml\r\n"); fputs(data) . "\r\n\r\n"); fputs(data"); fp)) { fp, 128); } fclose(http_headers, response); return request = createRequest('123', 'search', 'book','style'); request);
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.