use of com.sun.xml.ws.encoding.soap.DeserializationException in project metro-jax-ws by eclipse-ee4j.
the class SyncMethodHandler method invoke.
/**
* Invokes synchronously, but with the given {@link RequestContext}
* and {@link ResponseContextReceiver}.
*
* @param rc
* This {@link RequestContext} is used for invoking this method.
* We take this as a separate parameter because of the async invocation
* handling, which requires a separate copy.
*/
Object invoke(Object proxy, Object[] args, RequestContext rc, ResponseContextReceiver receiver) throws Throwable {
JavaCallInfo call = owner.databinding.createJavaCallInfo(method, args);
Packet req = (Packet) owner.databinding.serializeRequest(call);
// process the message
Packet reply = owner.doProcess(req, rc, receiver);
Message msg = reply.getMessage();
if (msg == null) {
if (!isOneway || !isVoid) {
throw new WebServiceException(DispatchMessages.INVALID_RESPONSE());
}
return null;
}
try {
call = owner.databinding.deserializeResponse(reply, call);
if (call.getException() != null) {
throw call.getException();
} else {
return call.getReturnValue();
}
} catch (JAXBException e) {
throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(), e);
} catch (XMLStreamException e) {
throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(), e);
} finally {
if (reply.transportBackChannel != null)
reply.transportBackChannel.close();
}
}
use of com.sun.xml.ws.encoding.soap.DeserializationException in project metro-jax-ws by eclipse-ee4j.
the class DispatchImpl method doInvoke.
/**
* Synchronously invokes a service.
*
* See {@link #process(Packet, RequestContext, ResponseContextReceiver)} on
* why it takes a {@link RequestContext} and {@link ResponseContextReceiver} as a parameter.
*/
public final T doInvoke(T in, RequestContext rc, ResponseContextReceiver receiver) {
Packet response = null;
try {
try {
checkNullAllowed(in, rc, binding, mode);
Packet message = createPacket(in);
message.setState(Packet.State.ClientRequest);
resolveEndpointAddress(message, rc);
setProperties(message, true);
response = process(message, rc, receiver);
Message msg = response.getMessage();
// REVIEW: eliminate allowFaultResponseMsg, but make that behavior default for MessageDispatch, PacketDispatch
if (msg != null && msg.isFault() && !allowFaultResponseMsg) {
SOAPFaultBuilder faultBuilder = SOAPFaultBuilder.create(msg);
// it will get back to us is a protocol exception
throw (SOAPFaultException) faultBuilder.createException(null);
}
} catch (JAXBException e) {
// TODO: i18nify
throw new DeserializationException(DispatchMessages.INVALID_RESPONSE_DESERIALIZATION(), e);
} catch (WebServiceException e) {
// it could be a WebServiceException or a ProtocolException
throw e;
} catch (Throwable e) {
// WebServiceException
throw new WebServiceException(e);
}
return toReturnValue(response);
} finally {
// REVIEW: Move to AsyncTransportProvider
if (response != null && response.transportBackChannel != null)
response.transportBackChannel.close();
}
}
Aggregations