Java SOAP Message createException(String code, String message)

Here you can find the source of createException(String code, String message)

Description

create Exception

License

Open Source License

Declaration

public static SOAPFaultException createException(String code, String message) throws SOAPException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.xml.namespace.QName;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPFault;
import javax.xml.ws.soap.SOAPFaultException;

public class Main {
    private static SOAPFactory soapFactory;

    public static SOAPFaultException createException(String code, String message) throws SOAPException {
        SOAPFault fault = soapFactory.createFault();
        fault.setFaultCode(new QName(code));
        fault.setFaultString(message);//from  w ww .  j  a va2  s. c o  m

        return new SOAPFaultException(fault);
    }
}

Related

  1. copy(MimeHeaders headers)
  2. copyMimeHeaders(MimeHeaders headers)
  3. create()
  4. createAttachmentPart(String cid, DataHandler dh, SOAPMessage message)
  5. createDoc(SOAPMessage soapMsg)
  6. createFault(String message)
  7. createSOAPFault(SOAPFault fault, Throwable cause)
  8. createSOAPRequestForPartnerCategories( String userId)
  9. ensureNamespaceDeclared(SOAPElement elem, String namespaceURI, String prefix)