Dia is a free powerfull Diagram drawing tool. I have used it to generate a php webservice file. The generated WebService is compatible with the nuSoap library.
Please follow the below steps to get the most of the sotfware. Also check the "Version history" page in "Browse Pages" section to see what is new.
Firstly let's take a look at what is required in the webService in nuSoap:
1) An object
2) The object's paramteres
3) Object's methods
4) Methods' parameters.
Create the diagram
There is an example diagram available in the download section
What we need to know:
An object is a UML-Class. So the name of the UML class is the name of our new object.
We will create an object called Computer. Let's imagine that we have a database of computers in our office. We want to be able to get and update the Computers using the webservice.
1) Create an UML-Class object on the diagram.
2) Name it Computer.
3) Add attributes to the Computer
a) - computerID:int
b) - computerIP:string
c) - computerName:string
4) Add a method to the Computer - get the information about a computer from the database, according to the specified computerID. In operation tab add:
a) _getComputerInfo_
b) with parameter _computerID_ of type _int_
c) the operation should return an object _Computer_ - set type "Operation data"/"Type" _Computer_
Basically thats it. You can create a lot of parameters, change return type to 'int', 'string' or 'SomeOtherObject'. Add as many methods and objects as you need.
Object Lists
If you would like to get a list of Computers in an array format then we need to create a different complex type with SOAP-ENC:array. To create Computers list just add a stereotype to name to the object.
For example in the UML-Class "Computer" fill in the field "stereotype" with a name of the list in this case "Computers". This will generate a list of computers.
If you want to create a method to get a number of computers then: to the Computer class object add a method that is in a type of "Computers".