Answer the question
In order to leave comments, you need to log in
How to convert curl request to SOAP Client php?
There is this code:
curl -H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: \"http://www.example.com/contractor/dtaservice/v7/contractorservice/GetProductCatalog\"" \
-d @$3 \
-X POST http://$1:$2/DTAContractor/Service/ContractorSystemService
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:AuthenticationHeader xmlns:h="http://www.example.com/contractor/dtaservice/v7/contractorheader" xmlns="http://www.example.com/contractor/dtaservice/v7/contractorheader" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ClientId>ID</ClientId>
<UserName>USER</UserName>
<Password>PASS</Password>
</h:AuthenticationHeader>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetProductCatalogRequest xmlns="http://www.example.com/contractor/dtaservice/v7/contractormessages" />
</s:Body>
</s:Envelope>
$location = 'http://'.$ip.':'.$port.'/DTAContractor/Service/ContractorSystemService';
$uri = 'http://www.example.com/contractor/dtaservice/v7/contractorservice/GetProductCatalog';
$ns = 'http://www.example.com/contractor/dtaservice/v7/contractorheader';
$soap = new SoapClient(null, array('location' => $location, 'uri' => $uri, 'trace' => 1));
$headerBody = array(
'ClientId' => $clientId,
'UserName' => $userName,
'Password' => $password,
);
$soapHeader = new SoapHeader($ns, 'AuthenticationHeader', $headerBody);
$soap->__setSoapHeaders($soapHeader);
$soap->GetProductCatalogRequest();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question