Has anyone ever used PHP to connect to Quest Diagnostics Soap webservice? They only have .net and java examples and I need a PHP solution and do not know where to start.
If you're familiar with php and if you have the WSDL URL then you should generate the PHP sdk from the WSDL which will you ease you the request construction ans the response handling.
Try the PackageGenerator project from Github ;)
Related
I have a bit of a problem understanding how the WSDL local file is working. Normally when I need to consume a WSDL file I simply use SoapClient and pass the URL (Something like https://somesite.com/something?wsdl) to it and I am able to consume it. However, now with a new webservice provider they gave me 6 files. Two of which has .wsdl extensions and the rest has .xsd extensions. I have never consumed a web service like this before and I cannot find any tutorials online or any topics regarding this with PHP. I found one where they explained it in Visual Studio, but we need to get this working on PHP. Can anyone point me in the right direction? I did not even know this method existed as normally we consume them by URL.
Any help would be greatly appreciated.
generally speaking, every wsdl is one web service, so there's 2 different services. Xsd files are just xml schema definition and you don't need it while you're calling web services. Use them to validate your soap xml.
If wsdl-s are v 1.1 you can try NuSoap on php site, if not, in Visual Studio you have wsdl.exe command line tool. Use that tool to simulate those web services localy, so you'll get excellent testing environment.
I also highly recommend you to try SoapUI.
Cheers,
SiniĊĦa
Recently I've been working on web page based remote control. the function is already there done by c++ and now I'm trying to find a way linking this function to my web page.
I tried using soap and now almost give up because of those "cannot load wsdl file" and "http get method not implemented" errors
Is there any other way to do this beside using soap?
Cheers
Do you really want to use PHP?
You can also put the webpage stuff in the C++ application and make it a (fast)cgi application or by using a framework like wt or CppCMS
This sounds rather general so here are some possible directions:
Bind C++ to a custom php module
Call C++ binary with php system('')
Maintain a control socket (TCP / UDP /...) in C++ Daemon and connect from PHP
Integrate C++ in other Application Framework than PHP (.Net, ...)
As for the soap errors, what did you use to wrap your C++ into a SOAP Provider?
can any one help me in developing soap client whereas parameters type of soap server's functions is object etc.
$client->__call("functionName",array(/*now how to find parameter type if they are object*/));
thanks ...
Just read the official documentation (http://php.net/manual/en/class.soapclient.php). There are plenty of examples, you only have to copy, paste and adapt them.
If you really don't know how to use SOAP in PHP then try to use a WSDL to PHP generator such as PackageGenerator. With this is you'll have a PHP SDK corresponding to SOAP Web Service using the native PHP SoapClient class. A tutorial file is also generated that can be used as a starting guide.
I realize it's possible to create a PHP Web Service using SOAP, however, are there classes within PHP that make this easier than hand creating the SOAP messages?
I want to use php has a webservice using wsdl
with this link
https://qa-api.ukmail.com/Services/UKMAuthenticationServices/UKMAuthenticationService.svc?wsdl
to integrate uk mail api in to my php web application
but dont now how to do it ?? any help
There are:
The PHP SOAP functions
The PEAR::SOAP module
nusoap
They should all interoperate fine with .NET - it's just XML after all...
You want to try nuSOAP which you can get from here http://sourceforge.net/projects/nusoap/
Very easy as I had to create a PHP SOAP service and I didnt know PHP as I'm a C# .net person!
And just to add to that, as long as you implement the wsdl and SOAP methods correctly you should be fine. I had it working with .net with no trouble at all
Sure...
http://us2.php.net/manual/en/class.soapserver.php
There used to be an example in there somewhere... I couldn't find it though...
Is it possible to consume a php webservice in visual studio? I have a webservice with a wsdl file created by nusoap, when I try to add the web reference in visual studio the name of the service and the methods show up but it complains that the 'wsdl is not a known document type' and the discovery document could not be found.
Any suggestions would be appreciated.
thanks,
Richard
Responses to suggestions:
Well there is no asmx file at the moment, since the .net app is using the functions of the php webservice and not the other way around. Maybe nusoap can create a asmx? I think that is just for the .net side though.
I 'm trying with nusoap because it automatically creates the wsdl for you, however I did try the inbuilt soap handing of php first with my own wsdl file but got the same error as with nusoap.
Seems the problem in the end was really my webserver, my files where encoded in utf8 and it didn't like that. Thanks for the answers though.
I use the pattern of the code found here. It works for me. Also did you check to the wsdl by browsing to the url of the service? It may be that your service is generating an invalid .wsdl file.
Here is what I found to use nuSoap with WCF. http://offroadcoder.com/2008/03/23/CallingYourNusoapPHPWebServiceFromWCF.aspx