if its possible please give me instructions
Thank you in advance
abubaker_2 0 Newbie Poster
Edited by abubaker_2
rproffitt 2,662 "Nothing to see here." Moderator
My question is why must it be soapui? Testing is usually planned in advance for the project.
I can't guess why you were downvoted at https://stackoverflow.com/questions/52684277/is-it-possible-to-test-non-wsdl-soap-server-with-soapui-or-postman Maybe they expect folk to dig into the work?
https://www.soapui.org/ tells me this is not a compete question. Maybe you need a Soapui member on your team?
abubaker_2 0 Newbie Poster
soupui or postman it doesnt matter
the web server works on my php pages fine
just found out that there's a android app too and i need to give the developer the api with the ability to see the functions and send his request and get the respond
i tied many solution but hit a dead end
im new to soap and my the web server is non wsdl.
On (Maybe they expect folk to dig into the work) stuck on it for 2 day and im out of ideas.
Thank you for the reply
Edited by abubaker_2
rproffitt 2,662 "Nothing to see here." Moderator
Something doesn't jive. That is, how could you develop an API and then not have the API?
Maybe something wasn't told. Such as "I have this website and now I want an Android app but need to create the API and documentation for the programmers." That would explain a great deal.
abubaker_2 0 Newbie Poster
here the 3 files i have
so you may undertand me
<?php
header('Content-type: application/json');
class server
{
private $con;
function __construct()
{
$this->con=(is_null($this->con)) ? self::connect() : $this->con;
}
static function connect()
{
$con = mysqli_connect("localhost","root","","mediator");
if (mysqli_connect_errno())
{
echo "Failed to connect to the database: " . mysqli_connect_error();
}
return $con;
}
public function getfeedback($id_array)
{
$feedbackArray = array();
$id=$id_array['id'];
$sql = "SELECT * FROM `feedback` WHERE `item_i_id`=$id";
$result = $this->con->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$feedbackArray[] = array('feedback'=>$row);
}
}
return json_encode($feedbackArray);
}
public function showAllItems()
{
$itemsArray = array();
$sql = "SELECT * FROM `items`";
$result = $this->con->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$itemsArray[] = array('items'=>$row);
}
}
return json_encode($itemsArray);
}
public function showAllOffers()
{
$offersArray = array();
$sql = "SELECT * FROM `offers`";
$result = $this->con->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$offersArray[] = array('offers'=>$row);
}
}
return json_encode($offersArray);
}
public function show()
{
$ProfilesArray = array();
$sql = "SELECT * FROM `profiles`";
$result = $this->con->query($sql);
while($row = $result->fetch_assoc()) {
$ProfilesArray[] = $row;
}
return json_encode($ProfilesArray);
// return json_encode($result->num_rows);
}
function Insert($data)
{
//return $data;
$input = json_decode($data);
//var_dump($input);
//$table=$data['Table'];
//$input=(array)$input;
//return $input;
$array=(array) $input;
//$array=json_decode($array);
// return $array;
//return $arr;
$table=$array['Table'];
$Fields=$array['Field'];
//$Fields=(array)$Fields;
$Values=$array['Value'];
$All_Fields= implode(',',$Fields);
$All_Values="'". implode("','",$Values)."'";
$sql= "INSERT into $table(".$All_Fields.")VALUES($All_Values)";
$insert_profile_exe = $this->con->query($sql);
$message="";
if($insert_profile_exe)
{
$message="string";
}//end if($insert_profile_exe)
else{
$message="string2";
}//end else
return $message;
}//function Insert
///////////////////
function update($data)
{
//return $data;
$input = json_decode($data);
//var_dump($input);
//$table=$data['Table'];
//$input=(array)$input;
//return $input;
$array=(array) $input;
//$array=json_decode($array);
//return $array;
//return $arr;
$table=$array['Table'];
$Fields=$array['Field'];
//$Fields=(array)$Fields;
$Values=$array['Value'];
$where=$array['where'];
$column=$array['column'];
$All_Fields= implode(',',$Fields);
$All_Values="'". implode("','",$Values)."'";
$sql = "UPDATE $table SET ";
for ($i = 0; $i < count($Fields); $i++){
$sql = $sql . $Fields[$i] . "=\"$Values[$i]\",";
}
$sql=substr($sql, 0, -1);
$sql=$sql. " WHERE $column = $where";
$sql=$sql;
// $sql= "UPDATE $table SET (".$All_Fields.")VALUES($All_Values)";
$update_profile_exe = $this->con->query($sql);
$message="";
if($update_profile_exe)
{
$message="string";
}//end if($update_profile_exe)
else{
$message="string2";
}//end else
return $message;
}//function update
function delete($data)
{
//return $data;
$input = json_decode($data);
//var_dump($input);
//$table=$data['Table'];
//$input=(array)$input;
//return $input;
$array=(array) $input;
//$array=json_decode($array);
//return $array;
//return $arr;
$table=$array['Table'];
$Fields=$array['Field'];
//$Fields=(array)$Fields;
$Values=$array['Value'];
$where=$array['where'];
$column=$array['column'];
$All_Fields= implode(',',$Fields);
$All_Values="'". implode("','",$Values)."'";
$sql = "UPDATE $table SET ";
for ($i = 0; $i < count($Fields); $i++){
$sql = $sql . $Fields[$i] . "=\"$Values[$i]\",";
}
$sql=substr($sql, 0, -1);
$sql=$sql. " WHERE $column = $where";
$sql=$sql;
// $sql= "UPDATE $table SET (".$All_Fields.")VALUES($All_Values)";
$delete_profile_exe = $this->con->query($sql);
$message="";
if($delete_profile_exe)
{
$message="string";
}//end if($delete_profile_exe)
else{
$message="string2";
}//end else
return $message;
}//function Insert
}//end of class server
///////////////
$param=array('uri' =>'http://localhost:8081/mid/server.php' );
$server=new Soapserver(Null,$param);
$server->setClass('server');
$server->handle()
?>
<?php
class client
{
function __construct()
{
$param = array('location' =>'http://localhost:8081/project/mid2/mid/server.php' ,
'uri'=>'urn://mid/server.php',
'trace'=>1 );
$this->instane = new SoapClient(NULL,$param);
}
public function getfeedback($id_array)
{
return $this->instane->__soapCall('getfeedback',$id_array);
}
public function showAllItems($id_array)
{
return $this->instane->__soapCall('showAllItems',$id_array);
}
public function showAllOffers($id_array)
{
return $this->instane->__soapCall('showAllOffers',$id_array);
}
function showProfiles($id_array)
{
return $this->instane->__soapCall('show',$id_array);
}
function insert($id_array)
{
return $this->instane->__soapCall('insert',$id_array);
}
function update($id_array)
{
return $this->instane->__soapCall('update',$id_array);
}
function delete($id_array)
{
return $this->instane->__soapCall('delete',$id_array);
}
}
$client =new client;
?>
<?php
include 'client.php';
$id_array = array('id' => '1' );
$json_feedback= $client->getfeedback($id_array);
$json_allItems= $client->showAllItems($id_array);
$json_AllOffers= $client->showAllOffers($id_array);
$json_AllProfiles= $client->showProfiles($id_array);
$feedbackArray=json_decode($json_feedback); // geting feedback for a certent item done
// echo $json_AllOffers;
var_dump($json_AllProfiles);
?>
rproffitt 2,662 "Nothing to see here." Moderator
Thanks for the code dump. This seems to have cleared up that the issue is not how to test at all but that your real issue is you have some site that was made without an API or design document and now you need to do that.
I'd restate your question. Maybe start a discussion with the real question.
abubaker_2 0 Newbie Poster
thank you for the replay and the feedback
RabidDog5150 15 Newbie Poster
Just as a side note, a SOAP service cannot exist without a WSDL. Unless things have changed :)
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.