use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class MUTube method createMUSOAPFaultException.
/**
* @return SOAPfaultException with SOAPFault representing the MustUnderstand SOAP Fault.
* notUnderstoodHeaders are added in the fault detail.
*/
final SOAPFaultException createMUSOAPFaultException(Set<QName> notUnderstoodHeaders) {
try {
SOAPFault fault = soapVersion.getSOAPFactory().createFault(MUST_UNDERSTAND_FAULT_MESSAGE_STRING, soapVersion.faultCodeMustUnderstand);
fault.setFaultString("MustUnderstand headers:" + notUnderstoodHeaders + " are not understood");
return new SOAPFaultException(fault);
} catch (SOAPException e) {
throw new WebServiceException(e);
}
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class WrapperBeanGenerator method createResponseWrapperBean.
static Class createResponseWrapperBean(String className, Method method, QName resElemName, ClassLoader cl) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Response Wrapper Class : {0}", className);
}
List<Field> responseMembers = RUNTIME_GENERATOR.collectResponseBeanMembers(method);
byte[] image;
try {
image = createBeanImage(className, resElemName.getLocalPart(), resElemName.getNamespaceURI(), resElemName.getLocalPart(), resElemName.getNamespaceURI(), responseMembers);
} catch (Exception e) {
throw new WebServiceException(e);
}
return Injector.inject(cl, className, image);
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class WrapperBeanGenerator method createExceptionBean.
static Class createExceptionBean(String className, Class exception, String typeNS, String elemName, String elemNS, ClassLoader cl, boolean decapitalizeExceptionBeanProperties) {
Collection<Field> fields = RUNTIME_GENERATOR.collectExceptionBeanMembers(exception, decapitalizeExceptionBeanProperties);
byte[] image;
try {
image = createBeanImage(className, elemName, elemNS, exception.getSimpleName(), typeNS, fields);
} catch (Exception e) {
throw new WebServiceException(e);
}
return Injector.inject(cl, className, image);
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class WrapperBeanGenerator method createRequestWrapperBean.
static Class createRequestWrapperBean(String className, Method method, QName reqElemName, ClassLoader cl) {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.log(Level.FINE, "Request Wrapper Class : {0}", className);
}
List<Field> requestMembers = RUNTIME_GENERATOR.collectRequestBeanMembers(method);
byte[] image;
try {
image = createBeanImage(className, reqElemName.getLocalPart(), reqElemName.getNamespaceURI(), reqElemName.getLocalPart(), reqElemName.getNamespaceURI(), requestMembers);
} catch (Exception e) {
throw new WebServiceException(e);
}
// write(image, className);
return Injector.inject(cl, className, image);
}
use of jakarta.xml.ws.WebServiceException in project metro-jax-ws by eclipse-ee4j.
the class TubelineFeatureReader method parse.
// TODO implement
public TubelineFeature parse(XMLEventReader reader) throws WebServiceException {
try {
final StartElement element = reader.nextEvent().asStartElement();
boolean attributeEnabled = true;
final Iterator iterator = element.getAttributes();
while (iterator.hasNext()) {
final Attribute nextAttribute = (Attribute) iterator.next();
final QName attributeName = nextAttribute.getName();
if (ENABLED_ATTRIBUTE_NAME.equals(attributeName)) {
attributeEnabled = ParserUtil.parseBooleanValue(nextAttribute.getValue());
} else if (NAME_ATTRIBUTE_NAME.equals(attributeName)) {
// TODO use name attribute
} else {
// TODO logging message
throw LOGGER.logSevereException(new WebServiceException("Unexpected attribute"));
}
}
return parseFactories(attributeEnabled, element, reader);
} catch (XMLStreamException e) {
throw LOGGER.logSevereException(new WebServiceException("Failed to unmarshal XML document", e));
}
}
Aggregations