alanb@368: /* katleman@374: * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. katleman@374: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. alanb@368: * katleman@374: * This code is free software; you can redistribute it and/or modify it katleman@374: * under the terms of the GNU General Public License version 2 only, as katleman@374: * published by the Free Software Foundation. Oracle designates this katleman@374: * particular file as subject to the "Classpath" exception as provided katleman@374: * by Oracle in the LICENSE file that accompanied this code. alanb@368: * katleman@374: * This code is distributed in the hope that it will be useful, but WITHOUT katleman@374: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or katleman@374: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License katleman@374: * version 2 for more details (a copy is included in the LICENSE file that katleman@374: * accompanied this code). alanb@368: * katleman@374: * You should have received a copy of the GNU General Public License version katleman@374: * 2 along with this work; if not, write to the Free Software Foundation, katleman@374: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. alanb@368: * katleman@374: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA katleman@374: * or visit www.oracle.com if you need additional information or have any katleman@374: * questions. alanb@368: */ alanb@368: alanb@368: package com.oracle.webservices.internal.api.databinding; alanb@368: alanb@368: import java.lang.reflect.Method; alanb@368: import java.net.URL; alanb@368: alanb@368: import javax.xml.namespace.QName; alanb@368: import javax.xml.transform.Source; alanb@368: import javax.xml.ws.WebServiceFeature; alanb@368: alanb@368: import org.xml.sax.EntityResolver; alanb@368: alanb@368: import com.oracle.webservices.internal.api.message.MessageContext; alanb@368: alanb@368: /** alanb@368: * {@code Databinding} is the entry point for all the WebService Databinding alanb@368: * functionality. Primarily, a Databinding is to serialize/deserialize an alanb@368: * XML(SOAP) message to/from a JAVA method invocation and return which are alanb@368: * represented as JavaCallInfo instances. A WSDLGenerator can alanb@368: * be created from a Databinding object to genreate WSDL representation of alanb@368: * a JAVA service endpoint interface. alanb@368: *

alanb@368: *

alanb@368: * The supported databinding modes(flavors) are: alanb@368: * alanb@368: *
Following is an example that creates a {@code Databinding} which alanb@368: * provides the operations to serialize/deserialize a JavaCallInfo to/from a alanb@368: * SOAP message:
alanb@368: * alanb@368: *
alanb@368:  * DatabindingFactory factory = DatabindingFactory.newInstance();
alanb@368:  * Databinding.Builder builder = factory.createBuilder(seiClass, endpointClass);
alanb@368:  * Databinding databinding = builder.build();
alanb@368:  * 
alanb@368: * alanb@368: *
alanb@368: * alanb@368: * @see com.oracle.webservices.internal.api.databinding.DatabindingFactory alanb@368: * alanb@368: * @author shih-chang.chen@oracle.com alanb@368: */ alanb@368: public interface Databinding { alanb@368: alanb@368: /** alanb@368: * Creates a new instance of a JavaCallInfo. alanb@368: * alanb@368: * @param method The JAVA method alanb@368: * @param args The parameter objects alanb@368: * alanb@368: * @return New instance of a JavaCallInfo alanb@368: */ alanb@368: JavaCallInfo createJavaCallInfo(Method method, Object[] args); alanb@368: alanb@368: /** alanb@368: * Serializes a JavaCallInfo instance representing a JAVA method call to a alanb@368: * request XML(SOAP) message. alanb@368: * alanb@368: * @param call The JavaCallInfo representing a method call alanb@368: * alanb@368: * @return The request XML(SOAP) message alanb@368: */ alanb@368: MessageContext serializeRequest(JavaCallInfo call); alanb@368: alanb@368: /** alanb@368: * Deserializes a response XML(SOAP) message to a JavaCallInfo instance alanb@368: * representing the return value or exception of a JAVA method call. alanb@368: * alanb@368: * @param message The response message alanb@368: * @param call The JavaCallInfo instance to be updated alanb@368: * alanb@368: * @return The JavaCallInfo updated with the return value or exception of a alanb@368: * JAVA method call alanb@368: */ alanb@368: JavaCallInfo deserializeResponse(MessageContext message, JavaCallInfo call); alanb@368: alanb@368: /** alanb@368: * Deserializes a request XML(SOAP) message to a JavaCallInfo instance alanb@368: * representing a JAVA method call. alanb@368: * alanb@368: * @param message The request message alanb@368: * alanb@368: * @return The JavaCallInfo representing a method call alanb@368: */ alanb@368: JavaCallInfo deserializeRequest(MessageContext message); alanb@368: alanb@368: /** alanb@368: * Serializes a JavaCallInfo instance representing the return value or alanb@368: * exception of a JAVA method call to a response XML(SOAP) message. alanb@368: * alanb@368: * @param call The JavaCallInfo representing the return value or exception alanb@368: * of a JAVA method call alanb@368: * alanb@368: * @return The response XML(SOAP) message alanb@368: */ alanb@368: MessageContext serializeResponse(JavaCallInfo call); alanb@368: alanb@368: /** alanb@368: * Gets the MessageContextFactory alanb@368: * alanb@368: * @return The MessageContextFactory alanb@368: */ alanb@368: //Wait for WLS/src1212 - wls.jaxrpc wrapper alanb@368: // MessageContextFactory getMessageContextFactory(); alanb@368: alanb@368: /** alanb@368: * {@code Databinding.Builder}, created from the DatabindingFactory, is used to alanb@368: * configure how a Databinding instance is to be built from this builder. alanb@368: * alanb@368: * @see com.oracle.webservices.internal.api.databinding.DatabindingFactory alanb@368: * @author shih-chang.chen@oracle.com alanb@368: */ alanb@368: public interface Builder { alanb@368: alanb@368: /** alanb@368: * Sets the targetNamespace of the WSDL alanb@368: * alanb@368: * @param targetNamespace The targetNamespace to set alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder targetNamespace(String targetNamespace); alanb@368: alanb@368: /** alanb@368: * Sets the service name of the WSDL alanb@368: * alanb@368: * @param serviceName The serviceName to set alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder serviceName(QName serviceName); alanb@368: alanb@368: /** alanb@368: * Sets the port name of the WSDL alanb@368: * alanb@368: * @param portName The portName to set alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder portName(QName portName); alanb@368: alanb@368: /** alanb@368: * @deprecated - no replacement - this was never implemented alanb@368: * alanb@368: * Sets the WSDL URL where the WSDL can be read from alanb@368: * alanb@368: * @param wsdlURL The wsdlURL to set alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder wsdlURL(URL wsdlURL); alanb@368: alanb@368: /** alanb@368: * @deprecated - no replacement - this was never implemented alanb@368: * alanb@368: * Sets the WSDL Source where the WSDL can be read from alanb@368: * alanb@368: * @param wsdlSource The wsdlSource to set alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder wsdlSource(Source wsdlSource); alanb@368: alanb@368: /** alanb@368: * @deprecated - no replacement - this was never implemented alanb@368: * alanb@368: * Sets the {@link EntityResolver} for reading the WSDL alanb@368: * alanb@368: * @param entityResolver The {@link EntityResolver} to set alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder entityResolver(EntityResolver entityResolver); alanb@368: alanb@368: /** alanb@368: * Sets the ClassLoader which is used to load the service endpoint alanb@368: * interface, implementation bean, and all the value types. If this alanb@368: * value is not set, the default it uses contractClass.getClassLoader(). alanb@368: * alanb@368: * @param classLoader The classLoader to set alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder classLoader(ClassLoader classLoader); alanb@368: alanb@368: /** alanb@368: * Sets A list of WebServiceFeatures alanb@368: * alanb@368: * @param features The list of WebServiceFeatures alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder feature(WebServiceFeature... features); alanb@368: alanb@368: /** alanb@368: * Sets A property of the Databinding object to be created alanb@368: * alanb@368: * @param name The name of the property alanb@368: * @param value The value of the property alanb@368: * alanb@368: * @return this Builder instance alanb@368: */ alanb@368: Builder property(String name, Object value); alanb@368: alanb@368: /** alanb@368: * Builds a new Databinding instance alanb@368: * alanb@368: * @return The Builder instance alanb@368: */ alanb@368: Databinding build(); alanb@368: alanb@368: /** alanb@368: * Creates the WSDLGenerator which can be used to generate the WSDL alanb@368: * representation of the service endpoint interface of this Databinding alanb@368: * object. alanb@368: * alanb@368: * @return WSDLGenerator The WSDLGenerator alanb@368: */ alanb@368: com.oracle.webservices.internal.api.databinding.WSDLGenerator createWSDLGenerator(); alanb@368: } alanb@368: }