Ajouter header à mon web service
Bonjour à tous
voici mon web service
Code:
1 2 3 4 5 6 7 8 9 10
|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.webservice.a.com/">
<soapenv:Body>
<ser:searchClientNd>
<!--Optional:-->
<nd></nd>
</ser:searchClientNd>
</soapenv:Body>
</soapenv:Envelope> |
et voici mon header
Code:
1 2 3 4 5 6 7 8
|
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docsss.os-opn.org/wss/2004/01/oasis-200401-wss-wsecurity-secext-1.0.xsd" xmlns:wsu="http://docsss.os-opn.org/wss/2004/01/oasis-200401-wss-wsecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>azerty</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">azerty</wsse:Password>
</wsse:UsernameToken>
</wsse:Security></soapenv:Header> |
et voici mon code php pour faire appel au web service
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<?php
$client = new SoapClient('http://100.12.0.19/ww-WS/ClientSearchService?WSDL');
$params = array ('nd' => '012');
try
{
$response = $client -> __soapCall('searchClientNd', array ($params));
$a =$response->clients->client->adr_inst;
print_r($response);
}
catch (SoapFault $fault)
{
$erreur= "Une erreur technique est survenue";
$success = false;
}
?> |
comment je peux ajouter le header à mon web service
puisque sans le rajouter j'ai l'erreur suivante:
Code:
1 2
|
SoapFault exception: [ns1:InvalidSecurity] An error was discovered processing the header |