guys,
ok i installed soapUI and it generates the envelope for you to send your requests. and this time it worked, so the envelope needs to look like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sil="SilverpopApi:EngageService.SessionMgmt.Login">
<soapenv:Header/>
<soapenv:Body>
<sil:Login>
<sil:USERNAME>xx</sil:USERNAME>
<sil:PASSWORD>xxx</sil:PASSWORD>
</sil:Login>
</soapenv:Body>
</soapenv:Envelope>
but how do I format my php to look like above?
PHP Code:
<?php
class comsumewsdl {
public $username="xxxx";
public $password="xxxx";
public $parameters;
public function dorequest(){
//$client = new SoapClient("http://api5.silverpop.com/SoapApi?wsdl", array('trace' => 1));
$client = new SoapClient(null, array(
"location" => "http://api5.silverpop.com/SoapApi?wsdl",
"uri" => "http://schemas.xmlsoap.org/soap/envelope/",
"sil" => "SilverpopApi:EngageService.SessionMgmt.Login",
"trace" => 1 )
);
$this->parameters = array('USERNAME'=>$this->username, 'PASSWORD'=>$this->password);
try {
$response = $client->__soapCall("Login", $this->parameters);
echo "<pre>\n";
echo htmlentities ($response);
echo "\n";
}
catch(Exception $exception){
//$call=$client->__getRequest($response);
echo $client->__getLastRequest();
echo 'General Exception: ', $exception->getMessage();
exit;
}
}
}
$callclass = new comsumewsdl();
$callclass->dorequest();
?>
i think i need to be looking at soapVar and SoapHeader, but I just cannot get this to work. Anyone plz?
Bookmarks