Strict Standards: Declaration of mySoap::__doRequest() should be compatible with that of SoapClient::__doRequest()

1,194 views
Skip to first unread message

Mandy

unread,
Aug 3, 2011, 3:24:23 AM8/3/11
to wse-php
Hi,

I have taken one of the examples provided and tried modifying it to
connect to a web service requiring WS-Security. However I keep getting
the error message :-


Strict Standards: Declaration of mySoap::__doRequest() should be
compatible with that of SoapClient::__doRequest() in C:\Program Files
\Apache Software Foundation\Apache2.2\htdocs\pgad\libraries\mysoap.php
on line 28

This is the code in the class I'm using :-

class mySoap extends SoapClient {

function __doRequest($request, $location, $saction, $version) {
$doc = new DOMDocument('1.0');
$doc->loadXML($request);

$objWSSE = new WSSESoap($doc);

/* create new XMLSec Key using RSA_SHA1 and type is private
key */
$objKey = new XMLSecurityKey(XMLSecurityKey::RSA_SHA1,
array('type'=>'private'));
$objKey->passphrase="passphrase";
/* load the private key from file - last arg is bool if key in
file (TRUE) or is string (FALSE) */
$objKey->loadKey(PRIVATE_KEY, TRUE);

$objWSSE->addUserToken("usertoken", false);
/* Sign the message - also signs appropraite WS-Security items
*/
$options = array("insertBefore" => true);
$objWSSE->signSoapDoc($objKey);

/* Add certificate (BinarySecurityToken) to the message */
$token = $objWSSE-
>addBinaryToken(file_get_contents(CERT_FILE));

/* Attach pointer to Signature */
$objWSSE-
>attachTokentoSig($token);
return parent::__doRequest($objWSSE->saveXML(), $location,
$saction, $version);
}
}

Could you kindly let me know what I'm doing wrong?

Rob Richards

unread,
Aug 3, 2011, 3:34:47 AM8/3/11
to wse...@googlegroups.com, Mandy

That's a benign message but you can fix that by updating the __doRequest
signature in the class to:
function __doRequest($request, $location, $saction, $version, $one_way =
0) {

Rob

Mandy

unread,
Aug 3, 2011, 3:39:17 AM8/3/11
to wse-php
Hi Rob,

Thanks that removed the error.

Regards,
Mandy
> Rob- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages