Ik moet deze code sturen voor een soap-request, maar het lukt met niet dit voor elkaar te krijgen.
de wsdl = http://xxx.xxx.xxx.xxx:yyyy/wsdl/ICustomLinkSoap
kan iemand een simple PHP script maken die een respons geeft?
<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" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header xmlns:NS1="urn:UCoSoapDispatcherBase" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS1:TAuthenticationHeader xsi:type="NS1:TAuthenticationHeader">
<UserName xsi:type="xsd:string">portal</UserName>
<Password xsi:type="xsd:string">portal</Password>
</NS1:TAuthenticationHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS2:ExecuteRequest xmlns:NS2="urn:UCoSoapDispatcherCustomLink-ICustomLinkSoap">
<ARequest xsi:type="xsd:string">
<?xml version="1.0" encoding="windows-1252"?> <EoCustomLinkRequestDateTime Type="TEoCustomLinkRequestDateTime"></EoCustomLinkRequestDateTime>
</ARequest>
</NS2:ExecuteRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
met onderstaande code lukt het niet:
<?php
$wsdl_url = 'http://xxx.xxx.xxx.xxx:yyyy/wsdl/ICustomLinkSoap';
$location = 'http://xxx.xxx.xxx.xxx:yyyy/soap/ICustomLinkSoap';
$action = 'ExecuteRequest';
$version = SOAP_1_1;
$one_way = 0;
$soapClient = new SoapClient('http://xxx.xxx.xxx.xxx:yyyy/wsdl/ICustomLinkSoap', array(
'cache_wsdl' => WSDL_CACHE_NONE,
'cache_ttl' => 86400,
'trace' => false,
'exceptions' => true,
));
$auth = array(
'UserName'=>'portal',
'Password'=>'portal',
);
$header = new SoapHeader($wsdl_url,'TAuthenticationHeader',$auth,false);
$soapClient->__setSoapHeaders($header);
$request = '
<ARequest>
<EoCustomLinkRequestDateTime Type="TEoCustomLinkRequestDateTime"></EoCustomLinkRequestDateTime>
</ARequest>
';
$xmlVar = new SoapVar($request, XSD_ANYXML);
$result = $soapClient->ExecuteRequest($request);
$functions = $soapClient->__getFunctions ();
var_dump($soapClient->__getLastResponse());
var_dump($soapClient->__getLastRequest());
?>
3.064 views