private void throwProtocolException(Throwable t) { if (null != t) { LOG.log(Level.INFO, "DISPATCH_INVOKE_EXC", cl.getSimpleName()); throw isJAXWSException(t) ? (WebServiceException)t : new ProtocolException(t); } }
/** * Create a ProtocolException * * @param message * @param t Throwable * @return ProtocolException */ private static ProtocolException createProtocolException(String message, Throwable t) { Throwable rootCause = null; if (t != null) { rootCause = getRootCause(t); } rootCause = rootCause == null ? t : rootCause; ProtocolException e = null; if (message != null) { e = new ProtocolException(message, rootCause); } else { e = new ProtocolException(rootCause); } if (log.isDebugEnabled()) { log.debug("create Exception:", e); } return e; }
public void handleMessage(Message message) throws Fault { String str = new String("Collocated Invocation should have been detected."); throw new ProtocolException(str); } }
private void safeRead(InputStreamMessageContext inContext, MessageContext msgContext) { try { binding.getBindingImpl().read(inContext, msgContext); } catch (IOException ex) { LOG.log(Level.SEVERE, "READ_IO_FAILURE_MSG", ex); throw new ProtocolException(ex); } } }
public boolean handleMessage(SOAPMessageContext context) { Boolean outboundProperty = (Boolean) context .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outboundProperty) { try { handleOutboundMessage(context); } catch (Exception e) { throw new ProtocolException("error: " + e.getMessage(), e); } } else { try { handleInboundMessage(context); } catch (Exception e) { throw new ProtocolException("error: " + e.getMessage(), e); } } return true; }
@Override public boolean handleMessage(SOAPMessageContext context) { Boolean outboundProperty = (Boolean) context .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (false == outboundProperty) { return true; } try { handleOutboundMessage(context); } catch (Exception e) { LOG.error("outbound exception: " + e.getMessage(), e); throw new ProtocolException(e); } return true; }
@Override public boolean handleMessage(SOAPMessageContext context) { Boolean outboundProperty = (Boolean) context .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (false == outboundProperty) { return true; } try { handleOutboundMessage(context); } catch (Exception e) { LOG.error("outbound exception: " + e.getMessage(), e); throw new ProtocolException(e); } return true; }
@Override public boolean handleMessage(SOAPMessageContext context) { if (null == this.to) { return true; } Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (false == outboundProperty) { return true; } try { handleOutboundMessage(context); } catch (Exception e) { LOG.error("outbound exception: " + e.getMessage(), e); throw new ProtocolException(e); } return true; }
sslEngine.beginHandshake(); } catch (SSLException e) { throw new ProtocolException(e);
public boolean hasFault(MessageContext msgContext) { boolean hasFault = false; SOAPMessage msg = ((SOAPMessageContext)msgContext).getMessage(); assert msg != null; try { hasFault = msg.getSOAPBody().hasFault(); } catch (SOAPException se) { LOG.log(Level.SEVERE, "SOAP_UNMARSHALLING_FAILURE_MSG", se); throw new ProtocolException(se); } return hasFault; }
/** * Sets the callback endpoint address specified by the WSA header in the current work context. * * @param element the WSA header * @param workContext the current work context */ @SuppressWarnings("unchecked") private void setReturnAddress(SOAPElement element, WorkContext workContext) { Iterator<SOAPElement> addresses = (Iterator<SOAPElement>) element.getChildElements(WSA_ADDRESS); if (addresses.hasNext()) { String address = addresses.next().getValue(); if (WSA_ANONYMOUS.equals(address)) { throw new ProtocolException("Invalid Callback Address: " + WSA_ANONYMOUS); } if (address != null) { workContext.setHeader(CallbackConstants.ENDPOINT_ADDRESS, address); } } }
@Override public boolean handleMessage(LogicalMessageContext mc) { HandlerUtils.printMessageContext("Service LogicalHandler", mc); if (Boolean.FALSE.equals(mc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))) { try { LogicalMessage msg = mc.getMessage(); JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); Object payload = msg.getPayload(jaxbContext); if (payload instanceof DoubleIt) { DoubleIt req = (DoubleIt) payload; if (req.getNumberToDouble() == 30) { throw new ProtocolException( "Doubling 30 is not allowed by the web service provider."); } } } catch (JAXBException ex) { throw new ProtocolException(ex); } } return true; }
public final boolean handleMessage(LogicalMessageContext messageContext) { //System.out.println("LogicalMessageHandler handleMessage called"); try { // get the LogicalMessage from our context LogicalMessage msg = messageContext.getMessage(); // check the payload, if its an AddNumbers request, we'll intervene JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); Object payload = msg.getPayload(jaxbContext); Object value = payload; if (payload instanceof JAXBElement) { value = ((JAXBElement)payload).getValue(); } if (value instanceof AddNumbers) { AddNumbers req = (AddNumbers)value; int a = req.getArg0(); req.setArg0(a * 10); msg.setPayload(payload, jaxbContext); } return true; } catch (JAXBException ex) { throw new ProtocolException(ex); } }
public final boolean handleMessage(LogicalMessageContext messageContext) { //System.out.println("LogicalMessageHandler handleMessage called"); try { // get the LogicalMessage from our context LogicalMessage msg = messageContext.getMessage(); // check the payload, if its an AddNumbers request, we'll intervene JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); Object payload = msg.getPayload(jaxbContext); Object value = payload; if (payload instanceof JAXBElement) { value = ((JAXBElement)payload).getValue(); } if (value instanceof AddNumbers) { AddNumbers req = (AddNumbers)value; int a = req.getArg0(); req.setArg0(a * 10); msg.setPayload(payload, jaxbContext); } return true; } catch (JAXBException ex) { throw new ProtocolException(ex); } }
public boolean handleMessage(LogicalMessageContext ctx) { super.handleMessage(ctx); Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outbound) { throw new ProtocolException(clientHandlerMessage); } return true; } };
public boolean handleMessage(SOAPMessageContext ctx) { super.handleMessage(ctx); Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outbound) { throw new ProtocolException(clientHandlerMessage); } return true; } };
public boolean handleMessage(SOAPMessageContext ctx) { super.handleMessage(ctx); Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (!outbound) { throw new ProtocolException(clientHandlerMessage); } return true; } };
public boolean handleMessage(LogicalMessageContext ctx) { super.handleMessage(ctx); Boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (!outbound) { throw new ProtocolException(clientHandlerMessage); } return true; } };
public final boolean handleMessage(LogicalMessageContext messageContext) { //System.out.println("LogicalMessageHandler handleMessage called"); try { // get the LogicalMessage from our context LogicalMessage msg = messageContext.getMessage(); // check the payload, if its an AddNumbers request, we'll intervene JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class); Object payload = msg.getPayload(jaxbContext); Object value = payload; if (payload instanceof JAXBElement) { value = ((JAXBElement<?>)payload).getValue(); } if (value instanceof AddNumbers) { AddNumbers req = (AddNumbers)value; int a = req.getArg0(); req.setArg0(a * 10); msg.setPayload(payload, jaxbContext); } return true; } catch (JAXBException ex) { throw new ProtocolException(ex); } }
public boolean handleMessage(T ctx) { methodCalled("handleMessage"); printHandlerInfo("handleMessage", isOutbound(ctx)); boolean outbound = (Boolean)ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); boolean ret = getHandleMessageRet(); if (!isServerSideHandler()) { return true; } try { verifyJAXWSProperties(ctx); } catch (PingException e) { e.printStackTrace(); throw new ProtocolException(e); } Object obj = ctx.getMessage().getPayload(jaxbCtx); if (obj instanceof Ping || obj instanceof PingResponse) { ret = handlePingMessage(outbound, ctx); } else if (obj instanceof PingWithArgs) { ret = handlePingWithArgsMessage(outbound, ctx); } return ret; }