NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How to Use NuSoap with Only XML Request by Client ?


Joined: 15 May 2006
Posts: 4
Location: Delhi
Reply with quote
Hi,
Can sombody tell me that if we can pass Only XML through the client to a nusoap server. considering the case where client could have a .Net or Java at there end and need to pass only XML/Soap Envelope?

If we can Do So then is there any need of WSDL and XSD Schema file for that, If yes then How could we bind WSDL and XSD file with the XML Message ?

Can sombody provide some sample code for that too ?

Thanks In Advance

Vikas
View user's profileFind all posts by vikasSend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Yes, sure, you can do it.

If you have a nusoap-based server, you're all set and your WSDL is auto-generated. Just run your script with "wsdl" argument passed as GET variable, like below:
http://mywebserver/myscript.php?wsdl

Regarding samples, any sample listed under the SAMPLES topic is suitable.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How to Use NuSoap with Only XML Request by Client ?


Joined: 15 May 2006
Posts: 4
Location: Delhi
Reply with quote
Hi,
Actually i have all the things running fine, but i want to validate the Message that is to be pass by the client side Following is the XML Envelop that i am passing

Code:
<?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/" xmlns:tns="urn:hellowsdl"><SOAP-ENV:Body><tns:hello xmlns:tns="urn:hellowsdl"><name xsi:type="xsd:[b]strin[/b]">Scott</name></tns:hello></SOAP-ENV:Body></SOAP-ENV:Envelope>

I have copied this XML from the original process where client also uses the nusoap.php class file.

Here you can see i have typed "strin" instead of string , So these are the things i want to validate

OR Should i use the Following XML to pass to the server ?


Code:
<?xml version="1.0" encoding="utf-8"?><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><hello><name>Scott</name></hello></SOAP-ENV:Body></SOAP-ENV:Envelope>


If we can use Second XML instead of first , then i want to know what is the use of SOAP, Because same thing i can do just with a RPC call i can pass the following XML

Code:
><hello><name>Scott</name></hello>


and can write the code to parse this XML.

Can you please answer all of these question ?

A lot of thanks In Advance
View user's profileFind all posts by vikasSend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
I'm sorry, I don't get the point.
You're using client based on nusoap.php to get XML and then pass it to server based on nusoap.php etc.
Is there any reason to do it? What are you trying to achieve?
Anyway, it would make sense if you create short and clear samples that would show the problem you're experiencing.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How to Use NuSoap with Only XML Request by Client ?


Joined: 15 May 2006
Posts: 4
Location: Delhi
Reply with quote
Ok,

I have donloaded the NuSoap Package and the client Request File is like this :

SAMPLE:1
Code:

   <?php
      require_once('nusoap.php');
      $client = new soapclient('http://mywebserver/NUSOAP/Hellowsdl.php?wsdl', true);

      $err = $client->getError();
      $result = $client->call('hello', array('name' => 'Scott'));
    ?>


and at the server side the file which process the above request is :

SAMPLE:2
Code:

  <?php
require_once('nusoap.php');
$server = new soap_server();

$server->configureWSDL('hellowsdl', 'urn:hellowsdl');               

$server->register('hello',      
   array('name' => 'xsd:string'),   
   array('return' => 'xsd:string'),   
   'urn:hellowsdl',      
   'urn:hellowsdl#hello',      
   'rpc',         
   'encoded',         
   'Says hello to the caller'   );

function hello($name) {
        return 'Hello, ' . $name;
}

// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>


Now see the code in SAMPLE:1 script , it uses the nusoap.php file to send the request, but i have another site which is build in java, So i'll not use that SAMPLE:1 code there. I want to make a request with XML Only, from the client side in which i'll not need the nusoap.php file at client side to make the request, But at the server end i want to use the SAMPLE:2 script Please tell me how can i do that, How can i request the Nusoap Server Just only with XML/Soap ?

Please Reply ASAP, If sombody have full knowledge of it can he/she talk to me with messanger,

my Yahoo Messanger Id is : vikas_mdu

Thanks in Advance
View user's profileFind all posts by vikasSend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
if your soap server is written in java, nusoap is still able interoperate with it. Just check if you run call in the target namespace (see call()'s arguments).
if your soap client is written in java, nusoap can work on the server side.
If you don't want to use nusoap, this forum is not appropriate Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How to Use NuSoap with Only XML Request by Client ?


Joined: 15 May 2006
Posts: 4
Location: Delhi
Reply with quote
means nobody has the answers of my questions , even the SITE ADMIN !!
View user's profileFind all posts by vikasSend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
we here are not for supporting SOAP itself. Just nusoap and only.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How to Use NuSoap with Only XML Request by Client ?
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