<?xml version="1.0" encoding="UTF-8" ?>
<schema targetNamespace="http://xmlns.oracle.com/weblogic/weblogic-sca-binding"
        xmlns:sca="http://xmlns.oracle.com/weblogic/weblogic-sca-binding" 
        xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
        xmlns="http://www.w3.org/2001/XMLSchema"
        attributeFormDefault="unqualified"
        elementFormDefault="qualified"
        version="1.0">

  <import namespace="http://schemas.xmlsoap.org/ws/2004/09/policy" schemaLocation="http://schemas.xmlsoap.org/ws/2004/09/policy/ws-policy.xsd"/> 
  <element name="binding.ws" substitutionGroup="sca:binding" type="sca:WSBindingModel" >
  	<annotation>
  		<documentation>
The Web Service binding (binding.ws) can be applied to SCA services and references. It does the following:
    *For service bindings, publishes "Plain Old Java Object" (POJO) "services" as Web Services.
    *Parses the binding.ws element and generates a WSDL of the service to be published or the reference to be invoked. (This includes policy references.)
    *Publishes the service as a JAX-WS Web Service.
    *Accepts request for the published services and performs reference invocations to the Web Services.
  		</documentation>
  	</annotation>
  </element>
 
  <complexType name="WSBindingModel">
    <complexContent mixed="false">
      <extension base="sca:Binding">
        <sequence>
          <element minOccurs="0" maxOccurs="unbounded" ref="wsp:PolicyReference" >
          	<annotation>
          		<documentation>
Specifies a reference to the security policy to use.
The following security mechanisms are supported:
    *Username token with message protection (WS-Security 1.1)
    *X509 certificate authentication with message protection (WS-Security 1.1)
    *Anonymous with message protection (WS-Security 1.1)
    *ID Propagation using SAML token (sender-vouches) with message protection (WS-Security 1.1)
    *Username token over SSL
    *SAML token (Sender Vouches) over SSL
          		</documentation>
          	</annotation>
          </element>
          <element minOccurs="0" maxOccurs="unbounded" name="property" type="sca:Property"> 
              <annotation>
              <documentation>
                Valid properties are:
                a) weblogic.sca.binding.ws.sdoSchemaFile - property to specify the location of the schema file for SDO bindings. Used (and required) only if using databinding=toplink.sdo in binding.ws. The path must be relative to the application root, and the schema file must be bundled with the app
                b) weblogic.sca.binding.ws.externalCustomizationFile - property to specify an external databinding customization XML file. This can be used to provide additional information on the web service binding
                One example scenario of the use of the customization file is when your contract class for a SCA service contains overloaded methods that you want to expose as web service operations. In this case, the customization file can be used to disambiguate operation names for the web service. 
The path must be relative to the application root, and the customization file must be bundled with the app.
                c) weblogic.sca.binding.ws.referenceWsdlCacheTimeoutMins - property to set a timeout (in minutes) for wsdl caching when invoking references. References to wsdls are cached by default to provide better performance for high volume applications. If this property is unspecified, 
the timeout (i.e. refresh interval) for cached wsdls is assumed to be 60 minutes. This property can be set to zero to disable caching 
                d) weblogic.sca.binding.ws.usingOwsmPolicies - property to indicate whether the PolicyReference supplied in binding.ws is an OWSM policy or not. This property is optional and defaults to false.
              </documentation>
              </annotation>
        </element>
        </sequence>
        <attribute name="port" type="anyURI" use="optional" >
			<annotation>
				<documentation>
					For sca:service, indicate the port name to use for the service endpoint. For sca:reference, specifies the WSDL port that this reference points to in the external Web Service. This should be of the form namespace uri#wsdl.endpoint(servicename/portname)				
				</documentation>
			</annotation>
        </attribute>
        <attribute name="location" type="string" use="optional">
        	<annotation>
        		<documentation>
					Required for sca:reference bindings only. Specifies the location (that is, URL) where the external reference can be found. The WSDL must be made available by appending ?wsdl to this location.
        		</documentation>
        	</annotation>
        </attribute>
        <attribute name="soapVersion" type="sca:SOAPVersion" use="optional">
            <annotation>
	            <documentation>
	                 The soapVersion of the web service - valid values are 1.1 and 1.2. Defaults to 1.1. 
	            </documentation>
            </annotation>
        </attribute>
        <attribute name="databinding" type="string" use="optional">
            <annotation>
	            <documentation>
	               The type of databinding to use - defaults to "toplink.jaxb", other options are "glassfish.jaxb" and "toplink.sdo" (Note that the schema required for SDO databinding will be supplied as a property in the binding) 
	            </documentation>
            </annotation>
        </attribute>
        <!-- next 2 attributes supported by Oracle SOA but not initially supported in JSCALite standalone -->
        <attribute name="streamIncomingAttachments" type="boolean" use="optional" />
        <attribute name="streamOutgoingAttachments" type="boolean" use="optional" />
      </extension>
    </complexContent>
  </complexType>
  <element name="binding.ejb" substitutionGroup="sca:binding" type="sca:EJBBindingModel" >
	<annotation>
		<documentation>
