metamlmini Posted March 18, 2011 Share Posted March 18, 2011 Hi guys! I started working on a project involving connecting to a soap server (windows). Eight hours later i am nowhere. The documentation is horrible and searching for error messages is a task that never ends. So now i am back here to ask all you guys :-) First of all, i want to connect to a external server which ends in: GatewayWebService.asmx?WSDL So i got the variable: $client = new SoapClient("http://XXXXXXXX/GatewayWebService.asmx?WSDL", array('login'=> "XXXXX",'password'=> 'XXXXXX')); And i want to do a call like: print($client->RetrieveArticles("Article")); So now i get an error: php webservice-import.php PHP Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/vhosts/test.shoerama.nl/httpdocs/maintenance/webservice-import.php on line 11 But i dont think that all above is very correct. So i want to ask you guys for some help. How can i get a call with, lets say, the first 10 records from the soap server? How do i do soap call? I recieved the following "code" from the guys that host the soap server: sXml: <Parameters><timestamp>1</timestamp><branch>98</branch><pos>1</pos><languagecode></languagecode><maxitems>100</maxitems></Parameters> What do i do with this? Thanks in advance guys! Link to comment https://forums.phpfreaks.com/topic/231024-php-soap/ Share on other sites More sharing options...
gristoi Posted March 18, 2011 Share Posted March 18, 2011 print($client->RetrieveArticles("Article")); Is incorrect, RetrieveArticles is returning an array. Try: $result = $client->RetrieveArticles("Article"); print_r($result); And see what it gives you Link to comment https://forums.phpfreaks.com/topic/231024-php-soap/#findComment-1189288 Share on other sites More sharing options...
metamlmini Posted March 21, 2011 Author Share Posted March 21, 2011 Well i get the following: stdClass Object ( [RetrieveArticlesResult] => ) This seems to be empty, but when i try to run in it from cli: php webservice-import.php PHP Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> Error writing to log file 'C:\Temp\ConnectFlowWebService.log', reason: The process cannot access the file 'C:\Temp\ConnectFlowWebService.log.tmp' because it is being used by another process. in /var/www/vhosts/test.xxx.nl/httpdocs/maintenance/webservice-import.php:13 Stack trace: #0 /var/www/vhosts/test.xxx.nl/httpdocs/maintenance/webservice-import.php(13): SoapClient->__call('RetrieveArticle...', Array) #1 /var/www/vhosts/test.xxx.nl/httpdocs/maintenance/webservice-import.php(13): SoapClient->RetrieveArticles('Article') #2 {main} thrown in /var/www/vhosts/test.xxx.nl/httpdocs/maintenance/webservice-import.php on line 13 This is weird... What gives? Link to comment https://forums.phpfreaks.com/topic/231024-php-soap/#findComment-1190198 Share on other sites More sharing options...
metamlmini Posted March 30, 2011 Author Share Posted March 30, 2011 This is not a bump. I found a work around using curl... Which is pretty ugly but it works. But now there is a new project and again with soap but this webservice doesnt allow http requests :-( and they want us to write some data in the webservice. So again, how the hell does php-soap work. the connect strings are not the problem but how do i add and retrieve data? Link to comment https://forums.phpfreaks.com/topic/231024-php-soap/#findComment-1194304 Share on other sites More sharing options...
metamlmini Posted April 12, 2011 Author Share Posted April 12, 2011 This soap stuff is still a problem. I even did a tcpdump to see which data is being sent. I saw that de soap envelope is empty... Which is strange but if i understand correct i should use a SoapVar to preserve the input xml. Still... nothing. I hate soap! it sucks and doesnt work! Bleagh Link to comment https://forums.phpfreaks.com/topic/231024-php-soap/#findComment-1200572 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.