private void serializeRuntimeException() throws WebServiceException { try { MessageFactory factory = _soapContext.getMessageFactory(); SOAPMessage message = factory.createMessage(); QName faultcode = new QName( message.getSOAPBody().getNamespaceURI(), "Server", message.getSOAPBody().getPrefix()); message.getSOAPBody().addFault(faultcode, _runtimeException.getMessage()); _soapContext.setMessage(message); _source = _soapContext.getMessage().getSOAPPart().getContent(); } catch (SOAPException se) { throw new WebServiceException(se); } }
private void serializeProtocolException() throws WebServiceException { if (_protocolException instanceof SOAPFaultException) { SOAPFaultException sfe = (SOAPFaultException) _protocolException; SOAPFault fault = sfe.getFault(); try { MessageFactory factory = _soapContext.getMessageFactory(); SOAPMessage message = factory.createMessage(); message.getSOAPBody().addChildElement(fault); _soapContext.setMessage(message); _source = _soapContext.getMessage().getSOAPPart().getContent(); } catch (SOAPException se) { throw new WebServiceException(se); } } else { throw new WebServiceException(L.l("Unsupported ProtocolException: {0}", _protocolException)); } }