com.oracle.webservices.internal.api.databinding.JavaCallInfo Java Examples

The following examples show how to use com.oracle.webservices.internal.api.databinding.JavaCallInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DatabindingImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Method method = call.getMethod();
    Message message = null;
    if (method != null) {
        TieHandler th = tieHandlers.get(method);
        if (th != null) {
            return th.serializeResponse(call);
        }
    }
    if (call.getException() instanceof DispatchException) {
        message = ((DispatchException) call.getException()).fault;
    }
    Packet p = (Packet) packetFactory.createContext(message);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
Example #2
Source File: DatabindingImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Method method = call.getMethod();
    Message message = null;
    if (method != null) {
        TieHandler th = tieHandlers.get(method);
        if (th != null) {
            return th.serializeResponse(call);
        }
    }
    if (call.getException() instanceof DispatchException) {
        message = ((DispatchException) call.getException()).fault;
    }
    Packet p = (Packet) packetFactory.createContext(message);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
Example #3
Source File: DatabindingImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Method method = call.getMethod();
    Message message = null;
    if (method != null) {
        TieHandler th = tieHandlers.get(method);
        if (th != null) {
            return th.serializeResponse(call);
        }
    }
    if (call.getException() instanceof DispatchException) {
        message = ((DispatchException) call.getException()).fault;
    }
    Packet p = (Packet) packetFactory.createContext(message);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
Example #4
Source File: DatabindingImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Method method = call.getMethod();
    Message message = null;
    if (method != null) {
        TieHandler th = tieHandlers.get(method);
        if (th != null) {
            return th.serializeResponse(call);
        }
    }
    if (call.getException() instanceof DispatchException) {
        message = ((DispatchException) call.getException()).fault;
    }
    Packet p = (Packet) packetFactory.createContext(message);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
Example #5
Source File: DatabindingImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Method method = call.getMethod();
    Message message = null;
    if (method != null) {
        TieHandler th = tieHandlers.get(method);
        if (th != null) {
            return th.serializeResponse(call);
        }
    }
    if (call.getException() instanceof DispatchException) {
        message = ((DispatchException) call.getException()).fault;
    }
    Packet p = (Packet) packetFactory.createContext(message);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
Example #6
Source File: DatabindingImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Method method = call.getMethod();
    Message message = null;
    if (method != null) {
        TieHandler th = tieHandlers.get(method);
        if (th != null) {
            return th.serializeResponse(call);
        }
    }
    if (call.getException() instanceof DispatchException) {
        message = ((DispatchException) call.getException()).fault;
    }
    Packet p = (Packet) packetFactory.createContext(message);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
Example #7
Source File: DatabindingImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo deserializeRequest(Packet req) {
    com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo();
    try {
        JavaMethodImpl wsdlOp = resolveJavaMethod(req);
        TieHandler tie = wsdlOpMap.get(wsdlOp);
        call.setMethod(tie.getMethod());
        Object[] args = tie.readRequest(req.getMessage());
        call.setParameters(args);
    } catch (DispatchException e) {
        call.setException(e);
    }
    return call;
}
 
Example #8
Source File: TieHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public JavaCallInfo deserializeRequest(Packet req) {
com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo();
        call.setMethod(this.getMethod());
Object[] args = this.readRequest(req.getMessage());
        call.setParameters(args);
        return call;
}
 
Example #9
Source File: TieHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Message createResponse(JavaCallInfo call) {
        Message responseMessage;
        if (call.getException() == null) {
            responseMessage = isOneWay ? null : createResponseMessage(call.getParameters(), call.getReturnValue());
        } else {
            Throwable e = call.getException();
            Throwable serviceException = getServiceException(e);
            if (e instanceof InvocationTargetException || serviceException != null) {
//              Throwable cause = e.getCause();
              //if (!(cause instanceof RuntimeException) && cause instanceof Exception) {
                if (serviceException != null) {
                    // Service specific exception
                    LOGGER.log(Level.FINE, serviceException.getMessage(), serviceException);
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion,
                            javaMethodModel.getCheckedException(serviceException.getClass()), serviceException);
                } else {
                    Throwable cause = e.getCause();
                    if (cause instanceof ProtocolException) {
                        // Application code may be throwing it intentionally
                        LOGGER.log(Level.FINE, cause.getMessage(), cause);
                    } else {
                        // Probably some bug in application code
                        LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
                    }
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, cause);
                }
            } else if (e instanceof DispatchException) {
                responseMessage = ((DispatchException)e).fault;
            } else {
                LOGGER.log(Level.SEVERE, e.getMessage(), e);
                responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
            }
        }
