NUSOAP HEADER - SWSOFT API |
|
People,
I am with difficulty to legalize through headers in a API, follows XML of model of the WSDL: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <CredentialsSoapHeader xmlns="http://swsoft.com/webservices/sb/4.0/AccountService"> <SsoSessionId>string</SsoSessionId> <SsoId>string</SsoId> <Login>string</Login> <Password>string</Password> </CredentialsSoapHeader> </soap:Header> <soap:Body> <CreateAccount xmlns="http://swsoft.com/webservices/sb/4.0/AccountService"> <ownerAccountId>string</ownerAccountId> <username>string</username> <password>string</password> <firstName>string</firstName> <lastName>string</lastName> <email>string</email> <role>Administrator or Reseller or SiteOwner</role> <planId>string</planId> <changePasswordAllowed>boolean</changePasswordAllowed> </CreateAccount> </soap:Body> </soap:Envelope> My code is: <?php require_once('nusoap.php'); $wsdl = "http://sitebuilder4.demo.swsoft.com/ServiceFacade/4.0/AccountWebService.asmx?WSDL"; $soap = new soapclient($wsdl,"wsdl"); $soap->setCredentials("admin","sitebuilder"); $user = "admin"; $pass = "sitebuilder"; $header = '<soap:Header><CredentialsSoapHeader xmlns="http://swsoft.com/webservices/sb/4.0/AccountService"><Login>'.$user.'</Login><Password>'.$pass.'</Password></CredentialsSoapHeader></soap:Header>'; $parameters = array(ownerAccountId=>"",username=>"giuseppelopes",password=>302010,firstName=>"Giuseppe",lastName=>"Lopes",email=>"giuseppe.lopes@gmail.com",role=>"",planId=>"",changePasswordAllowed=>"true"); $result = $soap->call('CreateAccount', $parameters, 'http://sitebuilder4.demo.swsoft.com/ServiceFacade/4.0/AccountWebService.asmx', 'http://sitebuilder4.demo.swsoft.com/ServiceFacade/4.0/AccountWebService.asmx/CreateAccount', $header, false, 'rpc','literal'); if ($soap->fault) { echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>'; } else { $err = $soap->getError(); if ($err) { echo '<h2>Error</h2><pre>' . $err . '</pre>'; } } print_r($result); echo "Ok"; ?> The error that it insists on appearing is: Fault Array ( [faultcode] => ERROR_NO_AUTH_HEADER [faultstring] => Auth header is missed. [faultactor] => [detail] => ) Please I am despaired I do not know more as to decide. I thank any help. [ ]'s Giuseppe Lopes giuseppelopes@hotmail.com giuseppe.lopes@gmail.com
|
||||||||||||||||
|
Maybe this helps |
|
you need write header without "<soap:header>" like that:
$header = '<CredentialsSoapHeader xmlns="http://swsoft.com/webservices/sb/4.0/AccountService"><Login>'.$user.'</Login><Password>'.$pass.'</Password></CredentialsSoapHeader>'; |
||||||||||||
|
NUSOAP HEADER - SWSOFT API |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by