General Approach To URI Construction in the SCA Domain
// Determine default URL if ( web app container) Default URL = web app base URL else if (Node URI provided) Default URL = Node URI else Default URL = look up free port for current host endif // Determine service binding URL if (Binding URI = Absolute) if ( web app container) Final Binding URI = Default URL + path from Binding URI else Final Binding URI = Binding URI endif else if ( binding URI = Relative ) Final Binding URI = Default URL + Binding URI else Final Binding URI = Default URL + Component Name [ + ServiceName] endif
Hierarchical URI Construction - Assembly Spec Section 1.7.2
Base System URI for Schema / Component URI / Service Binding URI
Base System URI for Schema
- Null - if not specified at all the Component/Binding URIs must be absolute
- Generated by the runtime based on free ports - useful in the standalone case
- Defined on a node by node basis
<component name="NodeA"> <t:implementation.node composite="store:store"/> <service name="Default"> <binding.sca uri="http://myhost1:8080"/> <binding.ws uri="http://myhost1:8080"/> <binding.ws uri="https://myhost1:443"/> </service> </component>
- Defined at the domain level - would seem to be a virtualization strategy. Tuscany doesn't do this yet
Component URI
- Null - if the service is at the domain level
- Name of component
<component name="ComponentName">
- Specified URI value
<component uri="ComponentURI">
Service Binding URI
- Null - if only one service is specified
- Name of binding if no binding URI provided. If more than one binding relies on this for a service then need to make these names unique
<binding.ws name="BindingName"/>
- Relative URI
<binding.ws uri="BindingRelativeURI"/>
- AbsoluteURI -
<binding.ws uri="http://MyHost:8080/BindingAbsoluteURI"/>
binding.ws Specific Rules
The following is work in progress and still under construction.
// Web Service binding spec rules 1a. (mutually exclusive with 1b) @wsdlElement specifying wsdl.port, wsdl.service, or wsdl.endpoint 1b. (mutually exclusive with 1a) wsa:EndpointReference and @wsdlElement specifying wsdl.binding 2. @uri value (together with any relative URI from 1a or 1b) 3. implicit URI as defined by Assembly spec (together with any relative URI from 2) // pseudo-code spec for above if (@wsdlElement specifies wsdl.port, wsdl.service, or wsdl.endpoint) if (wsa:EndpointReference specified) raise invalid definition error else if (WSDL endpoint is absolute) use WSDL endpoint else // WSDL endpoint is relative if (@uri specified) if (@uri is absolute) use WSDL endpoint relative to @uri else // @uri is relative use WSDL endpoint relative to @uri relative to implicit URI else use WSDL endpoint relative to implicit URI else if (wsa:EndpointReference specified) if (wsa:EndpointReference has absolute address) use wsa:EndpointReference metadata and address else if (wsa:EndpointReference has relative address) if (@uri specified) if (@uri is absolute) use wsa:EndpointReference metadata and address relative to @uri else // @uri is relative use wsa:EndpointReference ametadata and address relative to @uri relative to implicit URI else use wsa:EndpointReference metadata and address relative to implicit URI else // wsa:EndpointReference has null address if (@uri specified) if (@uri is absolute) use wsa:EndpointReference metadata with @uri else // @uri is relative use wsa:EndpointReference metadata with @uri relative to implicit URI else use wsa:EndpointReference metadata with implicit URI else // wsa:EndpointReference not specified if (@uri specified) if (@uri is absolute) use @uri else // @uri is relative use @uri relative to implicit URI else use implicit URI // pseudo-code algorithm for above if (@wsdlElement specifies wsdl.port, wsdl.service, or wsdl.endpoint) if (wsa:EndpointReference specified) raise invalid definition error else uri = WSDL endpoint wsaMetadata = null else if (wsa:EndpointReference specified) uri = wsa:EndpointReference address wsaMetadata = wsa:EndpointReference metadata else uri = empty string wsaMetadata = null if (uri is relative || uri is empty) if (@uri specified) uri = @uri + uri if (uri is relative || uri is empty) uri = implicitURI + uri // observations on the current code 1. When the <binding.ws> element contains a wsa:EndpointReference, WebServiceBindingProcessor reports an error if wsdlElement/wsdl.binding is used. It should report an error if wsdlElement/wsdl.{port,service,endpoint} is used. 2. When computing the actual URI for a service, the computeActualURI() method in Axis2ServiceProvider doesn't handle wsa:EndpointReference correctly. The address is always taken as an absolute URI. The spec allows it to be a relative URI or a null string. 4. The getWSATOEPR() method gives explicit URIs priority over WSDL port definitions. It should be the other way round. 5. Service callback binding URI specifications (e.g., port assignments) are ignored, because of the code in JDKCallbackInvocationHandler that sets the URI into the wire's binding and overwites any statically configured URI that is already there. I don't know which of these URIs should take priority. // list of use cases with comments service, no WSDL endpoint or wsa:EndpointReference, no URI - the relative URI is computed by CompositeConfigurationBuilderImpl service, no WSDL endpoint or wsa:EndpointReference, relative URI - the relative URI is computed by CompositeConfigurationBuilderImpl service, no WSDL endpoint or wsa:EndpointReference, absolute URI - the absolute URI is computed by CompositeConfigurationBuilderImpl - the host name is ignored when registering it with the servlet container - the port number is preserved when registering it with the servlet container service, relative WSDL endpoint and no wsa:EndpointReference - the WSDL endpoint is relative to the base URI computed as above service, absolute WSDL endpoint and no wsa:EndpointReference - the WSDL endpoint is used in preference to any URI specified service, relative wsa:EndpointReference and no WSDL endpoint - the endpoint reference is relative to the base URI computed as above - (bug) error reported if wsdlElement/wsdl.binding specified - (bug) endpoint treated as absolute and not combined with the URI service, absolute wsa:EndpointReference and no WSDL endpoint - the endpoint reference is used in preference to any URI specified - (bug) error reported if wsdlElement/wsdl.binding specified service, wsa:EndpointReference and WSDL endpoint - not allowed - (bug) no error reported if wsdlElement/{port,service,endpoint} specified reference, no WSDL endpoint or wsa:EndpointReference, absolute URI - the absolute URI addresses an endpoint outside the SCA domain reference, no WSDL endpoint or wsa:EndpointReference, relative URI or target - the URI addresses an SCA target service within the domain - the protocol URI for the reference is the URI of the target service - (bug: TUSCANY-1534) not currently supported reference, no WSDL endpoint or wsa:EndpointReference, no URI - the reference is not usable (unless promoted or wiredByImpl) reference, relative WSDL endpoint and no wsa:EndpointReference, absolute URI - the absolute URI addresses an endpoint outside the SCA domain - the WSDL endpoint is relative to the absolute URI - (bug) relative WSDL endpoint ignored, absolute URI used reference, relative WSDL endpoint and no wsa:EndpointReference, relative URI or target - WSDL endpoint should be relative to resolved protocol URI (need spec clarification) - (bug: TUSCANY-1534) not currently supported - (bug) relative WSDL endpoint ignored reference, relative WSDL endpoint and no wsa:EndpointReference, no URI - WSDL endpoint should be relative to implicit protocol URI (need spec clarification) - relative WSDL endpoint addresses an endpoint outside the SCA domain reference, absolute WSDL endpoint and no wsa:EndpointReference, explicit URI - the WSDL endpoint is used and the URI is ignored - (bug) the WSDL endpoint ignored and the URI is used reference, absolute WSDL endpoint and no wsa:EndpointReference, no URI - the WSDL endpoint is used reference, relative wsa:EndpointReference and no WSDL endpoint, absolute URI - the absolute URI addresses an endpoint outside the SCA domain - the endpoint reference is relative to the absolute URI - (bug) error reported if wsdlElement/wsdl.binding specified - (bug) relative endpoint reference used, absolute URI ignored reference, relative wsa:EndpointReference and no WSDL endpoint, relative URI or target - endpoint reference should be relative to resolved protocol URI (need spec clarification) - (bug) error reported if wsdlElement/wsdl.binding specified - (bug: TUSCANY-1534) not currently supported - (bug) relative endpoint reference used, URI ignored reference, relative wsa:EndpointReference and no WSDL endpoint, no URI - WSDL endpoint should be relative to implicit protocol URI (need spec clarification) - relative endpoint reference addresses an endpoint outside the SCA domain - (bug) error reported if wsdlElement/wsdl.binding specified reference, absolute wsa:EndpointReference and no WSDL endpoint, explicit URI - the endpoint reference is used and the URI is ignored - (bug) error reported if wsdlElement/wsdl.binding specified reference, absolute wsa:EndpointReference and no WSDL endpoint, no URI - the endpoint reference is used - (bug) error reported if wsdlElement/wsdl.binding specified reference, wsa:EndpointReference and WSDL endpoint - not allowed - (bug) no error reported if wsdlElement/{port,service,endpoint} specified
Other Binding Specific Rules
???