//        return req.createServerResponse(responseMessage, req.endpoint.getPort(), javaMethodModel.getOwner(), req.endpoint.getBinding());

        return responseMessage;
    }
 
Example #10
Source File: TieHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Message createResponse(JavaCallInfo call) {
        Message responseMessage;
        if (call.getException() == null) {
            responseMessage = isOneWay ? null : createResponseMessage(call.getParameters(), call.getReturnValue());
        } else {
            Throwable e = call.getException();
            Throwable serviceException = getServiceException(e);
            if (e instanceof InvocationTargetException || serviceException != null) {
//              Throwable cause = e.getCause();
              //if (!(cause instanceof RuntimeException) && cause instanceof Exception) {
                if (serviceException != null) {
                    // Service specific exception
                    LOGGER.log(Level.FINE, serviceException.getMessage(), serviceException);
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion,
                            javaMethodModel.getCheckedException(serviceException.getClass()), serviceException);
                } else {
                    Throwable cause = e.getCause();
                    if (cause instanceof ProtocolException) {
                        // Application code may be throwing it intentionally
                        LOGGER.log(Level.FINE, cause.getMessage(), cause);
                    } else {
                        // Probably some bug in application code
                        LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
                    }
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, cause);
                }
            } else if (e instanceof DispatchException) {
                responseMessage = ((DispatchException)e).fault;
            } else {
                LOGGER.log(Level.SEVERE, e.getMessage(), e);
                responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
            }
        }
//        return req.createServerResponse(responseMessage, req.endpoint.getPort(), javaMethodModel.getOwner(), req.endpoint.getBinding());

        return responseMessage;
    }
 
Example #11
Source File: DatabindingImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo deserializeResponse(Packet res, JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    try {
        return stubHandler.readResponse(res, call);
    } catch (Throwable e) {
        call.setException(e);
        return call;
    }
}
 
Example #12
Source File: DatabindingImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Packet serializeRequest(JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    Packet p = stubHandler.createRequestPacket(call);
    p.setState(Packet.State.ClientRequest);
    return p;
}
 
Example #13
Source File: TieHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Message createResponse(JavaCallInfo call) {
        Message responseMessage;
        if (call.getException() == null) {
            responseMessage = isOneWay ? null : createResponseMessage(call.getParameters(), call.getReturnValue());
        } else {
            Throwable e = call.getException();
            Throwable serviceException = getServiceException(e);
            if (e instanceof InvocationTargetException || serviceException != null) {
//              Throwable cause = e.getCause();
              //if (!(cause instanceof RuntimeException) && cause instanceof Exception) {
                if (serviceException != null) {
                    // Service specific exception
                    LOGGER.log(Level.FINE, serviceException.getMessage(), serviceException);
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion,
                            javaMethodModel.getCheckedException(serviceException.getClass()), serviceException);
                } else {
                    Throwable cause = e.getCause();
                    if (cause instanceof ProtocolException) {
                        // Application code may be throwing it intentionally
                        LOGGER.log(Level.FINE, cause.getMessage(), cause);
                    } else {
                        // Probably some bug in application code
                        LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
                    }
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, cause);
                }
            } else if (e instanceof DispatchException) {
                responseMessage = ((DispatchException)e).fault;
            } else {
                LOGGER.log(Level.SEVERE, e.getMessage(), e);
                responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
            }
        }
