Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
borderfalse
Column
width15%
Include Page
TUSCANYWIKI: Repeating Menu
TUSCANYWIKI: Repeating Menu
Include Page
TUSCANYWIKI: Java SCA Menu New
TUSCANYWIKI: Java SCA Menu New
Column
width85%
<binidng

<binding.ws>

The Tuscany Java SCA runtime supports Web services by using the <binding.ws> SCDL extension. New Web service endpoints can be created provided by using <binding.ws> in within a SCA <service>, existing Web services can be invoked by using <binding.ws> in within a SCA <reference>.

The Web service binding is one of the SCA extensions which has be formalized in the OASIS Open Composite Services Architecture with a published specifications document.

The Web service binding SCDL has the following format:

Code Block

<binding.ws name="NCName"? uri="xs:anyURI"? wsdlElement="xs:anyURI"? wsdli:wsdlLocation="list of xs:anyURI"? >
   <wsa:EndpointReference>...</wsa:EndpointReference>*
</binding.ws>

All the attributes and elements of the Web service binding are optional, so the simplest way to use it is:

Code Block
<binding.ws/>
Info
titleWhat will the endpoint be?

The actual Web service endpoint used depends on whether or not WSDL document has beed referenced and a WSDL port has been specified, if the EndpointReference element or the uri attribute of the <binding.ws> has been specified, or the names of the component and binding.

The actual alogrythim defined in the Web service binding specification is:

The rules for resolving the URI at which an SCA service is hosted, or SCA reference targets, when used with binding.ws (in precedence order) are:

  1. Either the URIs in the endpoint(s) of the referenced WSDL
    or the URI specified by the wsa:Address element of the wsa:EndpointReference
  2. The explicitly stated URI in the "uri" attribute of the binding.ws element, which may be relative,
  3. The implicit URI as defined by the Assembly specification

The URI in the WSDL endpoint or in the wsa:Address of an EPR may be a relative URI, in which case it is relative to the URI defined in (2) or (3). The wsa:Address element can be the empty relative URI, in which case it uses the URI defined in (2) or (3) directly. This allows the EPR writer to specify reference parameters, metadata and other EPR contents while allowing the URI to be chosen by the deployer. To reference a WSDL document and also specify an EPR, the wsdlElement attribute must refer to a binding element in the WSDL and not an endpoint or service.

Some examples:

This example shows making a HelloWorld component available as a Web service endpoint. All the Web service binding defaults are used so the endpoint of the Web service will be http://localhost:8080/HelloWorldComponentImage Added.

Code Block

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
           targetNamespace="http://helloworld"
           xmlns:hw="http://helloworld"
           name="helloworldws">

    <service name="HelloWorldService" promote="HelloWorldComponent">
       <interface.java interface="helloworld.HelloWorldService" />
       <binding.ws />
    </service>

    <component name="HelloWorldComponent">
        <implementation.java class="helloworld.HelloWorldImpl" />
    </component>

</composite>