Re: [Exist-open] Re: PHP - SOAP question.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thankyou Manuel.

Today I learned how SOAP bridges the language gap. The eXist database is
Java based and my client is PHP, but using the WSDL system made that
irrelevant. 

Thanks to the NUSOAP documentation, Manuel, and my boss Brian.

the code:



include('nusoap.php');

$s = new
soapclient('http://sts590009.anu.edu.au:4080/exist/services/Admin?wsdl','wsdl');
$p = $s->getProxy();

//connect
$session = $p->connect('user','pass');

if(!$err = $p->getError()){
	print "Connect = $session.";
} else {
	print "ERROR: $err";
}

	print '<xmp>'.$p->$request.'</xmp>';
	print '<xmp>'.str_replace('><',">\n<",$p->response).'</xmp>';


print "<hr>";
$data = base64_encode($mynewdoc); //$mynewdoc is an XML structure made
into a string .


//store
$store = $p->store($session,$data,'UTF-8','/db/forms/details.xml',true);

if(!$err = $p->getError()){
	print "Store = $store.";
} else {
	print "ERROR: $err";
}

	print '<xmp>'.$p->$request.'</xmp>';
	print '<xmp>'.str_replace('><',">\n<",$p->response).'</xmp>';

print "<hr>";


//disconnect session
$disconnect = $p->disconnect($session);

if(!$err = $p->getError()){
	print "Disconnect = $disconnect.";
} else {
	print "ERROR: $err";
}

	print '<xmp>'.$p->$request.'</xmp>';
	print '<xmp>'.str_replace('><',">\n<",$p->response).'</xmp>';




On Thu, 2004-04-22 at 04:17, Manuel Lautenschlager wrote:
> hi, try this
> 
> $data = base64_encode($data);
> 
> $parameters = array($this->sessionID,$data,"UTF-8",$collection,true);
> $res = $this->adminClient->call('store',$parameters);
> if ($this->adminClient->getError()) die
> ("store:".$this->adminClient->getError());
> 
> manuel
> "shane nuessler" <shane.nuessler@anu.edu.au> schrieb im Newsbeitrag
> news:1082441702.2281.15.camel@sts59105.anu.edu.au...
> > Hi,
> >
> > I was wondering if anyone has a code snippet of how to store an XML
> > document in eXist using PHP, (including how to encode the XML string).
> >
> > Kind regards,
> > Shane.
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: IBM Linux Tutorials
> > Free Linux tutorial presented by Daniel Robbins, President and CEO of
> > GenToo technologies. Learn everything from fundamentals to system
> > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Exist-open mailing list
> Exist-open@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/exist-open

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux