Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Scout/Tutorial/3.8/webservices/Change WSDL file to return a list of companies

< Scout‎ | Tutorial‎ | 3.8
Revision as of 07:06, 10 November 2011 by Daniel.wiehl.yahoo.com (Talk | contribs) (Remove input parameter)

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:

Org.eclipse.scout.jaxws.tutorial.EditWsdl 10.png

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 [1]. That opens you the getCompaniesResponse element of that parameter [2]. 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' [3]. Chose Complex Type and give it the name Company [4]. Right-click on the out element and change the multiplicity to 0..* [5]. That allows you to return zero or more company objects [6]. Open the 'Schema Index View' by clicking on the schema link on the very top-left corner [7]. In type 'Types'-section you find the Company type which we created before. Double-click on the Company type to open it [8]. What you see is an empty complex type. Right-click on the element's name to add the two child elements name and symbol[9]. The element Name will hold the company name and the element symbol its stock symbol. It should look like this: [10]. 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 [11]. There you see the anonymous getCompaniesType with in as its child element [12]. To get rid of this, right-click on the getCompanies element and choose 'Set Type' | 'New' [13]. A dialog will pop up to create the new type. Choose 'Create a local anonymous type' and click OK [14]. As a result, the getCompanies element will look like this: [15].




On server node, go to the node 'Webservices (JAX-WS RI 2.1.6)' | 'Provider' | 'Services'. Right-click on that node to create a new webservice provider [16]. In the first wizard step, choose the 1st option to create a webservice provider from scratch, meaning not based on an existing WSDL file [17]. Click next to enter the WSDL name which is CompanyWebService.wsdl. Also, change the name for the service operation to getCompanies [18]. Click Finish to create the webservice provider. The Scout documentation has been moved to https://eclipsescout.github.io/. to learn more about webservice provider creation. In case you encounter problems to build the webservice stub, refer to the The Scout documentation has been moved to https://eclipsescout.github.io/. for more information. Please find the created webservice provider CompanyWebService in Scout Explorer [19]. In the Scout Property View of this provider, you can access the various files such as the WSDL file, implementation class or the JAX-WS service type. Also, there you find links to rebuild the webservice stub, to change build properties for stub generation process, to edit binding customization files and more. Also, the authentication mechanism can be changed in the section Authentication and session context. For more information on that Property View, please The Scout documentation has been moved to https://eclipsescout.github.io/..

So far, our webservice consists of a single operation to return companies. To open the WSDL file in the WSDL editor, click on the link 'CompanyWebService.wsdl' in the Scout Property View [20], To open the implementing port type, double click the webservice node or click on the 'CompanyWebService' link in the PropertyView [21]. As you can see, this webservice consists of a single operation getCompanies with a String as its return value and a String as its parameter. We will change that to return a list of company objects with no input parameter. Because this webservice is a Contract-First webservice, meaning that we are designing the WSDL file by ourself rather than generating it based on Java classes, open the WSDL editor [22] to change the service. Click The Scout documentation has been moved to https://eclipsescout.github.io/. to follow detailed instructions.


Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer
Create webservice consumer

Back to the top