NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Date type in XML Schema


Joined: 22 Sep 2003
Posts: 10
Location: Spain
Reply with quote
Hi to everibody :

I need to send a data to my SOAP server in "date type", but date type is not supported... and send this data as string type.

Please, can anybody show me how to add "date type" to XML Schema?

Thank U
View user's profileFind all posts by nunezjjSend private message
Just make this...


Joined: 22 Sep 2003
Posts: 10
Location: Spain
Reply with quote
Very simple solution, in param array:

'setParam'=>array('param'=>new soapval('param','date',$value))

Embarassed
View user's profileFind all posts by nunezjjSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
I'd offer a different way:

1. On the server part you declare

Code:
  $server->register(
        'myfunction',
        array('date'=>'xsd:datetime'),
        array('return'=>'xsd:string'),
        'http://soapinterop.org/');

  function myfunction($date){
     return "Hello, date is $date.";
  }


2. from the client side you call it:
Code:
  $mydate = timestamp_to_iso8601(strtotime("now"));
  $result = $proxy->myfunction($mydate);


timestamp_to_iso8601() function is defined in nusoap.php

Hope that helps
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Date type in XML Schema
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