PHP的WSDL客户端问题
我想向WSDL web服务发送以下XML请求:PHP的WSDL客户端问题,php,web-services,soap,wsdl,client,Php,Web Services,Soap,Wsdl,Client,我想向WSDL web服务发送以下XML请求: xxxxx xxxxx “.$timestamp。” “.$expiration。” xxxx 我该怎么做?我尝试了PHP soap扩展,也尝试了NuSOAP,但没有成功:( 谢谢您的帮助。您是否尝试过HttpRequest::send?例如,请参阅中的示例并填写您自己的数据: <?php //set up variables $theData = '<?xml version="1.0" encoding="utf-8"?&g
xxxxx
xxxxx
“.$timestamp。”
“.$expiration。”
xxxx
我该怎么做?我尝试了PHP soap扩展,也尝试了NuSOAP,但没有成功:(
谢谢您的帮助。您是否尝试过HttpRequest::send?例如,请参阅中的示例并填写您自己的数据:
<?php
//set up variables
$theData = '<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-'.$nonce.'">
<wsse:Username>xxxxx</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxx</wsse:Password>
</wsse:UsernameToken>
<wsu:Timestamp wsu:Id="Timestamp-'.$nonce.'" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>'.$timestamp.'</wsu:Created>
<wsu:Expires>'.$expiration.'</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<prep:requestListeSeancesCtrlAcces>
<codeManifestation>xxxx</codeManifestation>
<!--Optional:-->
<debutIntervalle/>
<!--Optional:-->
<finIntervalle/>
</prep:requestListeSeancesCtrlAcces>
</soapenv:Body>
</soap:Envelope>';
$url = 'http://www.example.com';
$options = array();
//create the httprequest object
$httpRequest_OBJ = new httpRequest($url, HTTP_METH_POST, $options);
//add the content type
$httpRequest_OBJ->setContentType = 'Content-Type: text/xml';
//add the raw post data
$httpRequest_OBJ->setRawPostData ($theData);
//send the http request
$result = $httpRequest_OBJ->send();
//print out the result
echo "<pre>"; print_r($result); echo "</pre>";
?>
您是否尝试过HttpRequest::send?例如,请参阅中的示例并填写您自己的数据:
<?php
//set up variables
$theData = '<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-'.$nonce.'">
<wsse:Username>xxxxx</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxx</wsse:Password>
</wsse:UsernameToken>
<wsu:Timestamp wsu:Id="Timestamp-'.$nonce.'" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>'.$timestamp.'</wsu:Created>
<wsu:Expires>'.$expiration.'</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<prep:requestListeSeancesCtrlAcces>
<codeManifestation>xxxx</codeManifestation>
<!--Optional:-->
<debutIntervalle/>
<!--Optional:-->
<finIntervalle/>
</prep:requestListeSeancesCtrlAcces>
</soapenv:Body>
</soap:Envelope>';
$url = 'http://www.example.com';
$options = array();
//create the httprequest object
$httpRequest_OBJ = new httpRequest($url, HTTP_METH_POST, $options);
//add the content type
$httpRequest_OBJ->setContentType = 'Content-Type: text/xml';
//add the raw post data
$httpRequest_OBJ->setRawPostData ($theData);
//send the http request
$result = $httpRequest_OBJ->send();
//print out the result
echo "<pre>"; print_r($result); echo "</pre>";
?>
当我使用wsdl时,我使用cURL
要修改标题和封套,请使用以下命令:
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
curl_setopt($ch,CURLOPT_POSTFIELDS,$soapenvelope);当我使用wsdl时,我使用curl
要修改标题和封套,请使用以下命令:
curl_setopt($ch,CURLOPT_HTTPHEADER,$header);
curl_setopt($ch,CURLOPT_POSTFIELDS,$soapenvelope);那么您确定此SOAP消息适合WSDL,并且想知道如何将此消息作为请求主体发送到HTTP端点?那么您确定此SOAP消息适合WSDL,并且想知道如何将此消息作为请求主体发送到HTTP端点?