N
N
Nikita Sklyuev2012-04-06 15:41:29
PHP
Nikita Sklyuev, 2012-04-06 15:41:29

PHP and SOAP HELP!

Hello fellows.

Today for the first time I had to work with SOAP.
In principle, I read a little on this topic, more or less clear.

But he was unable to implement it. Namely, it is not clear what parameters are passed to the methods. There is a WSDL

file and a description of its types . I understood approximately how to raise SoapServer, but since I need to know what data is being transferred to it, I also needed to raise the client, but then I came to a standstill, since I never used SOAP in my life, I didn’t understand what parameters must be passed to Whatever I pass to it, an error is raised: Fatal error : Uncaught SoapFault exception: [Client] looks like we got no XML document in F:\AppServ\www\soap\client.php:9



$client = new SoapClient("soap.wsdl", array("trace"=>true));
print($client->PerformTransaction());






Stack trace:
#0 [internal function]: SoapClient->__call('PerformTransact...', Array)
#1 F:\AppServ\www\soap\client.php(9): SoapClient->PerformTransaction()
#2 C:\Program Files\Zend\ZendStudio-5.5.1\bin\php5\dummy.php(1): include('F:\AppServ\www\...')
#3 {main}
thrown in F:\ AppServ\www\soap\client.php on line 9
Please help kind people. Googling on this topic has practically led to nothing, you are the last hope.

I would push off and then I myself.

Thank you very much in advance.

PS The documentation from the service provider (payment terminal) also did not give anything on the road. They don't even have an implementation example!

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Anatoly, 2012-04-06
@taliban

ua2.php.net/manual/ru/soapclient.construct.php
public SoapClient::SoapClient ( mixed $wsdl [, array $options ] ) // pay attention to the first parameter - this is valid xml for soap. In fact, it must be identical to the one processed by the server.
Judging by the error, you are not giving it away, either it is corrupted, or the path is wrong.

C
CapAsder, 2014-06-25
@CapAsder

I propose a solution that helped me:
ob_clean();
$server = new SoapServer('./wsdl/wsdl.wsdl');
$server->setClass('ApiService');
$server->handle();
Let me explain. Before initializing your SoapServer, we clean the contents with the ob_clean() command;

A
Alexey Zhurbitsky, 2012-04-06
@blo

I suggest looking at SoapClient::__getLastRequest and SoapClient::__getLastResponse

G
galaxy, 2012-04-06
@galaxy

Disclaimer: didn't really work with soap either.
Where does your client send a request? In their WSDL it is written: <soap:address location="http://127.0.0.1/soap/server.php"/>
And where to really send, they give you when you connect, as I understand it.
That. you need to either fix the wsdl (substitute the address of your test SOAP server or get it from them), or pass the location option.

A
Arsen, 2012-04-09
@mekegi

There was the same problem on one of the servers - for half a day we racked our brains trying to find the cause of the bug, and in the end, when building the puff, they indicated some kind of flag that is responsible for the operation of file_get_contents. The fact is that the SoapClient class constructor inside itself makes a call similar to file_get_contents, but where the latter does not work, soap will not work either.
As an option to test, put it on some remote hosting and write in new SoapClient('http://bla-bla.tld/some.wsdl') if everything works through a remote file, then there is a problem with file_get_content

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question