com.sun.xml.internal.ws.model.CheckedExceptionImpl Java Examples
The following examples show how to use
com.sun.xml.internal.ws.model.CheckedExceptionImpl.
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: SOAPFaultBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #2
Source File: SOAPFaultBuilder.java From hottub with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #3
Source File: SOAPFaultBuilder.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #4
Source File: SOAPFaultBuilder.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #5
Source File: SOAPFaultBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #6
Source File: SOAPFaultBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #7
Source File: SOAPFaultBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #8
Source File: SOAPFaultBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private static Object createDetailFromUserDefinedException(CheckedExceptionImpl ce, Object exception) { Class detailBean = ce.getDetailBean(); if (ce.getExceptionClass().equals(detailBean)) return exception; Field[] fields = detailBean.getDeclaredFields(); try { Object detail = detailBean.newInstance(); for (Field f : fields) { Method em = exception.getClass().getMethod(getReadMethod(f)); try { Method sm = detailBean.getMethod(getWriteMethod(f), em.getReturnType()); sm.invoke(detail, em.invoke(exception)); } catch(NoSuchMethodException ne) { // Try to use exception bean's public field to populate the value. Field sf = detailBean.getField(f.getName()); sf.set(detail, em.invoke(exception)); } } return detail; } catch (Exception e) { throw new SerializationException(e); } }
Example #9
Source File: SOAPFaultBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static Object getFaultDetail(CheckedExceptionImpl ce, Throwable exception) { if (ce == null) return null; if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return createDetailFromUserDefinedException(ce, exception); } try { Method m = exception.getClass().getMethod("getFaultInfo"); return m.invoke(exception); } catch (Exception e) { throw new SerializationException(e); } }
Example #10
Source File: SOAPFaultBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Create the Message with the specified faultCode * * @see #createSOAPFaultMessage(SOAPVersion, CheckedExceptionImpl, Throwable) */ public static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex, QName faultCode) { Object detail = getFaultDetail(ceModel, ex); if(soapVersion == SOAPVersion.SOAP_12) return createSOAP12Fault(soapVersion, ex, detail, ceModel, faultCode); return createSOAP11Fault(soapVersion, ex, detail, ceModel, faultCode); }
Example #11
Source File: WSDLGenerator.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Generates the WSDL portType */ protected void generatePortType() { PortType portType = portDefinitions.portType().name(model.getPortTypeName().getLocalPart()); extension.addPortTypeExtension(portType); for (JavaMethodImpl method : model.getJavaMethods()) { Operation operation = portType.operation().name(method.getOperationName()); generateParameterOrder(operation, method); extension.addOperationExtension(operation, method); switch (method.getMEP()) { case REQUEST_RESPONSE: // input message generateInputMessage(operation, method); // output message generateOutputMessage(operation, method); break; case ONE_WAY: generateInputMessage(operation, method); break; default: break; } // faults for (CheckedExceptionImpl exception : method.getCheckedExceptions()) { QName messageName = new QName(model.getTargetNamespace(), exception.getMessageName()); FaultType paramType = operation.fault().message(messageName).name(exception.getMessageName()); extension.addOperationFaultExtension(paramType, method, exception); } } }
Example #12
Source File: WSDLGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Generates the WSDL portType */ protected void generatePortType() { PortType portType = portDefinitions.portType().name(model.getPortTypeName().getLocalPart()); extension.addPortTypeExtension(portType); for (JavaMethodImpl method : model.getJavaMethods()) { Operation operation = portType.operation().name(method.getOperationName()); generateParameterOrder(operation, method); extension.addOperationExtension(operation, method); switch (method.getMEP()) { case REQUEST_RESPONSE: // input message generateInputMessage(operation, method); // output message generateOutputMessage(operation, method); break; case ONE_WAY: generateInputMessage(operation, method); break; default: break; } // faults for (CheckedExceptionImpl exception : method.getCheckedExceptions()) { QName messageName = new QName(model.getTargetNamespace(), exception.getMessageName()); FaultType paramType = operation.fault().message(messageName).name(exception.getMessageName()); extension.addOperationFaultExtension(paramType, method, exception); } } }
Example #13
Source File: W3CAddressingMetadataWSDLGeneratorExtension.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private static final String getFaultAction(JavaMethod method, CheckedException ce) { String faultaction = ((CheckedExceptionImpl)ce).getFaultAction(); if (faultaction.equals("")) { faultaction = getDefaultFaultAction(method,ce); } return faultaction; }
Example #14
Source File: SOAPFaultBuilder.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * This should be called from the client side to throw an {@link Exception} for a given soap mesage */ public Throwable createException(Map<QName, CheckedExceptionImpl> exceptions) throws JAXBException { DetailType dt = getDetail(); Node detail = null; if(dt != null) detail = dt.getDetail(0); //return ProtocolException if the detail is not present or there is no checked exception if(detail == null || exceptions == null){ // No soap detail, doesnt look like its a checked exception // throw a protocol exception return attachServerException(getProtocolException()); } //check if the detail is a checked exception, if not throw a ProtocolException QName detailName = new QName(detail.getNamespaceURI(), detail.getLocalName()); CheckedExceptionImpl ce = exceptions.get(detailName); if (ce == null) { //No Checked exception for the received detail QName, throw a SOAPFault exception return attachServerException(getProtocolException()); } if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return attachServerException(createUserDefinedException(ce)); } Class exceptionClass = ce.getExceptionClass(); try { Constructor constructor = exceptionClass.getConstructor(String.class, (Class) ce.getDetailType().type); Exception exception = (Exception) constructor.newInstance(getFaultString(), getJAXBObject(detail, ce)); return attachServerException(exception); } catch (Exception e) { throw new WebServiceException(e); } }
Example #15
Source File: W3CAddressingMetadataWSDLGeneratorExtension.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static final String getFaultAction(JavaMethod method, CheckedException ce) { String faultaction = ((CheckedExceptionImpl)ce).getFaultAction(); if (faultaction.equals("")) { faultaction = getDefaultFaultAction(method,ce); } return faultaction; }
Example #16
Source File: SOAPFaultBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Create the Message with the specified faultCode * * @see #createSOAPFaultMessage(SOAPVersion, CheckedExceptionImpl, Throwable) */ public static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex, QName faultCode) { Object detail = getFaultDetail(ceModel, ex); if(soapVersion == SOAPVersion.SOAP_12) return createSOAP12Fault(soapVersion, ex, detail, ceModel, faultCode); return createSOAP11Fault(soapVersion, ex, detail, ceModel, faultCode); }
Example #17
Source File: W3CAddressingMetadataWSDLGeneratorExtension.java From hottub with GNU General Public License v2.0 | 5 votes |
private static final String getFaultAction(JavaMethod method, CheckedException ce) { String faultaction = ((CheckedExceptionImpl)ce).getFaultAction(); if (faultaction.equals("")) { faultaction = getDefaultFaultAction(method,ce); } return faultaction; }
Example #18
Source File: SOAPFaultBuilder.java From hottub with GNU General Public License v2.0 | 5 votes |
private static Object getFaultDetail(CheckedExceptionImpl ce, Throwable exception) { if (ce == null) return null; if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return createDetailFromUserDefinedException(ce, exception); } try { Method m = exception.getClass().getMethod("getFaultInfo"); return m.invoke(exception); } catch (Exception e) { throw new SerializationException(e); } }
Example #19
Source File: SOAPFaultBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * This should be called from the client side to throw an {@link Exception} for a given soap mesage */ public Throwable createException(Map<QName, CheckedExceptionImpl> exceptions) throws JAXBException { DetailType dt = getDetail(); Node detail = null; if(dt != null) detail = dt.getDetail(0); //return ProtocolException if the detail is not present or there is no checked exception if(detail == null || exceptions == null){ // No soap detail, doesnt look like its a checked exception // throw a protocol exception return attachServerException(getProtocolException()); } //check if the detail is a checked exception, if not throw a ProtocolException QName detailName = new QName(detail.getNamespaceURI(), detail.getLocalName()); CheckedExceptionImpl ce = exceptions.get(detailName); if (ce == null) { //No Checked exception for the received detail QName, throw a SOAPFault exception return attachServerException(getProtocolException()); } if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return attachServerException(createUserDefinedException(ce)); } Class exceptionClass = ce.getExceptionClass(); try { Constructor constructor = exceptionClass.getConstructor(String.class, (Class) ce.getDetailType().type); Exception exception = (Exception) constructor.newInstance(getFaultString(), getJAXBObject(detail, ce)); return attachServerException(exception); } catch (Exception e) { throw new WebServiceException(e); } }
Example #20
Source File: SOAPFaultBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Create the Message with the specified faultCode * * @see #createSOAPFaultMessage(SOAPVersion, CheckedExceptionImpl, Throwable) */ public static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex, QName faultCode) { Object detail = getFaultDetail(ceModel, ex); if(soapVersion == SOAPVersion.SOAP_12) return createSOAP12Fault(soapVersion, ex, detail, ceModel, faultCode); return createSOAP11Fault(soapVersion, ex, detail, ceModel, faultCode); }
Example #21
Source File: SOAPFaultBuilder.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Create the Message with the specified faultCode * * @see #createSOAPFaultMessage(SOAPVersion, CheckedExceptionImpl, Throwable) */ public static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex, QName faultCode) { Object detail = getFaultDetail(ceModel, ex); if(soapVersion == SOAPVersion.SOAP_12) return createSOAP12Fault(soapVersion, ex, detail, ceModel, faultCode); return createSOAP11Fault(soapVersion, ex, detail, ceModel, faultCode); }
Example #22
Source File: SOAPFaultBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private static Object getFaultDetail(CheckedExceptionImpl ce, Throwable exception) { if (ce == null) return null; if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return createDetailFromUserDefinedException(ce, exception); } try { Method m = exception.getClass().getMethod("getFaultInfo"); return m.invoke(exception); } catch (Exception e) { throw new SerializationException(e); } }
Example #23
Source File: WSDLGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Generates the WSDL portType */ protected void generatePortType() { PortType portType = portDefinitions.portType().name(model.getPortTypeName().getLocalPart()); extension.addPortTypeExtension(portType); for (JavaMethodImpl method : model.getJavaMethods()) { Operation operation = portType.operation().name(method.getOperationName()); generateParameterOrder(operation, method); extension.addOperationExtension(operation, method); switch (method.getMEP()) { case REQUEST_RESPONSE: // input message generateInputMessage(operation, method); // output message generateOutputMessage(operation, method); break; case ONE_WAY: generateInputMessage(operation, method); break; default: break; } // faults for (CheckedExceptionImpl exception : method.getCheckedExceptions()) { QName messageName = new QName(model.getTargetNamespace(), exception.getMessageName()); FaultType paramType = operation.fault().message(messageName).name(exception.getMessageName()); extension.addOperationFaultExtension(paramType, method, exception); } } }
Example #24
Source File: W3CAddressingMetadataWSDLGeneratorExtension.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private static final String getFaultAction(JavaMethod method, CheckedException ce) { String faultaction = ((CheckedExceptionImpl)ce).getFaultAction(); if (faultaction.equals("")) { faultaction = getDefaultFaultAction(method,ce); } return faultaction; }
Example #25
Source File: SOAPFaultBuilder.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * This should be called from the client side to throw an {@link Exception} for a given soap mesage */ public Throwable createException(Map<QName, CheckedExceptionImpl> exceptions) throws JAXBException { DetailType dt = getDetail(); Node detail = null; if(dt != null) detail = dt.getDetail(0); //return ProtocolException if the detail is not present or there is no checked exception if(detail == null || exceptions == null){ // No soap detail, doesnt look like its a checked exception // throw a protocol exception return attachServerException(getProtocolException()); } //check if the detail is a checked exception, if not throw a ProtocolException QName detailName = new QName(detail.getNamespaceURI(), detail.getLocalName()); CheckedExceptionImpl ce = exceptions.get(detailName); if (ce == null) { //No Checked exception for the received detail QName, throw a SOAPFault exception return attachServerException(getProtocolException()); } if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return attachServerException(createUserDefinedException(ce)); } Class exceptionClass = ce.getExceptionClass(); try { Constructor constructor = exceptionClass.getConstructor(String.class, (Class) ce.getDetailType().type); Exception exception = (Exception) constructor.newInstance(getFaultString(), getJAXBObject(detail, ce)); return attachServerException(exception); } catch (Exception e) { throw new WebServiceException(e); } }
Example #26
Source File: SOAPFaultBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * This should be called from the client side to throw an {@link Exception} for a given soap mesage */ public Throwable createException(Map<QName, CheckedExceptionImpl> exceptions) throws JAXBException { DetailType dt = getDetail(); Node detail = null; if(dt != null) detail = dt.getDetail(0); //return ProtocolException if the detail is not present or there is no checked exception if(detail == null || exceptions == null){ // No soap detail, doesnt look like its a checked exception // throw a protocol exception return attachServerException(getProtocolException()); } //check if the detail is a checked exception, if not throw a ProtocolException QName detailName = new QName(detail.getNamespaceURI(), detail.getLocalName()); CheckedExceptionImpl ce = exceptions.get(detailName); if (ce == null) { //No Checked exception for the received detail QName, throw a SOAPFault exception return attachServerException(getProtocolException()); } if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return attachServerException(createUserDefinedException(ce)); } Class exceptionClass = ce.getExceptionClass(); try { Constructor constructor = exceptionClass.getConstructor(String.class, (Class) ce.getDetailType().type); Exception exception = (Exception) constructor.newInstance(getFaultString(), getJAXBObject(detail, ce)); return attachServerException(exception); } catch (Exception e) { throw new WebServiceException(e); } }
Example #27
Source File: SOAPFaultBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Create the Message with the specified faultCode * * @see #createSOAPFaultMessage(SOAPVersion, CheckedExceptionImpl, Throwable) */ public static Message createSOAPFaultMessage(SOAPVersion soapVersion, CheckedExceptionImpl ceModel, Throwable ex, QName faultCode) { Object detail = getFaultDetail(ceModel, ex); if(soapVersion == SOAPVersion.SOAP_12) return createSOAP12Fault(soapVersion, ex, detail, ceModel, faultCode); return createSOAP11Fault(soapVersion, ex, detail, ceModel, faultCode); }
Example #28
Source File: W3CAddressingMetadataWSDLGeneratorExtension.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private static final String getFaultAction(JavaMethod method, CheckedException ce) { String faultaction = ((CheckedExceptionImpl)ce).getFaultAction(); if (faultaction.equals("")) { faultaction = getDefaultFaultAction(method,ce); } return faultaction; }
Example #29
Source File: SOAPFaultBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private static Object getFaultDetail(CheckedExceptionImpl ce, Throwable exception) { if (ce == null) return null; if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return createDetailFromUserDefinedException(ce, exception); } try { return ce.getFaultInfoGetter().invoke(exception); } catch (Exception e) { throw new SerializationException(e); } }
Example #30
Source File: SOAPFaultBuilder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private static Object getFaultDetail(CheckedExceptionImpl ce, Throwable exception) { if (ce == null) return null; if (ce.getExceptionType().equals(ExceptionType.UserDefined)) { return createDetailFromUserDefinedException(ce, exception); } try { Method m = exception.getClass().getMethod("getFaultInfo"); return m.invoke(exception); } catch (Exception e) { throw new SerializationException(e); } }