com.sun.xml.internal.ws.spi.db.DatabindingException Java Examples

The following examples show how to use com.sun.xml.internal.ws.spi.db.DatabindingException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EndpointArgumentsBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
    if (dynamicWrapper) {
        readWrappedRequest(msg, args);
    } else {
        if (parts.length>0) {
            if (!msg.hasPayload()) {
                throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element");
            }
            XMLStreamReader reader = msg.readPayload();
            XMLStreamReaderUtil.verifyTag(reader, wrapperName);
            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);

            try {
                for (PartBuilder part : parts) {
                    part.readRequest(args,wrapperBean);
                }
            } catch (DatabindingException e) {
                // this can happen when the set method throw a checked exception or something like that
                throw new WebServiceException(e);    // TODO:i18n
            }

            // we are done with the body
            reader.close();
            XMLStreamReaderFactory.recycle(reader);
        } else {
            msg.consume();
        }
    }
}
 
Example #2
Source File: JAXBRIContextFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #3
Source File: RawAccessorWrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(Object bean) throws DatabindingException {
    try {
        return accessor.get(bean);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #4
Source File: RawAccessorWrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void set(Object bean, Object value) throws DatabindingException {
    try {
        accessor.set(bean, value);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #5
Source File: BridgeWrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public final T unmarshal(Source in) throws DatabindingException {
    try {
        return bridge.unmarshal(in);
    } catch (JAXBException e) {
        throw new DatabindingException(e);
    }
}
 
Example #6
Source File: EndpointArgumentsBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
    if (dynamicWrapper) {
        readWrappedRequest(msg, args);
    } else {
        if (parts.length>0) {
            if (!msg.hasPayload()) {
                throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element");
            }
            XMLStreamReader reader = msg.readPayload();
            XMLStreamReaderUtil.verifyTag(reader, wrapperName);
            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);

            try {
                for (PartBuilder part : parts) {
                    part.readRequest(args,wrapperBean);
                }
            } catch (DatabindingException e) {
                // this can happen when the set method throw a checked exception or something like that
                throw new WebServiceException(e);    // TODO:i18n
            }

            // we are done with the body
            reader.close();
            XMLStreamReaderFactory.recycle(reader);
        } else {
            msg.consume();
        }
    }
}
 
Example #7
Source File: JAXBRIContextFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #8
Source File: RawAccessorWrapper.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(Object bean) throws DatabindingException {
    try {
        return accessor.get(bean);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #9
Source File: RawAccessorWrapper.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void set(Object bean, Object value) throws DatabindingException {
    try {
        accessor.set(bean, value);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #10
Source File: BridgeWrapper.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public final T unmarshal(Source in) throws DatabindingException {
    try {
        return bridge.unmarshal(in);
    } catch (JAXBException e) {
        throw new DatabindingException(e);
    }
}
 
Example #11
Source File: EndpointArgumentsBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
    if (dynamicWrapper) {
        readWrappedRequest(msg, args);
    } else {
        if (parts.length>0) {
            if (!msg.hasPayload()) {
                throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element");
            }
            XMLStreamReader reader = msg.readPayload();
            XMLStreamReaderUtil.verifyTag(reader, wrapperName);
            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);

            try {
                for (PartBuilder part : parts) {
                    part.readRequest(args,wrapperBean);
                }
            } catch (DatabindingException e) {
                // this can happen when the set method throw a checked exception or something like that
                throw new WebServiceException(e);    // TODO:i18n
            }

            // we are done with the body
            reader.close();
            XMLStreamReaderFactory.recycle(reader);
        } else {
            msg.consume();
        }
    }
}
 
Example #12
Source File: JAXBRIContextFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #13
Source File: RawAccessorWrapper.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(Object bean) throws DatabindingException {
    try {
        return accessor.get(bean);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #14
Source File: RawAccessorWrapper.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void set(Object bean, Object value) throws DatabindingException {
    try {
        accessor.set(bean, value);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #15
Source File: BridgeWrapper.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public final T unmarshal(Source in) throws DatabindingException {
    try {
        return bridge.unmarshal(in);
    } catch (JAXBException e) {
        throw new DatabindingException(e);
    }
}
 
Example #16
Source File: EndpointArgumentsBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
    if (dynamicWrapper) {
        readWrappedRequest(msg, args);
    } else {
        if (parts.length>0) {
            if (!msg.hasPayload()) {
                throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element");
            }
            XMLStreamReader reader = msg.readPayload();
            XMLStreamReaderUtil.verifyTag(reader, wrapperName);
            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);

            try {
                for (PartBuilder part : parts) {
                    part.readRequest(args,wrapperBean);
                }
            } catch (DatabindingException e) {
                // this can happen when the set method throw a checked exception or something like that
                throw new WebServiceException(e);    // TODO:i18n
            }

            // we are done with the body
            reader.close();
            XMLStreamReaderFactory.recycle(reader);
        } else {
            msg.consume();
        }
    }
}
 
Example #17
Source File: JAXBRIContextFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #18
Source File: RawAccessorWrapper.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(Object bean) throws DatabindingException {
    try {
        return accessor.get(bean);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #19
Source File: RawAccessorWrapper.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void set(Object bean, Object value) throws DatabindingException {
    try {
        accessor.set(bean, value);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #20
Source File: BridgeWrapper.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public final T unmarshal(Source in) throws DatabindingException {
    try {
        return bridge.unmarshal(in);
    } catch (JAXBException e) {
        throw new DatabindingException(e);
    }
}
 
Example #21
Source File: EndpointArgumentsBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
    if (dynamicWrapper) {
        readWrappedRequest(msg, args);
    } else {
        if (parts.length>0) {
            if (!msg.hasPayload()) {
                throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element");
            }
            XMLStreamReader reader = msg.readPayload();
            XMLStreamReaderUtil.verifyTag(reader, wrapperName);
            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);

            try {
                for (PartBuilder part : parts) {
                    part.readRequest(args,wrapperBean);
                }
            } catch (DatabindingException e) {
                // this can happen when the set method throw a checked exception or something like that
                throw new WebServiceException(e);    // TODO:i18n
            }

            // we are done with the body
            reader.close();
            XMLStreamReaderFactory.recycle(reader);
        } else {
            msg.consume();
        }
    }
}
 
Example #22
Source File: JAXBRIContextFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #23
Source File: RawAccessorWrapper.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(Object bean) throws DatabindingException {
    try {
        return accessor.get(bean);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #24
Source File: RawAccessorWrapper.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void set(Object bean, Object value) throws DatabindingException {
    try {
        accessor.set(bean, value);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #25
Source File: BridgeWrapper.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public final T unmarshal(Source in) throws DatabindingException {
    try {
        return bridge.unmarshal(in);
    } catch (JAXBException e) {
        throw new DatabindingException(e);
    }
}
 
Example #26
Source File: EndpointArgumentsBuilder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void readRequest(Message msg, Object[] args) throws JAXBException, XMLStreamException {
    if (dynamicWrapper) {
        readWrappedRequest(msg, args);
    } else {
        if (parts.length>0) {
            if (!msg.hasPayload()) {
                throw new WebServiceException("No payload. Expecting payload with "+wrapperName+" element");
            }
            XMLStreamReader reader = msg.readPayload();
            XMLStreamReaderUtil.verifyTag(reader, wrapperName);
            Object wrapperBean = wrapper.unmarshal(reader, (msg.getAttachments() != null) ?
                    new AttachmentUnmarshallerImpl(msg.getAttachments()): null);

            try {
                for (PartBuilder part : parts) {
                    part.readRequest(args,wrapperBean);
                }
            } catch (DatabindingException e) {
                // this can happen when the set method throw a checked exception or something like that
                throw new WebServiceException(e);    // TODO:i18n
            }

            // we are done with the body
            reader.close();
            XMLStreamReaderFactory.recycle(reader);
        } else {
            msg.consume();
        }
    }
}
 
Example #27
Source File: JAXBRIContextFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example #28
Source File: RawAccessorWrapper.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object get(Object bean) throws DatabindingException {
    try {
        return accessor.get(bean);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #29
Source File: RawAccessorWrapper.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void set(Object bean, Object value) throws DatabindingException {
    try {
        accessor.set(bean, value);
    } catch (AccessorException e) {
        throw new DatabindingException(e);
    }
}
 
Example #30
Source File: BridgeWrapper.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public final T unmarshal(Source in) throws DatabindingException {
    try {
        return bridge.unmarshal(in);
    } catch (JAXBException e) {
        throw new DatabindingException(e);
    }
}