⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interface_tie.java

📁 J2ME核心类及MIDlet类 MIDP用户界面对象 图形处理及低级事件处理 多线程编程 I/O及网络编程 数据库RMS编程 浮点数编程 多媒体及GAME API编程 安全、加密及
💻 JAVA
字号:
// This class was generated by the JAXRPC SI, do not edit.
// Contents subject to change without notice.
// JAX-RPC Standard Implementation (1.1, build R59)

package serverscript;

import com.sun.xml.rpc.server.http.MessageContextProperties;
import com.sun.xml.rpc.streaming.*;
import com.sun.xml.rpc.encoding.*;
import com.sun.xml.rpc.encoding.soap.SOAPConstants;
import com.sun.xml.rpc.encoding.soap.SOAP12Constants;
import com.sun.xml.rpc.encoding.literal.*;
import com.sun.xml.rpc.soap.streaming.*;
import com.sun.xml.rpc.soap.message.*;
import com.sun.xml.rpc.soap.SOAPVersion;
import com.sun.xml.rpc.soap.SOAPEncodingConstants;
import com.sun.xml.rpc.wsdl.document.schema.SchemaConstants;
import javax.xml.namespace.QName;
import java.rmi.RemoteException;
import java.util.Iterator;
import java.lang.reflect.*;
import java.lang.Class;
import com.sun.xml.rpc.server.*;
import javax.xml.rpc.handler.HandlerInfo;
import com.sun.xml.rpc.client.HandlerChainImpl;

