I have written a soap web service with php language , it works on localhost correctly ,but when i upload it on server i can see wsdl file of that and add its URL in soapUI, but when i call function of that it shows Internal Server Error.
server's OS is centos6 and php version is php54 and php soap already exists.
what is wrong?
<xs:element name="getServices">
<xs:complexType>
<xs:sequence>
<xs:element name="username" type="xs:string"/>
<xs:element name="password" type="xs:string"/>
<xs:element name="mobileNum" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
$client = new SoapClient("http://IpAddress/ws/ws?wsdl");
try {
$response = $client->getServices(
array(
'username' => 'username',
'password' => 'pass',
'mobileNum' => '1111111',
));
return $response;
}
catch(Exception $e)
{
return $e->getMessage();
}
Try looking in the error log file of server it would tell you the detailed description of why the error is occurring.
Internal server errors usually occurs when server is unable to execute the script not because the script ad an error but because of its own limiations, like max_execution time, max_upload_size, post_size etc.
Your wsdl is missing some points: namespace for example.
<?xml version="1.0" encoding="UTF-8"?>
<definitions name ="name"
targetNamespace="?"
xmlns:tns="?"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<xs:element name="getServices">
<xs:complexType>
<xs:sequence>
<xs:element name="username" type="xs:string"/>
<xs:element name="password" type="xs:string"/>
<xs:element name="mobileNum" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</port>
</service>
</definitions>