The EJB session bean binding can be applied to both SCA services and SCA references.

Binding to Services: 
When binding.ejb is configured on an SCA service, an implementation of the service interface becomes available in JNDI when the application is deployed. That service can then be invoked using the EJB programming model. For example, this allows a client to look up and invoke the service as if the underlying service were a deployed EJB. This may be useful in a situation where you want to replace an existing EJB service with an SCA implementation, without requiring clients of the legacy EJB to be updated.
Only the EJB3 programming model is supported for EJB session bean service bindings.		
Use the uri attribute of binding.ejb to specify the JNDI name.
All EJB service bindings are remote and can therefore be looked up and invoked remotely.
Remote service implementations are clusterable. You can configure a client timeout for service bindings. To specify a client timeout, edit the EJBServiceDelegateImplRTD.xml file located in the binding.ejb jar file.
        
Binding to References: 
When binding.ejb is configured on an SCA reference, the target EJB is resolved and invoked without any knowledge of the EJB programming model. (WebLogic SCA Runtime determines the programming model of the target EJB based on whether the object returned from the JNDI lookup implements javax.ejb.EJBHome.)
The target EJB is resolved lazily, that is, it is resolved at runtime as necessary to service an invocation.
This allows an SCA POJO implementation to invoke a deployed EJB in the same way it invokes any other SCA reference. WebLogic SCA Runtime looks up the target EJB from JNDI and delegates any method calls to the EJB. Using binding.ejb in this way provides the flexibility to replace an EJB service with a non-EJB service without having to update the dependent component implementation.
		</documentation>
	</annotation>
  </element>
  <complexType name="EJBBindingModel">
    <complexContent mixed="false">
      <extension base="sca:Binding">
        <attribute name="remote" type="string" use="optional" >
        	<annotation>
        		<documentation>
No longer in use. All EJB bindings are now considered remote and the implementation completely disregards the "remote" attribute.
        		</documentation>
        	</annotation>
        </attribute>
      </extension>
    </complexContent>
  </complexType>
  <element abstract="true" name="binding" type="sca:Binding" />
  <complexType name="Binding">
    <attribute name="name" type="string" use="optional" >
    	<annotation>
    		<documentation>
Optional. Specifies the name of the binding. For Web Service bindings, if supplied, 
it will be used as the service name for the web service in the WSDL  		
    		</documentation>
    	</annotation>
    </attribute>
    <attribute name="uri" type="anyURI" use="optional" >
    	<annotation>
    		<documentation>
Required. 
      
For EJB bindings on references, uri specifies the JNDI name of the target EJB. For EJB bindings on services, the uri value is the JNDI name at which the EJB is bound.
Advanced CORBA name URIs are not supported. The following two simplified patterns are supported. Both result in the service implementation being bound to the JNDI name ejb/MyHome:
* uri="corbaname:rir:#ejb/MyHome"
* uri="ejb/MyHome". 
      
For Web Service bindings, it is required for sca:service bindings only. Specifies the location, relative to the context-root of the SCA application, where the Web Service must be published for this SCA service.
    		</documentation>
    	</annotation>
    </attribute>
  </complexType>
  <simpleType name="SOAPVersion">
    <restriction base="string">
      <enumeration value="1.1" />
      <enumeration value="1.2" />
    </restriction>
  </simpleType>
  <simpleType name="OverrideOptions">
    <restriction base="string">
      <enumeration value="no" />
      <enumeration value="may" />
      <enumeration value="must" />
    </restriction>
  </simpleType>
  <complexType name="Property">
    <simpleContent>
      <extension base="string">
        <attribute name="name" type="NCName" use="required" />
        <attribute name="type" type="QName" use="optional" />
        <attribute default="false" name="many" type="boolean" use="optional" />
        <attribute name="source" type="string" use="optional" />
        <attribute default="may" name="override" type="sca:OverrideOptions" use="optional" />
      </extension>
    </simpleContent>
  </complexType>
</schema>