//        return req.createServerResponse(responseMessage, req.endpoint.getPort(), javaMethodModel.getOwner(), req.endpoint.getBinding());

        return responseMessage;
    }
 
Example #14
Source File: DatabindingImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Packet serializeRequest(JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    Packet p = stubHandler.createRequestPacket(call);
    p.setState(Packet.State.ClientRequest);
    return p;
}
 
Example #15
Source File: DatabindingImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo deserializeResponse(Packet res, JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    try {
        return stubHandler.readResponse(res, call);
    } catch (Throwable e) {
        call.setException(e);
        return call;
    }
}
 
Example #16
Source File: DatabindingImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Packet serializeRequest(JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    Packet p = stubHandler.createRequestPacket(call);
    p.setState(Packet.State.ClientRequest);
    return p;
}
 
Example #17
Source File: DatabindingImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Packet serializeRequest(JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    Packet p = stubHandler.createRequestPacket(call);
    p.setState(Packet.State.ClientRequest);
    return p;
}
 
Example #18
Source File: StubHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a request {@link com.sun.xml.internal.ws.message.jaxb.JAXBMessage} from method arguments.
 * @param args proxy invocation arguments
 * @return Message for the arguments
 */
public Packet createRequestPacket(JavaCallInfo args) {
    Message msg = bodyBuilder.createMessage(args.getParameters());

    for (MessageFiller filler : inFillers) filler.fillIn(args.getParameters(),msg);

    Packet req = (Packet)packetFactory.createContext(msg);
    req.setState(Packet.State.ClientRequest);
    req.soapAction = soapAction;
    req.expectReply = !isOneWay;
    req.getMessage().assertOneWay(isOneWay);
    req.setWSDLOperation(getOperationName());
    return req;
}
 
Example #19
Source File: StubHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo readResponse(Packet p, JavaCallInfo call) throws Throwable {
        Message msg = p.getMessage();
if(msg.isFault()) {
    SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
    Throwable t = faultBuilder.createException(checkedExceptions);
    call.setException(t);
    throw t;
} else {
        initArgs(call.getParameters());
    Object ret = responseBuilder.readResponse(msg, call.getParameters());
    call.setReturnValue(ret);
    return call;
}
}
 
Example #20
Source File: DatabindingImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo deserializeResponse(Packet res, JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    try {
        return stubHandler.readResponse(res, call);
    } catch (Throwable e) {
        call.setException(e);
        return call;
    }
}
 
Example #21
Source File: TieHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public JavaCallInfo deserializeRequest(Packet req) {
com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo();
        call.setMethod(this.getMethod());
Object[] args = this.readRequest(req.getMessage());
        call.setParameters(args);
        return call;
}
 
Example #22
Source File: DatabindingImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo deserializeRequest(Packet req) {
    com.sun.xml.internal.ws.api.databinding.JavaCallInfo call = new com.sun.xml.internal.ws.api.databinding.JavaCallInfo();
    try {
        JavaMethodImpl wsdlOp = resolveJavaMethod(req);
        TieHandler tie = wsdlOpMap.get(wsdlOp);
        call.setMethod(tie.getMethod());
        Object[] args = tie.readRequest(req.getMessage());
        call.setParameters(args);
    } catch (DispatchException e) {
        call.setException(e);
    }
    return call;
}
 
Example #23
Source File: DatabindingImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Packet serializeRequest(JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    Packet p = stubHandler.createRequestPacket(call);
    p.setState(Packet.State.ClientRequest);
    return p;
}
 
Example #24
Source File: DatabindingImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Packet serializeRequest(JavaCallInfo call) {
    StubHandler stubHandler = stubHandlers.get(call.getMethod());
    Packet p = stubHandler.createRequestPacket(call);
    p.setState(Packet.State.ClientRequest);
    return p;
}
 
Example #25
Source File: StubHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a request {@link com.sun.xml.internal.ws.message.jaxb.JAXBMessage} from method arguments.
 * @param args proxy invocation arguments
 * @return Message for the arguments
 */
