Scout/Tutorial/3.9/webservices/Change WSDL file to return a list of companies
|Download • Git|
|Forums • Blog • Twitter|
Open the WSDL file in the built-in Eclipse WSDL editor. This editor is part of the WTP project of Eclipse. If not available on your IDE, update your Eclise IDE accordingly.
The WSDL file should look as following:
What you see is your webservice, that has one service included which is bound to your CompanyWebServicePortType. For more information on that topic, please refer to [http://www.w3.org/TR/wsdl.
Change output parameter
To change the output parameter, click on the arrow-link on the very right side of the output parameter . That opens you the
getCompaniesResponse element of that parameter . On the right side, you see the anonymous type
getCompaniesResponseType associated with the response element. There you find the
out element. Left-click on its datatype (string) and choose 'New' . Chose
Complex Type and give it the name
Company . Right-click on the
out element and change the multiplicity to
0..* . That allows you to return zero or more company objects .
Open the 'Schema Index View' by clicking on the schema link on the very top-left corner . In type 'Types'-section you find the
Company type which we created before. Double-click on the
Company type to open it . What you see is an empty complex type. Right-click on the element's name to add the two child elements
symbol. The element
Name will hold the company name and the element
symbol its stock symbol. It should look like this: . Save the WSDL.
Remove input parameter
To remove the input parameter, click on the arrow-link on the very right side of the input parameter . There you see the anonymous
in as its child element . To get rid of this, right-click on the
getCompanies element and choose 'Set Type' | 'New' . A dialog will pop up to create the new type. Choose 'Create a local anonymous type' and click OK . As a result, the
getCompanies element will look like this: .