Java源码示例:com.sun.xml.internal.ws.api.message.Messages
示例1
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例2
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例3
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例4
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例5
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例6
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例7
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例8
/**
* Replace the message in the given message context with a
* fault message. If the context already contains a fault
* message, then return without changing it.
*
* <p>This method should only be called during a request,
* because during a response an exception from a handler
* is dispatched rather than replacing the message with
* a fault. So this method can use the MESSAGE_OUTBOUND_PROPERTY
* to determine whether it is being called on the client
* or the server side. If this changes in the spec, then
* something else will need to be passed to the method
* to determine whether the fault code is client or server.
*/
final void insertFaultMessage(C context,
ProtocolException exception) {
try {
if(!context.getPacketMessage().isFault()) {
Message faultMessage = Messages.create(binding.getSOAPVersion(),
exception,determineFaultCode(binding.getSOAPVersion()));
context.setPacketMessage(faultMessage);
}
} catch (Exception e) {
// severe since this is from runtime and not handler
logger.log(Level.SEVERE,
"exception while creating fault message in handler chain", e);
throw new RuntimeException(e);
}
}
示例9
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例10
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例11
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例12
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例13
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例14
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例15
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例16
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例17
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例18
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例19
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例20
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例21
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例22
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例23
final void insertFaultMessage(C context,
ProtocolException exception) {
if(exception instanceof HTTPException) {
context.put(MessageContext.HTTP_RESPONSE_CODE,((HTTPException)exception).getStatusCode());
}
if (context != null) {
// non-soap case
context.setPacketMessage(Messages.createEmpty(binding.getSOAPVersion()));
}
}
示例24
public void decode(InputStream in, String contentType, Packet packet) throws IOException {
/* Implements similar logic as the XMLMessage.create(String, InputStream).
* But it's faster, as we know the InputStream has FastInfoset content*/
Message message;
in = hasSomeData(in);
if (in != null) {
message = Messages.createUsingPayload(new FastInfosetSource(in),
SOAPVersion.SOAP_11);
} else {
message = Messages.createEmpty(SOAPVersion.SOAP_11);
}
packet.setMessage(message);
}
示例25
Message createMessage(Object[] methodArgs) {
return Messages.createEmpty(soapVersion);
}
示例26
public Message createMessage(Object[] methodArgs, Object returnValue) {
return Messages.createEmpty(soapVersion);
}
示例27
public Message getResponseMessage(Source source) {
return Messages.createUsingPayload(source, SOAPVersion.SOAP_11);
}
示例28
protected Message getResponseMessage(Source source) {
return Messages.createUsingPayload(source, soapVersion);
}
示例29
protected Message getResponseMessage(Source source) {
return Messages.create(source, soapVersion);
}
示例30
protected Message getResponseMessage(SOAPMessage soapMsg) {
return Messages.create(soapMsg);
}