You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Unable to render {include} The included page could not be found.
Unable to render {include} The included page could not be found.

<binding.ws>

The Tuscany Java SCA runtime supports Web services by using the <binding.ws> SCDL extension. New Web service endpoints can be provided by using <binding.ws> within a SCA <service>, existing Web services can be invoked by using <binding.ws> 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:

<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:

<binding.ws/>

What will the endpoint be?

The actual Web service endpoint used depends on whether or not a WSDL port is being used, if the EndpointReference element or the uri attribute of the <binding.ws> has been specified, and the names of the component and binding. The actual alogrythim defined in the Web service binding specification is:

  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/HelloWorldComponent.

<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>
  • No labels