Search in sources :

Example 21 with WebServiceException

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);
    }
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) SOAPException(jakarta.xml.soap.SOAPException) SOAPFault(jakarta.xml.soap.SOAPFault) SOAPFaultException(jakarta.xml.ws.soap.SOAPFaultException)

Example 22 with WebServiceException

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);
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) IOException(java.io.IOException) WebServiceException(jakarta.xml.ws.WebServiceException)

Example 23 with WebServiceException

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);
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) IOException(java.io.IOException) WebServiceException(jakarta.xml.ws.WebServiceException)

Example 24 with WebServiceException

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);
}
Also used : WebServiceException(jakarta.xml.ws.WebServiceException) IOException(java.io.IOException) WebServiceException(jakarta.xml.ws.WebServiceException)

Example 25 with WebServiceException

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));
    }
}
Also used : StartElement(javax.xml.stream.events.StartElement) WebServiceException(jakarta.xml.ws.WebServiceException) XMLStreamException(javax.xml.stream.XMLStreamException) Attribute(javax.xml.stream.events.Attribute) QName(javax.xml.namespace.QName) Iterator(java.util.Iterator)

Aggregations

WebServiceException (jakarta.xml.ws.WebServiceException)386 QName (javax.xml.namespace.QName)49 SOAPFaultException (jakarta.xml.ws.soap.SOAPFaultException)36 SOAPException (jakarta.xml.soap.SOAPException)33 JAXBException (jakarta.xml.bind.JAXBException)30 Node (org.w3c.dom.Node)28 JAXBContext (jakarta.xml.bind.JAXBContext)27 IOException (java.io.IOException)26 SOAPMessage (jakarta.xml.soap.SOAPMessage)25 XMLStreamException (javax.xml.stream.XMLStreamException)25 Source (javax.xml.transform.Source)23 ProtocolException (jakarta.xml.ws.ProtocolException)20 Dispatch (jakarta.xml.ws.Dispatch)19 MalformedURLException (java.net.MalformedURLException)19 MessageContext (jakarta.xml.ws.handler.MessageContext)17 Map (java.util.Map)17 URL (java.net.URL)16 StreamSource (javax.xml.transform.stream.StreamSource)16 HandlerTracker (fromwsdl.handler.common.HandlerTracker)14 HandlerTracker (handler.handler_processing.common.HandlerTracker)14