NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
NUSOAP HEADER - SWSOFT API


Joined: 18 Nov 2007
Posts: 1
Reply with quote
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
Code:
Code:
View user's profileFind all posts by giuseppelopesSend private messageMSN Messenger
Maybe this helps


Joined: 18 Nov 2007
Posts: 1
Reply with quote
http://myserver/Sitebuilder/4.0.0/doc/devel/en_US/html/45400.htm
And in general, http://myserver/Sitebuilder/4.0.0/doc/devel/en_US/html/index.htm
View user's profileFind all posts by sinclairSend private message


Joined: 24 Dec 2009
Posts: 1
Reply with quote
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>';
View user's profileFind all posts by constSend private message
NUSOAP HEADER - SWSOFT API
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic