PHP IDE with webservice wsdl Import Support - php

Recently I have been building a lot of applications that needs to access webservices. I currently use a tool wsdl2php to generate a php Class file from the wsdl file.
I was wondering if there are IDE's available that can do the same thing, or at least make it really easy to access/code against the Methods that are available.
I currently use Nusphere PHPed as IDE, but they only support this with their own NUSOAP client.
When you guys need to access a Webservice from PHP which IDE do you use?

If you only need to create a SOAP Client from WSDL then see this page
More specifically check Example 2.

Kevin have you tried using the wsdl2php tool?
http://www.urdalen.no/wsdl2php/
Then most PHP IDEs will use a wrapper helper type option once you use include() or require_once();

Related

Using a WSDL File instead of URL to WSDL in PHP

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

Converting WSDL to PHP source code

A third party provided a WSDL specification, through which I'm going to transfer data to a remote application using SOAP.
I'd like to convert all declared types, constants and method signatures to corresponding classy PHP source code.
Today, I gave WsdlToPhp a try. As far as I figured out, this converter doesn't convert any detail. Furthermore, the documentation has a few rough edges... Maybe a better converter exists.
Q: Could someone propose a stable WSDL to PHP converter?
Please note, that I need a converter to be run offline on a development machine. The WSDL specification isn't publicly available. Therefore, I'm not able to upload the WSDL to a remote converter service.
I used Wsdl2phpgenerator recently. It was pretty easy to use and the generated code has not let me down yet.
I think i done it once, use the pear wsdl lib
http://pear.php.net/reference/SOAP-0.9.4/SOAP/SOAP_WSDL.html#methodgenerateProxyCode

How to generate client PHP code for SOAP using SOAP UI?

Googling I've found this article:
http://java.dzone.com/tips/generating-client-java-code
It talk about how to generate a "JAVA" code with SOAP UI client, but what I need is to generate code php with soap UI or other resource.
Is this possible? exist any other resource to make it work that?
thank you for your answers..
Regards.
soapUI will not generate PHP code.
Fortunately, in PHP there often isn't a need to generate proxy classes. Instead, use SoapClient and simply call the SOAP methods you need outright. You can find simple examples at various blogs.
If the service with which you're interacting uses lots of complex types, then you may indeed want to auto-generate some PHP code and make use of SoapClient's classmap option.

SOAP PHP problem

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.

Consuming a php webservice in visual studio

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

Categories