There is a WSDL service which you can query using the C# as shown below:
arameter p1 = new Parameter();
p1.Name = "$name";
p1.Value = "thename";
Parameter p2 = new Parameter();
p2.Name = "$surname";
p2.Value = "thesurname";
Parameter p3 = new Parameter();
p3.Name = "$birthyear";
p3.Value = "1990";
Parameter p4 = new Parameter();
p4.Name = "$queryno";
p4.Value = "999999";
Query query = new Query();
query.Name = "TheQueryName";
query.Parameters = new Parameter[] { p1, p2, p3, p4 };
ServiceReference1.BASEXSoapClient cli = new BASEXSoapClient();
cli.Open();
string s = cli.Execute(query);
cli.Close();
I am trying to create a php counterpart of this code but I am having problems with the query name which does not exist:
<?php
try
{
$client = new SoapClient( "http://xxxx/BASEX.asmx?WSDL" );
$request = array('$name'=>'thename',
'$surname'=>'thesurname',
'$birthyear'=>'1990',
'$queryno'=>'999999');
$response = $client->TheQueryName($request);
print_r($response);
}
catch (SoapFault $e)
{
echo "<pre>";
print_r($e); exit;
echo "<pre>";
}
?>
And this is the web service:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Execute xmlns="xxxxx/basex">
<query>
<Name>string</Name>
<Parameters>
<Parameter>
<Name>string</Name>
<Value>string</Value>
</Parameter>
<Parameter>
<Name>string</Name>
<Value>string</Value>
</Parameter>
</Parameters>
</query>
</Execute>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<ExecuteResponse xmlns="xxxxx/basex">
<ExecuteResult>string</ExecuteResult>
</ExecuteResponse>
</soap12:Body>
</soap12:Envelope>
I am told that I can use SOAP instead of BASEX client, as the basex was not working at all.