Skip to main content
Jump to: navigation, search

Difference between revisions of "Scout/Tutorial/3.7/Advanced Minicrm"

< Scout‎ | Tutorial‎ | 3.7
m (+ScoutPage)
Line 1: Line 1:
=Access Web Services with Scout Eclipse=  
=Access Web Services with Scout Eclipse=  

Revision as of 16:25, 1 July 2010

Wiki Home

Access Web Services with Scout Eclipse

Generate Web Service Classes

In Eclipse Scout in it is also pretty easy to access web services. We will use Bing as an example web service. See for more information.
Go to the server node of your Scout Project, expand the tree until you see the node Axis Web Service Consumers and select New Webservice consumer from the context menu. Paste the following API key into the WSDL URL field and click ok. An overview will pop-up which you acknowledge.

Consume the Web Service

In order to consume the web service add a new service operation to your StandardOutlineService with the following signature:
Object[][] getBingTableData(String query) throws ProcessingException

public Object[][] getBingTableData(String query) throws ProcessingException{
  String appId = "BE75364456DF97D980FFDC1420E46B941E7D01CB";
  LiveSearchServiceLocator soapClient = new LiveSearchServiceLocator();
  SearchRequest request = new SearchRequest();
  SourceType[] sources = {SourceType.Web};
  SearchResponse response;
    response = soapClient.getLiveSearchPort().search(new SearchRequestType1(request)).getParameters();
  } catch(Exception e){
    throw new ProcessingException(e.getMessage(), e);
  WebResult[] result = response.getWeb().getResults();
  Object[][] data = new Object[result.length][3];
  for (int row=0; row < data.length; row++) {
    data[row][0] = result[row].getUrl();
    data[row][1] = result[row].getTitle();
    data[row][2] = result[row].getDescription();
  return data;

Create the Client Table

Below your CompanyNodePage add a new BingTablePage, extending AbstractPageWithTable. In order to do that, you have to add a new variable to the CompanyNodePage containing the name of the company, which is used for calling the Bing-Service.

Back to the top