use of jakarta.xml.soap.SOAPFactory in project metro-jax-ws by eclipse-ee4j.
the class WsaTubeHelper method createInvalidAddressingHeaderFault.
public SOAPFault createInvalidAddressingHeaderFault(InvalidAddressingHeaderException e, AddressingVersion av) {
QName name = e.getProblemHeader();
QName subsubcode = e.getSubsubcode();
QName subcode = av.invalidMapTag;
String faultstring = String.format(av.getInvalidMapText(), name, subsubcode);
try {
SOAPFactory factory;
SOAPFault fault;
if (soapVer == SOAPVersion.SOAP_12) {
factory = SOAPVersion.SOAP_12.getSOAPFactory();
fault = factory.createFault();
fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
fault.appendFaultSubcode(subcode);
fault.appendFaultSubcode(subsubcode);
getInvalidMapDetail(name, fault.addDetail());
} else {
factory = SOAPVersion.SOAP_11.getSOAPFactory();
fault = factory.createFault();
fault.setFaultCode(subsubcode);
}
fault.setFaultString(faultstring);
return fault;
} catch (SOAPException se) {
throw new WebServiceException(se);
}
}
use of jakarta.xml.soap.SOAPFactory in project metro-jax-ws by eclipse-ee4j.
the class WsaTubeHelper method newMapRequiredFault.
public SOAPFault newMapRequiredFault(MissingAddressingHeaderException e) {
QName subcode = addVer.mapRequiredTag;
QName subsubcode = addVer.mapRequiredTag;
String faultstring = addVer.getMapRequiredText();
try {
SOAPFactory factory;
SOAPFault fault;
if (soapVer == SOAPVersion.SOAP_12) {
factory = SOAPVersion.SOAP_12.getSOAPFactory();
fault = factory.createFault();
fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
fault.appendFaultSubcode(subcode);
fault.appendFaultSubcode(subsubcode);
getMapRequiredDetail(e.getMissingHeaderQName(), fault.addDetail());
} else {
factory = SOAPVersion.SOAP_11.getSOAPFactory();
fault = factory.createFault();
fault.setFaultCode(subsubcode);
}
fault.setFaultString(faultstring);
return fault;
} catch (SOAPException se) {
throw new WebServiceException(se);
}
}
use of jakarta.xml.soap.SOAPFactory in project metro-jax-ws by eclipse-ee4j.
the class JAXBTest method createFault.
private static SOAPFault createFault() throws Exception {
SOAPFactory fac = SOAPFactory.newInstance();
SOAPFault sf = fac.createFault("This is a fault.", new QName("http://schemas.xmlsoap.org/wsdl/soap/http", "Client"));
Detail d = sf.addDetail();
SOAPElement de = d.addChildElement(DETAIL1_QNAME);
de.addAttribute(new QName("", "msg1"), "This is the first detail message.");
return sf;
}
use of jakarta.xml.soap.SOAPFactory in project metro-jax-ws by eclipse-ee4j.
the class SOAPFaultBuilderTest method createFault.
private static SOAPFault createFault(SOAPVersion soapVersion) throws Exception {
SOAPFactory fac = soapVersion.getSOAPFactory();
SOAPFault sf = fac.createFault("This is a fault.", soapVersion.faultCodeClient);
Detail d = sf.addDetail();
SOAPElement de = d.addChildElement(DETAIL1_QNAME);
de.addAttribute(new QName("", "msg1"), "This is the first detail message.");
de = d.addChildElement(DETAIL2_QNAME);
de.addAttribute(new QName("", "msg2"), "This is the second detail message.");
return sf;
}
use of jakarta.xml.soap.SOAPFactory in project metro-jax-ws by eclipse-ee4j.
the class TestEndpoint method createSFE.
private SOAPFaultException createSFE() {
try {
SOAPFactory fac = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
SOAPFault sf = fac.createFault("Some error message.", new QName("http://www.w3.org/2003/05/soap-envelope", "Receiver"));
sf.setFaultNode("http://testNode");
return new SOAPFaultException(sf);
} catch (SOAPException e) {
throw new WebServiceException(e);
}
}
Aggregations