本文整理汇总了Java中com.sun.xml.internal.ws.model.CheckedExceptionImpl类的典型用法代码示例。如果您正苦于以下问题:Java CheckedExceptionImpl类的具体用法?Java CheckedExceptionImpl怎么用?Java CheckedExceptionImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckedExceptionImpl类属于com.sun.xml.internal.ws.model包,在下文中一共展示了CheckedExceptionImpl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createDetailFromUserDefinedException
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
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);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:SOAPFaultBuilder.java
示例2: createDetailFromUserDefinedException
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
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);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:SOAPFaultBuilder.java
示例3: createException
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
/**
* 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);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:SOAPFaultBuilder.java
示例4: createSOAPFaultMessage
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
/**
* 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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:SOAPFaultBuilder.java
示例5: getFaultDetail
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
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);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:SOAPFaultBuilder.java
示例6: generatePortType
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
/**
* 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);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:WSDLGenerator.java
示例7: getFaultAction
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
private static final String getFaultAction(JavaMethod method,
CheckedException ce) {
String faultaction = ((CheckedExceptionImpl)ce).getFaultAction();
if (faultaction.equals("")) {
faultaction = getDefaultFaultAction(method,ce);
}
return faultaction;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:W3CAddressingMetadataWSDLGeneratorExtension.java
示例8: getFaultDetail
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
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);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:SOAPFaultBuilder.java
示例9: getFaultActionFromSEIModel
import com.sun.xml.internal.ws.model.CheckedExceptionImpl; //导入依赖的package包/类
String getFaultActionFromSEIModel(Packet requestPacket, Packet responsePacket) {
String action = null;
if (seiModel == null || wsdlPort == null)
return action;
try {
SOAPMessage sm = responsePacket.getMessage().copy().readAsSOAPMessage();
if (sm == null)
return action;
if (sm.getSOAPBody() == null)
return action;
if (sm.getSOAPBody().getFault() == null)
return action;
Detail detail = sm.getSOAPBody().getFault().getDetail();
if (detail == null)
return action;
String ns = detail.getFirstChild().getNamespaceURI();
String name = detail.getFirstChild().getLocalName();
QName wsdlOp = requestPacket.getWSDLOperation();
JavaMethodImpl jm = (JavaMethodImpl) seiModel.getJavaMethodForWsdlOperation(wsdlOp);
for (CheckedExceptionImpl ce : jm.getCheckedExceptions()) {
if (ce.getDetailType().tagName.getLocalPart().equals(name) &&
ce.getDetailType().tagName.getNamespaceURI().equals(ns)) {
return ce.getFaultAction();
}
}
return action;
} catch (SOAPException e) {
throw new WebServiceException(e);
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:37,代码来源:WsaTubeHelper.java
注:本文中的com.sun.xml.internal.ws.model.CheckedExceptionImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论