/** Sets the actor for the given fault. */ @Override public void setFaultActor(SOAPFault fault, String actorOrRole) throws SOAPException { fault.setFaultActor(actorOrRole); }
@Override public void setFaultActor(SOAPFault fault, String actorOrRole) throws SOAPException { fault.setFaultActor(actorOrRole); }
@Override public void setFaultActor(SOAPFault fault, String actorOrRole) throws SOAPException { fault.setFaultActor(actorOrRole); }
String role = ((SoapFault)ex).getRole(); if (role != null) { soapFault.setFaultActor(role);
soapFault.setFaultString(sf.getFault().getFaultString()); SAAJUtils.setFaultCode(soapFault, sf.getFault().getFaultCodeAsQName()); soapFault.setFaultActor(sf.getFault().getFaultActor()); if (sf.getFault().hasDetail()) { Node nd = soapMessage.getSOAPPart().importNode(sf.getFault().getDetail(),
soapFault.setFaultString(sf.getFault().getFaultString()); SAAJUtils.setFaultCode(soapFault, sf.getFault().getFaultCodeAsQName()); soapFault.setFaultActor(sf.getFault().getFaultActor()); if (sf.getFault().hasDetail()) { Node nd = originalMsg.getSOAPPart().importNode(
@Override public void setFaultActorOrRole(String faultActor) { try { getSaajFault().setFaultActor(faultActor); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
@Override public void setFaultActorOrRole(String faultActor) { try { getSaajFault().setFaultActor(faultActor); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
@Override public void setFaultActorOrRole(String faultActor) { try { getSaajFault().setFaultActor(faultActor); } catch (SOAPException ex) { throw new SaajSoapFaultException(ex); } }
protected Throwable getProtocolException() { try { SOAPFault fault = SOAPVersion.SOAP_11.getSOAPFactory().createFault(faultstring, faultcode); fault.setFaultActor(faultactor); if(detail != null){ Detail d = fault.addDetail(); for(Element det : detail.getDetails()){ Node n = fault.getOwnerDocument().importNode(det, true); d.appendChild(n); } } return new ServerSOAPFaultException(fault); } catch (SOAPException e) { throw new WebServiceException(e); } } }
protected Throwable getProtocolException() { try { SOAPFault fault = SOAPVersion.SOAP_11.getSOAPFactory().createFault(faultstring, faultcode); fault.setFaultActor(faultactor); if(detail != null){ Detail d = fault.addDetail(); for(Element det : detail.getDetails()){ Node n = fault.getOwnerDocument().importNode(det, true); d.appendChild(n); } } return new ServerSOAPFaultException(fault); } catch (SOAPException e) { throw new WebServiceException(e); } } }
protected Throwable getProtocolException() { try { SOAPFault fault = SOAPVersion.SOAP_11.getSOAPFactory().createFault(faultstring, faultcode); fault.setFaultActor(faultactor); if(detail != null){ Detail d = fault.addDetail(); for(Element det : detail.getDetails()){ Node n = fault.getOwnerDocument().importNode(det, true); d.appendChild(n); } } return new ServerSOAPFaultException(fault); } catch (SOAPException e) { throw new WebServiceException(e); } } }
/** * Given a string message, create a {@link SOAPFault} * * @param message * @return * @throws SOAPException */ public static SOAPMessage createFault(String message) throws SOAPException { MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage msg = messageFactory.createMessage(); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); SOAPBody body = envelope.getBody(); SOAPFault fault = body.addFault(); fault.setFaultCode("Server"); fault.setFaultActor("urn:picketlink"); fault.setFaultString(message); return msg; }
/** * Given a string message, create a {@link SOAPFault} * @param message * @return * @throws SOAPException */ public static SOAPMessage createFault(String message) throws SOAPException { MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage msg = messageFactory.createMessage(); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); SOAPBody body = envelope.getBody(); SOAPFault fault = body.addFault(); fault.setFaultCode("Server"); fault.setFaultActor("urn:picketlink"); fault.setFaultString(message); return msg; }
/** * Given a string message, create a {@link SOAPFault} that is SOAP 1.2 * * @param message * @return * @throws SOAPException */ public static SOAPMessage createFault12(String message) throws SOAPException { MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); SOAPMessage msg = messageFactory.createMessage(); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); SOAPBody body = envelope.getBody(); SOAPFault fault = body.addFault(); fault.setFaultCode("Server"); fault.setFaultActor("urn:picketlink"); fault.setFaultString(message); return msg; }
/** * Given a string message, create a {@link SOAPFault} * @param message * @return * @throws SOAPException */ public static SOAPMessage createFault(String message) throws SOAPException { MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage msg = messageFactory.createMessage(); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); SOAPBody body = envelope.getBody(); SOAPFault fault = body.addFault(); fault.setFaultCode("Server"); fault.setFaultActor("urn:picketlink"); fault.setFaultString(message); return msg; }
/** * Given a string message, create a {@link SOAPFault} * * @param message * * @return * * @throws SOAPException */ public static SOAPMessage createFault(String message) throws SOAPException { MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage msg = messageFactory.createMessage(); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); SOAPBody body = envelope.getBody(); SOAPFault fault = body.addFault(); fault.setFaultCode("Server"); fault.setFaultActor("urn:picketlink"); fault.setFaultString(message); return msg; }
/** * Given a string message, create a {@link SOAPFault} that is SOAP 1.2 * * @param message * * @return * * @throws SOAPException */ public static SOAPMessage createFault12(String message) throws SOAPException { MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); SOAPMessage msg = messageFactory.createMessage(); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); SOAPBody body = envelope.getBody(); SOAPFault fault = body.addFault(); fault.setFaultCode("Server"); fault.setFaultActor("urn:picketlink"); fault.setFaultString(message); return msg; }
private SOAPFaultException createSOAPFaultExceptionWithDetail(String faultString) throws SOAPException { SOAPFault fault = SOAPFactory.newInstance().createFault(); QName faultName = new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE, "Server"); SAAJUtils.setFaultCode(fault, faultName); fault.setFaultActor("http://gizmos.com/orders"); fault.setFaultString(faultString); Detail detail = fault.addDetail(); QName entryName = new QName("http://gizmos.com/orders/", "order", "PO"); DetailEntry entry = detail.addDetailEntry(entryName); entry.addTextNode("Quantity element does not have a value"); QName entryName2 = new QName("http://gizmos.com/orders/", "order", "PO"); DetailEntry entry2 = detail.addDetailEntry(entryName2); entry2.addTextNode("Incomplete address: no zip code"); return new SOAPFaultException(fault); }
public GreetMeResponse greetMe(GreetMeRequest gmr) { if ("fault".equals(gmr.getName())) { try { SOAPFactory factory = SOAPFactory.newInstance(); SOAPFault fault = factory.createFault("this is a fault string!", new QName("http://foo", "FooCode")); fault.setFaultActor("mr.actor"); fault.addDetail().addChildElement("test").addTextNode("TestText"); throw new SOAPFaultException(fault); } catch (SOAPException ex) { throw new WebServiceException(ex); } } else if ("emptyfault".equals(gmr.getName())) { throw new RuntimeException("Empty!"); } GreetMeResponse resp = new GreetMeResponse(); resp.setName(gmr.getName()); return resp; }