Re: PhP SoAp Ws Security ? (probably)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pffui,
after some researchs it seems that i need to use that kind of structure :
(standards)

<wsse:Security
xmlns:wsse=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdâ;
soapenv:mustUnderstand=â0â>
    <wsse:UsernameToken>
	<wsse:Username
Type=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameTokenâ;>USER</wsse:Username>
	<wsse:Password
Type=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordTextâ;>PASS</wsse:Password>
    </wsse:UsernameToken>
  </wsseÂ:Security>


I'm looking for an easy way to implement it. 
So I tried to do :

        $auth = '
  <wsse:Security
xmlns:wsse=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdâ;
soapenv:mustUnderstand=â0â>
    <wsse:UsernameToken>
	<wsse:Username
Type=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameTokenâ;>USER</wsse:Username>
	<wsse:Password
Type=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordTextâ;>PASS</wsse:Password>
    </wsse:UsernameToken>
  </wsseÂ:Security>
';

        $authvalues = new SoapVar($auth,XSD_ANYXML);
        $header = new
SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";,
"Security", $authvalues, true);
                        
$service->__setSoapHeaders($header);

But i get this error :
org.xml.sax.SAXParseException: La valeur de l'attribut "xmlns:wsse" doit
commencer par un guillemet simple ou par un guillemet double. Message being
parsed: 
(The value of the attribute "xmlns:wsse" must start by " or by '. Message
being parsed.)

Here is the beginning of the xml request : 
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:ns1="http://tarifsanteng.mid.san.swisslife.fr";
xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";><SOAP-ENV:Header>
  <wsse:Security
xmlns:wsse=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsdâ;
soapenv:mustUnderstand=â0â>
    <wsse:UsernameToken>
	<wsse:Username
Type=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameTokenâ;>USER</wsse:Username>
	<wsse:Password
Type=âhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordTextâ;>PASS</wsse:Password>
    </wsse:UsernameToken>
  </wsse :Security>

</SOAP-ENV:Header>

It seems ok to me...
-- 
View this message in context: http://old.nabble.com/PhP-SoAp-Ws-Security---%28probably%29-tp30531698p30535348.html
Sent from the Php - Soap mailing list archive at Nabble.com.


-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux