PHP5 SoapClient consumes WCF - But the returned object is empty with no errors

Tuchhoofe

New Member
The goal: To consume a simple WCF4 service. The WCF takes 2 parameters, DateStart & DateEnd as yyyy-MM-dd.The returned result should contain objects with about 16 property values each.The WCF service was set up and is managed by someone else. He assures me that everything is working correctly since he has written a C# test utility to test from the opposite side of the wire. (ie.simulating an external client call like mine). He gets around 1400 objects backusing my date range below.The Problem: The SOAP call finishes without any errors from what I can see. I can call __getFunctions() on the WSDL so it seems that communication is working. However, the call finishes very quickly.Too quickly, which tells me something is wrong with my query. The result should be around 1-2 MB in size. But my result object seems to be empty. His result object contains 1400 objects.The browser reports exit status 200. So no connection errors.The Question: Am I doing the query correctly, and am I reading the result right or should I be doing something else entirely ? I am not a newbie PHP programmer, but by no means an expert. This is my first time using SOAP, WSDL and WCF. I have researched this for nearly 3 days now. S.O. and Google have always provided an answer. I found various examples of how to do this, and , it seems very simple. Yet I must be missing something. I am exhausted and at wits end. This one has got me stumped. Here is what I am doing:For testing I am not writing to a file yet. Just doing a var_dump() to test. This works fine to get the results from the __getFunctions() call. But it doesn't work for the actual WSDL function call it seems. What should I be doing here ? I am also trying to download SOAPUI but my download keeps dropping. Not sure what is going on there. The code:\[code\]define('NEWLINE', "<br />\n");define('DUMPFILE','/wcf.xml');// SOAP clientini_set('soap.wsdl_cache_enabled', '1'); //ini_set('soap.wsdl_cache_ttl', '0'); $wsdl = $url.'?wsdl';$soapClient = new SoapClient($wsdl, array('cache_wsdl' => WSDL_CACHE_NONE,'keep_alive'=>1));var_dump($soapClient->__getFunctions()); // SOAP call////DATE FORMAT yyyy-MM-dd$args->DateStart = "2013-03-28";$args->DateEnd = "2013-03-29";try{ $result = $soapClient->GetScheduleData($args);}catch (SoapFault $fault){ echo "Fault code: {$fault->faultcode}" . NEWLINE; echo "Fault string: {$fault->faultstring}" . NEWLINE; if ($soapClient != null){ $soapClient = null; } exit();}$soapClient = null;var_dump($result);//file_put_contents(DUMPFILE,$result);\[/code\]
 
Back
Top