I intent to implement a webservice using PHP. The creators of the web-service sent me the WSDLs required via email and I was able to import them into Soap UI and test them.
Seeing that they work just fine, I'm tasked with repeating the same process in my PHP application. I did a bit of googling around, to find that PHP5 already supplies a SoapClient to consume webservices. I even tested two examples and they worked just fine. But not the one that was running using Soap UI.
SoapClient receives a URI of the WSDL file as the first parameter1 - is this the url of the service that soapui shows in the top bar? I noticed that the other webservices I tested, if the uri was copied and pasted to a browser, an XML format would be returned with the data regarding the webservice. With the data soapui was pointing as the endpoint, the browser would simply output a "Lenght Required" 411 error message.
So my question is, is the .xml file that SOAP ui uses to import a project the one I should point in my php? Like:
SoapClient ( "file:://C:\users\something\webservice.xml?wsdl",
['service'=>'login', 'username'=>'something', 'password'=>'secret' ] );
I would expose the .xml I received with the webservice information, but I'm afraid of leaking sensitive data. I will copy the header of the request, ommiting any sensitive data
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project activeEnvironment="Default" name="" resourceRoot="" soapui-version="5.2.0" abortOnError="false" runType="SEQUENTIAL" id="" xmlns:con="..."><con:settings/><con:interface xsi:type="con:WsdlInterface" wsaVersion="NONE" name="..." type="wsdl" bindingName="{...}GenericTicketConnector_Service" soapVersion="1_1" anonymous="optional" definition="file:/D:/.../Documents/file.wsdl" id="..." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart="file:\D:\...\Documents\file.wsdl"><con:part><con:url>file:\D:\...\Documents\file.wsdl</con:url><con:content><![CDATA[<--!...-->
<wsdl:definitions name="GenericTicketConnector" targetNamespace="http://www.otrs.org/TicketConnector/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.otrs.org/TicketConnector/">
<wsdl:documentation/>
<!--Warning: This WSDL file is for Development and Test purposes ONLY!-->
<wsdl:types>
<xsd:schema targetNamespace="http://www.otrs.org/TicketConnector/">
After this the .xml file looks like a normal wsdl file, describing the webservices supplied, the format of the request, the respose... etc...
Thank you.