I have a soap server and i want to make a login request.
https://github.com/haruntuncay/soapClient In this repo, you can see generated php code from "WSDL2PHP". How can i do a proper login request.I could not get it working.You can see what i have tried in final 20 lines of server.php.
TIA
You should definitively use a WSDL to php generator as I think you're not sending the request as it should be.
So using a WSDL to php generator, you will know exactly how to send the request and its associated parameters using PHP objects and the native PHP SoapClient class without having to deal directly with it.
I advise you to try the PackageGenerator project.
Related
for a customer I want to implement the OTA service in an interface to check availabilty and things like that.
I've downloaded the 2017 specifications from OpenTravel. But I lack some information. I want to realize it with PHP and SOAP and later connect it to Magento. But I can't find any url for the SOAP client to send those XMLs to.
I would greatly appreciate any help on this topic or maybe suggestions to do it in an easier way.
Greetings
Consuming OTA SOAP web services is tricky as PHP SoapClient class does not handle it properly.
First you should generate the PHP sdk from the WSDL corresponding to the availabilities you need to send requests to. You should give the PackageGenerator project from Github a try.
Nevertheless, as I said, the native PHP SoapClient class does not map the parameters to the XML request correctly. This is where you have to write your proper code to handle the mapping from the PHP objects to the XML request.
As I work regularly on these sorte of issues, I can help you further but only privately at contact#wsdltophp.com.
I need to process a Soap Request inside opencart 2, I built the soap request in a normal PHP file to start with and placed this in the root of my website, after I got that working I thought it would just be a case to add a function inside opencart 2 and place the soap request code in there. Now i can call the right function and the method containing the soap request but as soon as opencart try's to process the new soap client line which is :-
$newclient = new SoapClient('https://example.com/catalog/controller/soap/efiWSDL27.wsdl');
I get the following error:-
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /index.php.
Reason: Error reading from remote server
If I comment out this line, then the rest of the function runs ok, apart from anything that relies on the soap request.
So to be clear Im getting this error before I try and call the soap request further down the function, It happens purely on the new soapclient statement.
Do I need to specify any other parameters when I do the new soap client from within Opencart
I know the wsdl is reachable, Im lost on this one, like I say the exact same code will work on the same webspace in a plain php file outside of opencart. I also tried a different webservice with a remote wsdl and I still get this same error in side opencart?
please help me :)
Not Exactly The Right Answer, But the solution for me was to use the nusoap library rather than the built-in soapclient in PHP and then it worked perfectly.
I´m trying to do an integration between my own PHP application, and other external software which is 'waiting for' (listening) SOAP messages. But the key question on my situation is that this software which is listening for SOAP messages only accepts RAW contents and has no method which could be called, or Wsdl to be used.
Yes I know... it´s quite strange because with SOAP you usually should send a method request with some parameters, but in this case the only that I have is a URL where I should send with SOAP message that should contain only an string (formatted in a special way which is not a problem), and then this server will return to my PHP application another SOAP message that will contain a string. And that´s all.
Seems that in my case I can not use a PHP SOAP library because I have no method (or function) to call; the only thing that I have is a URL and a string that I should pass like a parameter. I´ve been thinking of using PHP sockets to create a basic SOAP message to that 'strange soap server', but I have no clue about how to do it, or how I woule create with PHP a way to keep my application waiting for the answer comming from that external server.
Thank you so much for your help in advance.
You might be best of by just making the WSDL on your own. It isn't the most trivial thing to do, but it is well documented so you should be able to figure it out.
THere is no need to get the WSDL from the service you're sinding your requests to (it is rather better to have WSDL locally in some cases), so you just initialize the default SOAP client in PHP with that local WSDL, and off you go.
I know almost nothing about PHP. So I have a coworker doing the PHP stuff. It's not going well so I need some help.
Here is the task.
Receive a SOAP message (in this case from SalesForce) in a PHP site on Linux.
Take that soap message and simply pass it along to a web service (as a parameter) running on a windows server. Which I am writing. The reason we need to do it this way is far beyond the scope of this question. We have no choice.
The communication between the PHP page and the webservice works. The problem is taking the soap message and sending it to the method in the webservice as a parameter.
Here is the big question:
How can we accept a soap message and send it as a prameter. Even converting it to a simple string and sending that would work.
Thanks in advance.
It looks to me like you need to use a SOAP handler, and then reformat the request accordingly.
I'd suggest you start by taking a look at NuSOAP, which provides PHP SOAP support. Go here - for a nifty tutorial on NuSOAP
i'm completely new to webservices (and especially with SOAP / WSDL)
Right now, i have a .WSDL in the root of my server which i have fully automatically generated.
How to test that my webservice is functionning (echoing the right results) without bugs ?
*How to interact with that .wsdl file ?*
Regards.
Or use SOAP UI.
If you want to use PHP, I would say you look into PHP SoapClient.