NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Can anyone help?


Joined: 22 Aug 2006
Posts: 7
Reply with quote
Hello all,
In the following request, inside the <SOAP-ENV:Body>
<ns2143:addPublisherInfo ..>. Here addPublisherInfo is the method. what is ns2143? If it is namespace, how to change the namespace name?
Is it randomly generated one?


<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns2143:addPublisherInfo xmlns:ns2143="http://tempuri_org">
<strPName xsi:type="xsd:string">abcd</strPName>
<strPAccountType xsi:type="xsd:string">1</strPAccountType>
</ns2143:addPublisherInfo>
</SOAP-ENV:Body></SOAP-ENV:Envelope>


Thanks in advance
Pushparaj.
View user's profileFind all posts by pushparajSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
no, it's not a namespace. It's rather a pointer to the namesapace. Actual namespace for ns2143 in your sample is http://tempuri_org as specified there
xmlns:ns2143="http://tempuri_org"

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Aug 2006
Posts: 7
Reply with quote
Thanks for your reply.


So the dafault namespace is http://tempuri_org.
How to change this namespace ?
Is there any method to do that?

Regards
Pushparaj.
View user's profileFind all posts by pushparajSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Could you submit your code there, so I'll show you where to set namespace?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Aug 2006
Posts: 7
Reply with quote
Hello,
Here is the code which calls the webservice.

<?php
require_once($cnfIncludesPath.'nusoap/lib/nusoap.php');

$client = new nusoapclient('http://localhost/webservice/publisher_server.php');
$arr_ret_val = $client->call('addPublisherInfo',
array( 'strPName' =>'Pushparaj',
'strPAccountType' =>'0'
)
);
print_r($arr_ret_val);
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
?>

Here is the webh service server code

<?php
require_once($cnfIncludesPath.NUSOAP_PATH."nusoap.php");
// Instantiating the soap server class
$objServer = new soap_server();

// Configuring the wsdl for this service
$objServer->configureWSDL("publisherwsdl","urn:publisherwsdl");
$objServer->wsdl->addComplexType('ResultElement',
'complexType',
'struct',
'all',
'',
array(
'message'=>array('name'=>'message','type'=>'xsd:string'),
'description'=>array('name'=>'description','type'=>'xsd:string')
)
);
$objServer->register('addPublisherInfo',
array('strPName' => 'xsd:string',
'strPAccountType' => 'xsd:string',
), // Needs to be an array
array('return' => 'tns:ResultElement'),
'urn:publisherwsdl', // namespace
'urn:publisherwsdl#activatePublisher', // soapaction
'rpc', // style
'encoded', // use
'Activate the publisher account ' // documentation
);


$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$objServer->service($HTTP_RAW_POST_DATA);

?>


Regards
Pushparaj
View user's profileFind all posts by pushparajSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
$client = new nusoapclient('http://localhost/webservice/publisher_server.php');

Most probably this is the problem.
You specified WRONG url.
It must point to WSDL content. Just check with browser to make sure you get WSDL, not "help pages".
Normally it is produced when WSDL argument is added, like below
$client = new nusoapclient('http://localhost/webservice/publisher_server.php?wsdl', 'wsdl');
but check this URL first using browser: http://localhost/webservice/publisher_server.php?wsdl

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 22 Aug 2006
Posts: 7
Reply with quote
Hi,

Thanks for your reply. I got it.
Once i change the url to the wsdl content, it is not pointing to the tempuri_org.

Thanks again.

Thanks & regards
Pushparaj
View user's profileFind all posts by pushparajSend private message
Can anyone help?
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