Scodigo, Inc.

Log In | Register

Cart Items:
0

Soap client problem

I'm trying to use soap to get data from a webservice to FIlemaker. If the webservice answer is bad smartpill dosent print the result but if I run the code from a "normal" webpage i get the result

This is the result i get i the browser:

Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: String or binary data would be truncated. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) in /Users/tomas/Sites/soap/test.php on line 7

the code I run is


$client = new SoapClient(WSDL addres');
$params = array(Array of params);
$result = $client->operation($params);
print_r($result);

I know why this happens but I want to be able to see the result.

Added try/catch

Micah Woods's picture

Hello Tomas,

I received your file and will email it back to you with my updated code. I added a try/catch that will properly catch the exception that's being thrown and allow you to handle it properly. Here's a snippet of that section:

try {
$result = $ticket->PutInfo($params);
$result = utf8_decode($result -> PutInfoResult->any);
print_r($result);
} catch(Exception $e) {
echo "EXCEPTION:\n", $e->getMessage(), "\n\n";
echo "REQUEST:\n" . $ticket->__getLastRequest() . "\n\n";
echo "RESPONSE:\n" . $ticket->__getLastResponse();
}

Regards,
Micah

Soap client problem

Micah Woods's picture

Hello Tomas,

SmartPill should properly return errors and exceptions, etc.

Can you send me an example FileMaker file so I can try it here? If so, please use our support form here:

http://www.scodigo.com/support/plug-in-support/

Regards,
Micah

Test file submitted

Test file submitted. If I can be helpful please ask.