public Packet createRequestPacket(JavaCallInfo args) {
    Message msg = bodyBuilder.createMessage(args.getParameters());

    for (MessageFiller filler : inFillers) filler.fillIn(args.getParameters(),msg);

    Packet req = (Packet)packetFactory.createContext(msg);
    req.setState(Packet.State.ClientRequest);
    req.soapAction = soapAction;
    req.expectReply = !isOneWay;
    req.getMessage().assertOneWay(isOneWay);
    req.setWSDLOperation(getOperationName());
    return req;
}
 
Example #26
Source File: TieHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Packet serializeResponse(JavaCallInfo call) {
    Message msg = this.createResponse(call);
    Packet p = (msg == null) ? (Packet)packetFactory.createContext() : (Packet)packetFactory.createContext(msg);
    p.setState(Packet.State.ServerResponse);
    return p;
}
 
Example #27
Source File: TieHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Message createResponse(JavaCallInfo call) {
        Message responseMessage;
        if (call.getException() == null) {
            responseMessage = isOneWay ? null : createResponseMessage(call.getParameters(), call.getReturnValue());
        } else {
            Throwable e = call.getException();
            Throwable serviceException = getServiceException(e);
            if (e instanceof InvocationTargetException || serviceException != null) {
//              Throwable cause = e.getCause();
              //if (!(cause instanceof RuntimeException) && cause instanceof Exception) {
                if (serviceException != null) {
                    // Service specific exception
                    LOGGER.log(Level.FINE, serviceException.getMessage(), serviceException);
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion,
                            javaMethodModel.getCheckedException(serviceException.getClass()), serviceException);
                } else {
                    Throwable cause = e.getCause();
                    if (cause instanceof ProtocolException) {
                        // Application code may be throwing it intentionally
                        LOGGER.log(Level.FINE, cause.getMessage(), cause);
                    } else {
                        // Probably some bug in application code
                        LOGGER.log(Level.SEVERE, cause.getMessage(), cause);
                    }
                    responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, cause);
                }
            } else if (e instanceof DispatchException) {
                responseMessage = ((DispatchException)e).fault;
            } else {
                LOGGER.log(Level.SEVERE, e.getMessage(), e);
                responseMessage = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, null, e);
            }
        }
//        return req.createServerResponse(responseMessage, req.endpoint.getPort(), javaMethodModel.getOwner(), req.endpoint.getBinding());

        return responseMessage;
    }
 
Example #28
Source File: StubHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo readResponse(Packet p, JavaCallInfo call) throws Throwable {
        Message msg = p.getMessage();
if(msg.isFault()) {
    SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
    Throwable t = faultBuilder.createException(checkedExceptions);
    call.setException(t);
    throw t;
} else {
        initArgs(call.getParameters());
    Object ret = responseBuilder.readResponse(msg, call.getParameters());
    call.setReturnValue(ret);
    return call;
}
}
 
Example #29
Source File: StubHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public JavaCallInfo readResponse(Packet p, JavaCallInfo call) throws Throwable {
        Message msg = p.getMessage();
if(msg.isFault()) {
    SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
    Throwable t = faultBuilder.createException(checkedExceptions);
    call.setException(t);
    throw t;
} else {
        initArgs(call.getParameters());
    Object ret = responseBuilder.readResponse(msg, call.getParameters());
    call.setReturnValue(ret);
    return call;
}
}
 
Example #30
Source File: StubHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a request {@link com.sun.xml.internal.ws.message.jaxb.JAXBMessage} from method arguments.
 * @param args proxy invocation arguments
 * @return Message for the arguments
 */
public Packet createRequestPacket(JavaCallInfo args) {
    Message msg = bodyBuilder.createMessage(args.getParameters());

    for (MessageFiller filler : inFillers) filler.fillIn(args.getParameters(),msg);

    Packet req = (Packet)packetFactory.createContext(msg);
    req.setState(Packet.State.ClientRequest);
    req.soapAction = soapAction;
    req.expectReply = !isOneWay;
    req.getMessage().assertOneWay(isOneWay);
    req.setWSDLOperation(getOperationName());
    return req;
}