简体   繁体   中英

SOAP Server in PHP - how to write WSDL file - tips

I have quite complex (authentication, logs, ...) SOAP server (standard PHP extension). Everything is working fine but I want to know if there is any tool for creating / generating WSDL file? All changes I do manually and there are two problems:

  1. localhost

I have for testing reasons the same SOAP server on localhost - I need the same WSDL file and only difference is in url addresses which point to localhost. I copy & paste lines from one (localhost) file to other (production) file and this is good way to do mistake.

  1. new function When I want to add function to WSDL it takes me "long" time to understand again wsdl because it has more that 1000 lines.

I'm quite new to SOAP and also WSDL - I'm looking for good (and free) WSDL editor or tool to gererate WSDL file.

Creating WSDL file from scratch can be very complicated and error prone. To ease this process, you can use an IDE to generate the WSDL file for your PHP functions and pass it as a parameter to your PHP SoapServer class. Check out this simple tutorial on How to generate wsdl for php native soap class

Try WSO2 WSF/PHP Library . It can generate WSDL right from your code.

If you're using Eclipse, you can take a look into the WSDL Editor .

You can also create a build script, that parses an existing WSDL (it's XML) and replace specific values (like the hostname) with another one to a target file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM