SCA Java binding.ws (TUSCANY) edited by ant
      Page: 
http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+binding.ws
   Changes: 
http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=55963&originalVersion=9&revisedVersion=10






Content:
---------------------------------------------------------------------

{section:border=false}
{column:width=15%}
{include: SCA Java Subproject Menu}
{include: Java SCA Menu New}
{column}
{column:width=85%}

h3. <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 is being formalized 
in the OASIS Open Composite Services Architecture with a published 
[specifications |http://www.oasis-opencsa.org/sca-bindings] document.

The Web service binding SCDL has the following format:

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

h4. simple use

All the attributes and elements of the Web service binding are optional, so the 
simplest way to use it is to use all the defaults:
{code}<binding.ws/>{code}

With that simplest form the endpoint which will be used is derived from the 
names of the component and binding. This works well for services but for 
references its likely not what you want, so with references the following is a 
more useful simplest form:
{code}<binding.ws uri="http://someHost/someService"/>{code}

h4. wsdlElement

The wsdlElement attribute indicates that a WSDL document exists which should be 
used and it points to the element within that WSDL to use. The value of the 
wsdlElement attribute can have one of the following four forms:

# Service:
 <WSDL-namespace-URI>#wsdl.service(<service-name>)
 In this case, all the endpoints in the WSDL Service that have equivalent 
PortTypes with the SCA service or reference must be available to the SCA 
service or reference.
# Port (WSDL 1.1):
 <WSDL-namespace-URI>#wsdl.port(<service-name>/<port-name>)
 In this case, the identified port in the WSDL 1.1 Service must have an 
equivalent PortType with the SCA service or reference.
# Endpoint (WSDL 2.0):
 <WSDL-namespace-URI>#wsdl.endpoint(<service-name>/<endpoint-name>)
 In this case, the identified endpoint in the WSDL 2.0 Service must have an 
equivalent PortType with the SCA service or reference.
# Binding:
 <WSDL-namespace-URI>#wsdl.binding(<binding-name>)
 In this case, the identified WSDL binding must have an equivalent PortType 
with the SCA service or reference. In this case the endpoint address URI for 
the SCA service or reference must be provided via the URI attribute on the 
binding.

{info:title=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: 

# Either the URIs in the endpoint(s) of the referenced WSDL
  or the URI specified by the wsa:Address element of the wsa:EndpointReference
# The explicitly stated URI in the "uri" attribute of the binding.ws element, 
which may be relative,
# 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.
{info}

h4. wsdlLocation

The wsdlLocation attribute enables defining the location of the WSDL document 
to be used. Using wsdlLocation is not normally necessary as the Tuscany 
contrabution service will have discovered all the WSDL documents within a 
deployed SCA contrabution.

h4. wsa:EndpointReference

This attribute enables using a WS-Addressing EndpointReference that specifies 
the endpoint for the service or reference, or any WSA reference parameters, 
metadata and other EPR contents to be used.

h3. 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.

{code}
<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>
{code}


{column}
{section}

---------------------------------------------------------------------
CONFLUENCE INFORMATION
This message is automatically generated by Confluence

Unsubscribe or edit your notifications preferences
   http://cwiki.apache.org/confluence/users/viewnotifications.action

If you think it was sent incorrectly contact one of the administrators
   http://cwiki.apache.org/confluence/administrators.action

If you want more information on Confluence, or have a bug to report see
   http://www.atlassian.com/software/confluence



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to