/** * @return SOAPFactory */ private static synchronized SOAPFactory getSOAPFactory() throws SOAPException { if (soapFactory == null) { soapFactory = SOAPFactory.newInstance(); } return soapFactory; }
protected SOAPFactory getSoapFactory() throws SOAPException { if (soapFactory == null) { soapFactory = SOAPFactory.newInstance(); } return soapFactory; }
import javax.xml.soap.SOAPFactory; import javax.xml.soap.SOAPFault; import javax.xml.ws.soap.SOAPFaultException; import javax.xml.namespace.QName; ... SOAPFactory soapFactory = SOAPFactory.newInstance(); SOAPFault soapFault = soapFactory.createFault( "Your custom message", new QName("http://schemas.xmlsoap.org/soap/envelope/", "Client")); throw new SOAPFaultException(soapFault);
/** * * @return * @throws SOAPException */ public static SOAPElementFactory newInstance() throws SOAPException { SOAPFactory factory = SOAPFactory.newInstance(); return new SOAPElementFactory(factory); }
public static SOAPFactory newInstance() throws SOAPException { try { SOAPFactory factory = $FactoryFinder.find(SOAPFactory.class, DEFAULT_SOAP_FACTORY, false); if (factory != null) { return factory; } return newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); } catch (Exception ex) { throw new SOAPException("Unable to create SOAP Factory: " + ex.getMessage(), ex); } }
@Nullable protected static SOAPFaultException createSfe(@NotNull SoapFaultCode soapFaultCode) { try { QName qname = new QName("http://schemas.xmlsoap.org/soap/envelope/", soapFaultCode.name()); SOAPFactory sf = SOAPFactory.newInstance(); SOAPFault fault = sf.createFault("", qname); return new SOAPFaultException(fault); } catch (SOAPException e) { //e.printStackTrace(); return null; } }
@Nullable protected static SOAPFaultException createSfe(@NotNull SoapFaultCode soapFaultCode) { try { QName qname = new QName("http://schemas.xmlsoap.org/soap/envelope/", soapFaultCode.name()); SOAPFactory sf = SOAPFactory.newInstance(); SOAPFault fault = sf.createFault("", qname); return new SOAPFaultException(fault); } catch (SOAPException e) { //e.printStackTrace(); return null; } }
/** * @return * @throws SOAPException */ private SOAPHeaderElement createSoapHeaderElement() throws SOAPException { Name name = SOAPFactory.newInstance().createName( Constants.SOAP_HEADER_NAME_FEDCAT, Constants.SOAP_HEADER_PREFIX, Constants.SOAP_HEADER_NS); SOAPHeaderElement headerElement = new org.apache.axis.message.SOAPHeaderElement(name); return headerElement; }
private SOAPHeaderElement createSoapHeaderElement() throws SOAPException { Name name = SOAPFactory.newInstance().createName( Constants.SOAP_HEADER_NAME_RECORD, Constants.SOAP_HEADER_PREFIX, Constants.SOAP_HEADER_NS); return new org.apache.axis.message.SOAPHeaderElement(name); }
private SOAPFault createSoapFault(final String msg, final QName qname) { try { SOAPFactory soapFactory = SOAPFactory.newInstance(); return soapFactory.createFault(msg, qname); } catch (SOAPException e) { throw new WebServiceException("Exception while trying to create SOAPFault", e); } }
private SOAPFault createSoapFault(final String msg, final QName qname) { try { SOAPFactory soapFactory = SOAPFactory.newInstance(); return soapFactory.createFault(msg, qname); } catch (SOAPException e) { throw new WebServiceException("Exception while trying to create SOAPFault", e); } }
private SOAPFault createSoapFault(final String msg, final QName qname) { try { SOAPFactory soapFactory = SOAPFactory.newInstance(); return soapFactory.createFault(msg, qname); } catch (SOAPException e) { throw new WebServiceException("Exception while trying to create SOAPFault", e); } }
private SOAPFault createSoapFault(final String msg, final QName qname) { try { SOAPFactory soapFactory = SOAPFactory.newInstance(); return soapFactory.createFault(msg, qname); } catch (SOAPException e) { throw new WebServiceException("Exception while trying to create SOAPFault", e); } }
private SOAPHeaderElement createSoapHeaderElement() throws SOAPException { Name name = SOAPFactory.newInstance().createName( Constants.SOAP_HEADER_NAME_SEC, Constants.SOAP_HEADER_PREFIX, Constants.SOAP_HEADER_NS); SOAPHeaderElement headerElement = new org.apache.axis.message.SOAPHeaderElement(name); return headerElement; }
private SOAPFaultException createSOAPFaultException(String faultString) { SOAPFault soapFault; try { SOAPFactory soapFactory = SOAPFactory.newInstance(); soapFault = soapFactory.createFault(); soapFault.setFaultString(faultString); } catch (SOAPException e) { throw new RuntimeException("SOAP error"); } return new SOAPFaultException(soapFault); }
public SOAPBindingImpl(boolean server) { try { isServer = server; msgFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); soapFactory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); faultCode = isServer ? FAULTCODE_SERVER : FAULTCODE_CLIENT; } catch (SOAPException se) { LOG.log(Level.SEVERE, "SAAJ_FACTORY_CREATION_FAILURE_MSG", se); throw new WebServiceException(se.getMessage()); } }
public SOAPHeaderElement elementToHeader(Element element, SOAPHeaderElement parent) throws SOAPException { soapFactory = SOAPFactory.newInstance(); if (parent == null) { String namespaceUri = "http://fake/uri"; String prefix = "fake"; String localName = "FakeName"; Name headerName = soapFactory.createName(localName, prefix, namespaceUri); parent = new SOAPHeaderElement(headerName); } elementToSOAPElement(element, parent); return parent; }
private SOAPFaultException createSOAPFaultException(String faultString) throws SOAPException { SOAPFault fault = SOAPFactory.newInstance().createFault(); fault.setFaultString(faultString); SAAJUtils.setFaultCode(fault, new QName("http://cxf.apache.org/faultcode", "Server")); return new SOAPFaultException(fault); } private SOAPFaultException createSOAPFaultExceptionWithDetail(String faultString)
private SOAPFaultException createSOAPFaultException(String faultString) { try { SOAPFault fault = SOAPFactory.newInstance().createFault(); fault.setFaultString(faultString); SAAJUtils.setFaultCode(fault, new QName("http://cxf.apache.org/faultcode", "Server")); return new SOAPFaultException(fault); } catch (SOAPException e) { // do nothing } return null; }
private SOAPFaultException createSOAPFaultException(String faultString) { try { SOAPFault fault = SOAPFactory.newInstance().createFault(); fault.setFaultString(faultString); SAAJUtils.setFaultCode(fault, new QName("http://cxf.apache.org/faultcode", "Server")); return new SOAPFaultException(fault); } catch (SOAPException e) { // do nothing } return null; }