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

aoqi@0: *

aoqi@0: * Each Databinding is associated with a MessageFactory instance aoqi@0: * which can be used to create Message instances that can be aoqi@0: * deserialized by the Databinding. The MessageFactory also supports aoqi@0: * the conversion of Oracle Fabric Normalized messages. aoqi@0: *

aoqi@0: *

aoqi@0: *
Following is an example that creates a {@code Databinding} which aoqi@0: * provides the operations to serialize/deserialize a JavaCallInfo to/from a aoqi@0: * SOAP message:
aoqi@0: * aoqi@0: *
aoqi@0:  * DatabindingFactory wsfac = DatabindingFactory();
aoqi@0:  * Databinding rt = wsfac.createDatabinding(DatabindingConfig);
aoqi@0:  * 
aoqi@0: * aoqi@0: *
aoqi@0: * aoqi@0: * @author shih-chang.chen@oracle.com aoqi@0: */ aoqi@0: public interface Databinding extends com.oracle.webservices.internal.api.databinding.Databinding { aoqi@0: aoqi@0: /** aoqi@0: * Gets the MessageFactory instance associated with this WsRuntime aoqi@0: * aoqi@0: * @return the MessageFactory instance associated with this WsRuntime aoqi@0: */ aoqi@0: // MessageFactory getMessageFactory(); aoqi@0: aoqi@0: /** aoqi@0: * Deserializes a request XML(SOAP) message to a JavaCallInfo instance aoqi@0: * representing a JAVA method call. aoqi@0: * aoqi@0: * @param soap aoqi@0: * the request message aoqi@0: * aoqi@0: * @return the JavaCallInfo representing a method call aoqi@0: */ aoqi@0: // JavaCallInfo deserializeRequest(Packet req); aoqi@0: aoqi@0: EndpointCallBridge getEndpointBridge(Packet soap) throws DispatchException; aoqi@0: aoqi@0: ClientCallBridge getClientBridge(Method method); aoqi@0: aoqi@0: /** aoqi@0: * Serializes a JavaCallInfo instance representing a JAVA method call to a aoqi@0: * request XML(SOAP) message. aoqi@0: * aoqi@0: * @param call aoqi@0: * the JavaCallInfo representing a method call aoqi@0: * aoqi@0: * @return the request XML(SOAP) message aoqi@0: */ aoqi@0: // Packet serializeRequest(JavaCallInfo call); aoqi@0: aoqi@0: /** aoqi@0: * Serializes a JavaCallInfo instance representing the return value or aoqi@0: * exception of a JAVA method call to a response XML(SOAP) message. aoqi@0: * aoqi@0: * @param call aoqi@0: * the JavaCallInfo representing the return value or exception of aoqi@0: * a JAVA method call aoqi@0: * aoqi@0: * @return the response XML(SOAP) message aoqi@0: */ aoqi@0: // Packet serializeResponse(JavaCallInfo call); aoqi@0: aoqi@0: /** aoqi@0: * Deserializes a response XML(SOAP) message to a JavaCallInfo instance aoqi@0: * representing the return value or exception of a JAVA method call. aoqi@0: * aoqi@0: * @param soap aoqi@0: * the response message aoqi@0: * aoqi@0: * @param call aoqi@0: * the JavaCallInfo instance to be updated aoqi@0: * aoqi@0: * @return the JavaCallInfo updated with the return value or exception of a aoqi@0: * JAVA method call aoqi@0: */ aoqi@0: // JavaCallInfo deserializeResponse(Packet res, JavaCallInfo call); aoqi@0: aoqi@0: /** aoqi@0: * Gets the WSDL operation metadata of the specified JAVA method. aoqi@0: * aoqi@0: * @param method aoqi@0: * the JAVA method aoqi@0: * @return the operationMetadata aoqi@0: */ aoqi@0: // OperationMetadata getOperationMetadata(java.lang.reflect.Method method); aoqi@0: aoqi@0: /** aoqi@0: * Gets the WebServiceFeatures of this webservice endpoint. aoqi@0: * aoqi@0: * @return the features aoqi@0: */ aoqi@0: // WebServiceFeature[] getFeatures(); aoqi@0: aoqi@0: void generateWSDL(WSDLGenInfo info); aoqi@0: aoqi@0: /** aoqi@0: * @deprecated use MessageContextFactory aoqi@0: */ aoqi@0: public ContentType encode( Packet packet, OutputStream out ) throws IOException ; aoqi@0: aoqi@0: /** aoqi@0: * @deprecated use MessageContextFactory aoqi@0: */ aoqi@0: public void decode( InputStream in, String ct, Packet packet ) throws IOException; aoqi@0: aoqi@0: public MessageContextFactory getMessageContextFactory(); aoqi@0: }