public class Interface_Tie
    extends com.sun.xml.rpc.server.TieBase implements SerializerConstants {
    
    
    public Interface_Tie() throws Exception {
        super(new serverscript.Serverscript_SerializerRegistry().getRegistry());
        initialize(internalTypeMappingRegistry);
    }
    
    /*
     * This method does the actual method invocation for operation: request
     */
    private void invoke_request(StreamingHandlerState state) throws Exception {
        
        serverscript.Interface_request_RequestStruct myInterface_request_RequestStruct = null;
        Object myInterface_request_RequestStructObj =
            state.getRequest().getBody().getValue();
        
        if (myInterface_request_RequestStructObj instanceof SOAPDeserializationState) {
            myInterface_request_RequestStruct = (serverscript.Interface_request_RequestStruct)((SOAPDeserializationState)myInterface_request_RequestStructObj).getInstance();
        } else {
            myInterface_request_RequestStruct = (serverscript.Interface_request_RequestStruct)myInterface_request_RequestStructObj;
        }
        
        try {
            java.lang.String _result = ((serverscript.Interface) getTarget()).request(myInterface_request_RequestStruct.getString_1(), myInterface_request_RequestStruct.getString_2());
            
            SOAPHeaderBlockInfo headerInfo;
            
            serverscript.Interface_request_ResponseStruct _response = new serverscript.Interface_request_ResponseStruct();
            _response.setResult(_result);
            
            SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_request_requestResponse_QNAME);
            bodyBlock.setValue(_response);
            bodyBlock.setSerializer(ns1_myInterface_request_ResponseStruct_LiteralSerializer);
            state.getResponse().setBody(bodyBlock);
        } catch (javax.xml.rpc.soap.SOAPFaultException e) {
            SOAPFaultInfo fault = new SOAPFaultInfo(e.getFaultCode(),
                e.getFaultString(), e.getFaultActor(), e.getDetail());
            SOAPBlockInfo faultBlock = new SOAPBlockInfo(com.sun.xml.rpc.encoding.soap.SOAPConstants.QNAME_SOAP_FAULT);
            faultBlock.setValue(fault);
            faultBlock.setSerializer(new SOAPFaultInfoSerializer(false, e.getDetail()==null));
            state.getResponse().setBody(faultBlock);
            state.getResponse().setFailure(true);
        }
    }
    
    /*
     * This method must determine the opcode of the operation that has been invoked.
     */
    protected void peekFirstBodyElement(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingHandlerState state) throws Exception {
        if (bodyReader.getName().equals(ns1_request_request_QNAME)) {
            state.getRequest().setOperationCode(request_OPCODE);
        }
        else {
            throw new SOAPProtocolViolationException("soap.operation.unrecognized", bodyReader.getName().toString());
        }
    }
    
    /*
     *  this method deserializes the request/response structure in the body
     */
    protected void readFirstBodyElement(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingHandlerState  state) throws Exception {
        int opcode = state.getRequest().getOperationCode();
        switch (opcode) {
            case request_OPCODE:
                deserialize_request(bodyReader, deserializationContext, state);
                break;
            default:
                throw new SOAPProtocolViolationException("soap.operation.unrecognized", Integer.toString(opcode));
        }
    }
    
    
    
    /*
     * This method deserializes the body of the request operation.
     */
    private void deserialize_request(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingHandlerState state) throws Exception {
        Object myInterface_request_RequestStructObj =
            ns1_myInterface_request_RequestStruct_LiteralSerializer.deserialize(ns1_request_request_QNAME,
                bodyReader, deserializationContext);
        
        SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_request_request_QNAME);
        bodyBlock.setValue(myInterface_request_RequestStructObj);
        state.getRequest().setBody(bodyBlock);
    }
    
    
    /*
     * This method must invoke the correct method on the servant based on the opcode.
     */
    protected void processingHook(StreamingHandlerState state) throws Exception {
        switch (state.getRequest().getOperationCode()) {
            case request_OPCODE:
                invoke_request(state);
                break;
            default:
                throw new SOAPProtocolViolationException("soap.operation.unrecognized", Integer.toString(state.getRequest().getOperationCode()));
        }
    }
    
    protected String getDefaultEnvelopeEncodingStyle() {
        return null;
    }
    
    public String getImplicitEnvelopeEncodingStyle() {
        return "";
    }
    
    
    /*
     * This method must determine the opcode of the operation given the QName of the first body element.
     */
    public int getOpcodeForFirstBodyElementName(QName name) {
        if (name == null) {
            return InternalSOAPMessage.NO_OPERATION;
        }
        if (name.equals(ns1_request_request_QNAME)) {
            return request_OPCODE;
        }
        return super.getOpcodeForFirstBodyElementName(name);
    }
    
    
    private Method internalGetMethodForOpcode(int opcode) throws ClassNotFoundException, NoSuchMethodException {
        
        Method theMethod = null;
        
        switch(opcode) {
            case request_OPCODE:
                {
                    Class[] carray = { java.lang.String.class,java.lang.String.class };
                    theMethod = (serverscript.Interface.class).getMethod("request", carray);
                }
                break;
            
            default:
        }
        return theMethod;
    }
    
    private Method[] methodMap = new Method[1];
    
    /*
     * This method returns the Method Obj for a specified opcode.
     */
    public Method getMethodForOpcode(int opcode) throws ClassNotFoundException, NoSuchMethodException {
         
        if (opcode <= InternalSOAPMessage.NO_OPERATION ) {
            return null;
        }
         
        if (opcode >= 1 ) {
            return null;
        }
         
        if (methodMap[opcode] == null)  {
            methodMap[opcode] = internalGetMethodForOpcode(opcode);
        }
         
        return methodMap[opcode];
    }
    
    /*
     * This method returns an array containing (prefix, nsURI) pairs.
     */
    protected String[] getNamespaceDeclarations() {
        return myNamespace_declarations;
    }
    
    /*
     * This method returns an array containing the names of the headers we understand.
     */
    public QName[] getUnderstoodHeaders() {
        return understoodHeaderNames;
    }
    
    private void initialize(InternalTypeMappingRegistry registry) throws Exception {
        ns1_myInterface_request_RequestStruct_LiteralSerializer = (CombinedSerializer)registry.getSerializer("", serverscript.Interface_request_RequestStruct.class, ns1_request_TYPE_QNAME);
        ns1_myInterface_request_ResponseStruct_LiteralSerializer = (CombinedSerializer)registry.getSerializer("", serverscript.Interface_request_ResponseStruct.class, ns1_requestResponse_TYPE_QNAME);
    }
    
    private static final QName portName = new QName("http://serverscript.org/wsdl", "Interface");
    private static final int request_OPCODE = 0;
    private static final QName ns1_request_request_QNAME = new QName("http://serverscript.org/types", "request");
    private static final QName ns1_request_TYPE_QNAME = new QName("http://serverscript.org/types", "request");
    private CombinedSerializer ns1_myInterface_request_RequestStruct_LiteralSerializer;
    private static final QName ns1_request_requestResponse_QNAME = new QName("http://serverscript.org/types", "requestResponse");
    private static final QName ns1_requestResponse_TYPE_QNAME = new QName("http://serverscript.org/types", "requestResponse");
    private CombinedSerializer ns1_myInterface_request_ResponseStruct_LiteralSerializer;
    private static final String[] myNamespace_declarations =
                                        new String[] {
                                            "ns0", "http://serverscript.org/types"
                                        };
    
    private static final QName[] understoodHeaderNames = new QName[] {  };
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -