Re: [SOAP] PhP SoAp Ws Security ? (probably)
[email protected] (bkrqpzef) Sun, 26 Dec 2010 09:06:43 -0800 (PST)
| Newsgroups | php.soap |
|---|---|
| Message-ID | <[email protected]> |
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.