2

How can I display the result of an XQuery query in a client server SOAP application? Below is what I have so far, it just prints hello and a name. How can I get it to process XQuery and return the result?

Client Code:

<?php
  $client = new SoapClient("hidden");
  echo "Functions:<br/><br/>";
  echo var_dump($client->__getFunctions());
  echo "<br/><br/>";
  try
  {
    $return = $client->sayhello("Ross");
    echo($return."<br>");
  }
  catch(SoapFault $soapFault)
  {
    echo ($soapFault);
  }

?> 

Server Code:

<?php 

function sayhello($firstName) { 
  return "Hello ".$firstName; 
}//sayhello


ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache 
$server = new SoapServer("hidden"); 
$server->addFunction("sayhello"); 
$server->handle(); 
?> 
RossH
  • 43
  • 1
  • 7

1 Answers1

0

you have not indicated what server this is running. XQuery is an embedded language not generally 'built in' except on XQuery based app servers like eXist or MarkLogic.

this looks like a duplicate of

Execute a XQuery with PHP

Community
  • 1
  • 1
DALDEI
  • 3,722
  • 13
  • 9