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

Difference between revisions of "Scout/SDK/JAXWS-SDK/Create webservice consumer"

< Scout‎ | SDK‎ | JAXWS-SDK
(Webservice Client)
(Webservice Client)
Line 16: Line 16:
  
 
== Webservice Client ==
 
== Webservice Client ==
Finally, you can change the default name and default package name of the Scout Service which is created to represent the webservice [http://wiki.eclipse.org/Image:Org.eclipse.scout.jaxws.CreateConsumer_50.png]. This is just like all other services in Scout. Basically, they are plain OSGi services which are registered in plugin.xml and are accessible by SERVICES#get(<service name>).
+
Finally, you can change the default name and default package name of the Scout Service which is created to represent the webservice [http://wiki.eclipse.org/Image:Org.eclipse.scout.jaxws.CreateConsumer_50.png]. This is just like all other services in Scout. Basically, they are plain OSGi services which are registered in plugin.xml and are accessible by SERVICES.get(XyWebServiceClient.class).
  
 
Also, you can choose to annotate the service with {{ScoutLink|Concepts|JAXWS-RT|ScoutWebServiceClient}}. This allows you to specify an authentication mechanism to be used when connecting to the endpoint service [http://wiki.eclipse.org/Image:Org.eclipse.scout.jaxws.CreateConsumer_55.png]. By default, you can choose from {{ScoutLink|Concepts|JAXWS-RT|BasicAuthenticationHandler}} and {{ScoutLink|Concepts|JAXWS-RT|WsseUsernameTokenAuthenticationHandler}} as authentication mechanism. If no authentication is to be applied, choose NONE as authentication mechanism.
 
Also, you can choose to annotate the service with {{ScoutLink|Concepts|JAXWS-RT|ScoutWebServiceClient}}. This allows you to specify an authentication mechanism to be used when connecting to the endpoint service [http://wiki.eclipse.org/Image:Org.eclipse.scout.jaxws.CreateConsumer_55.png]. By default, you can choose from {{ScoutLink|Concepts|JAXWS-RT|BasicAuthenticationHandler}} and {{ScoutLink|Concepts|JAXWS-RT|WsseUsernameTokenAuthenticationHandler}} as authentication mechanism. If no authentication is to be applied, choose NONE as authentication mechanism.

Revision as of 11:08, 9 November 2011

The Scout documentation has been moved to https://eclipsescout.github.io/. On server node, go to the node 'Webservices (JAX-WS RI 2.1.6)' | 'Consumer' | 'Services'. Right-click on that node to create a new webservice consumer [1].

Choose WSDL file

First, you are asked for a WSDL file to build the webservice stub for that webservice [2]. Thereto, you have 2 options: Either choose the WSDL file from local filesystem or specify the URL to the WSDL file to be downloaded. If the WSDL file consists of multiple files such as separate files for Port and Binding definitions as well as separate files for XSD Schema types, use the first option and specify those files as related files.

Choose Service and Port

In the next wizard step, you are asked to choose from the available Services and Ports [3] - service and port are used to uniquely resolve the port type to be used the by webservice consumer. If you are not sure which service or port to use, address to the webservice provider about their meaning and usage. Please note, that the port list is based on the service selection. By default, Scout SDK chooses the first service found in WSDL file and derives the associated port.

Control the Stub Generation Process

In the next wizard step, you have the possiblity to specify a custom package name for the stub files to be generated [4]. Please note, that the stub is generatged into a separate JAR-file, so the package name is not that important.

In general, you should not set a custom package because this instruments JAX-WS builder to not apply the default package name algorithm and to ignore any WSDL and schema binding customization for package name. Typically, the default package name algorithm derives the package name based on the targetNamespace of the webservice to be built. In some situations, this name might not be a valid Java package name and requires you to specify a custom package name.

Also, you can specify to create a binding file to customize JAX-WS default bindings [5]. By default, such a file is created. In the default binding-file, there is a global binding configured to unmarshall any xsd:date, xsd:time and xsd:dateTime to a java.util.Date represented as UTC time. If you do not choose to create such a binding-file, you can do it anytime later in Scout SDK. Please note that changes in the binding-file are to instrument the stub build process, meaning that changes require are rebuild of the webservice stub.

Webservice Client

Finally, you can change the default name and default package name of the Scout Service which is created to represent the webservice [6]. This is just like all other services in Scout. Basically, they are plain OSGi services which are registered in plugin.xml and are accessible by SERVICES.get(XyWebServiceClient.class).

Also, you can choose to annotate the service with The Scout documentation has been moved to https://eclipsescout.github.io/.. This allows you to specify an authentication mechanism to be used when connecting to the endpoint service [7]. By default, you can choose from The Scout documentation has been moved to https://eclipsescout.github.io/. and The Scout documentation has been moved to https://eclipsescout.github.io/. as authentication mechanism. If no authentication is to be applied, choose NONE as authentication mechanism.

Create Webservice Consumer
Choose WSDL file
Choose Service and Port from WSDL file
Specify custom package name and to create a binding file
Specify name and package for Consumer Service
Choose authentication method to provide user's credentials

Back to the top