码迷,mamicode.com
首页 > Web开发 > 详细

PHP SOAP 发送XML

时间:2018-04-19 17:41:38      阅读:516      评论:0      收藏:0      [点我收藏+]

标签:必须   wsdl   form   body   www   client   blog   pre   env   

<?php
$xmldata = <<<EOT
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
 <MOLECULES FORMAT="smi">
     <MOLECULE>C1CCCCC1</MOLECULE>
</MOLECULES>
</soapenv:Body>
</soapenv:Envelope>
EOT;
$wsdl = ‘http://www.vcclab.org/web/services/ALOGPS?wsdl‘;
try{
    $client = new SoapClient($wsdl);
    $result = $client->__doRequest($xmldata,$wsdl,‘getAlogpsResults‘,1,0);//发送xml必须使用__doRequest
    print_r($result);
}catch (SoapFault $e){
    echo $e->getMessage();
}catch(Exception $e){
    echo $e->getMessage();
}

  

转载:http://blog.51cto.com/liuzan/1683947

PHP SOAP 发送XML

标签:必须   wsdl   form   body   www   client   blog   pre   env   

原文地址:https://www.cnblogs.com/qhorse/p/8884538.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!