本文整理汇总了Java中com.sun.xml.internal.ws.model.JavaMethodImpl.getCheckedExceptions方法的典型用法代码示例。如果您正苦于以下问题:Java JavaMethodImpl.getCheckedExceptions方法的具体用法?Java JavaMethodImpl.getCheckedExceptions怎么用?Java JavaMethodImpl.getCheckedExceptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.xml.internal.ws.model.JavaMethodImpl
的用法示例。
在下文中一共展示了JavaMethodImpl.getCheckedExceptions方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generatePortType
import com.sun.xml.internal.ws.model.JavaMethodImpl; //导入方法依赖的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);
}
}
}
示例2: getFaultActionFromSEIModel
import com.sun.xml.internal.ws.model.JavaMethodImpl; //导入方法依赖的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);
}
}
示例3: generatePortType
import com.sun.xml.internal.ws.model.JavaMethodImpl; //导入方法依赖的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;
}
// 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);
}
}
}
示例4: getFaultActionFromSEIModel
import com.sun.xml.internal.ws.model.JavaMethodImpl; //导入方法依赖的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();
WSDLOperationMapping wsdlOp = requestPacket.getWSDLOperationMapping();
JavaMethodImpl jm = (wsdlOp != null) ? (JavaMethodImpl)wsdlOp.getJavaMethod() : null;
if (jm != null) {
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);
}
}
示例5: StubHandler
import com.sun.xml.internal.ws.model.JavaMethodImpl; //导入方法依赖的package包/类
public StubHandler(JavaMethodImpl method, MessageContextFactory mcf) {
//keep all the CheckedException model for the detail qname
this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
}
//If a non-"" soapAction is specified, wsa:action the SOAPAction
String soapActionFromBinding = method.getBinding().getSOAPAction();
if(method.getInputAction() != null && soapActionFromBinding != null && !soapActionFromBinding.equals("") ) {
this.soapAction = method.getInputAction();
} else {
this.soapAction = soapActionFromBinding;
}
this.javaMethod = method;
packetFactory = mcf;
soapVersion = javaMethod.getBinding().getSOAPVersion();
{// prepare objects for creating messages
List<ParameterImpl> rp = method.getRequestParameters();
BodyBuilder bodyBuilder = null;
List<MessageFiller> fillers = new ArrayList<MessageFiller>();
for (ParameterImpl param : rp) {
ValueGetter getter = getValueGetterFactory().get(param);
switch(param.getInBinding().kind) {
case BODY:
if(param.isWrapperStyle()) {
if(param.getParent().getBinding().isRpcLit())
bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
else
bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
} else {
bodyBuilder = new BodyBuilder.Bare(param, soapVersion, getter);
}
break;
case HEADER:
fillers.add(new MessageFiller.Header(
param.getIndex(),
param.getXMLBridge(),
getter ));
break;
case ATTACHMENT:
fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
break;
case UNBOUND:
break;
default:
throw new AssertionError(); // impossible
}
}
if(bodyBuilder==null) {
// no parameter binds to body. we create an empty message
switch(soapVersion) {
case SOAP_11:
bodyBuilder = BodyBuilder.EMPTY_SOAP11;
break;
case SOAP_12:
bodyBuilder = BodyBuilder.EMPTY_SOAP12;
break;
default:
throw new AssertionError();
}
}
this.bodyBuilder = bodyBuilder;
this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
}
this.isOneWay = method.getMEP().isOneWay();
responseBuilder = buildResponseBuilder(method, ValueSetterFactory.SYNC);
}
示例6: SEIMethodHandler
import com.sun.xml.internal.ws.model.JavaMethodImpl; //导入方法依赖的package包/类
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
super(owner, null);
//keep all the CheckedException model for the detail qname
this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
}
//If a non-"" soapAction is specified, wsa:action the SOAPAction
if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
this.soapAction = method.getInputAction();
} else {
this.soapAction = method.getBinding().getSOAPAction();
}
this.javaMethod = method;
{// prepare objects for creating messages
List<ParameterImpl> rp = method.getRequestParameters();
BodyBuilder tmpBodyBuilder = null;
List<MessageFiller> fillers = new ArrayList<MessageFiller>();
for (ParameterImpl param : rp) {
ValueGetter getter = getValueGetterFactory().get(param);
switch(param.getInBinding().kind) {
case BODY:
if(param.isWrapperStyle()) {
if(param.getParent().getBinding().isRpcLit())
tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
else
tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
} else {
tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
}
break;
case HEADER:
fillers.add(new MessageFiller.Header(
param.getIndex(),
param.getXMLBridge(),
getter ));
break;
case ATTACHMENT:
fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
break;
case UNBOUND:
break;
default:
throw new AssertionError(); // impossible
}
}
if(tmpBodyBuilder==null) {
// no parameter binds to body. we create an empty message
switch(owner.soapVersion) {
case SOAP_11:
tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11;
break;
case SOAP_12:
tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12;
break;
default:
throw new AssertionError();
}
}
this.bodyBuilder = tmpBodyBuilder;
this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
}
this.isOneWay = method.getMEP().isOneWay();
}
示例7: SEIMethodHandler
import com.sun.xml.internal.ws.model.JavaMethodImpl; //导入方法依赖的package包/类
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
super(owner);
//keep all the CheckedException model for the detail qname
this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
checkedExceptions.put(ce.getBridge().getTypeReference().tagName, ce);
}
//If a non-"" soapAction is specified, wsa:action the SOAPAction
if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
this.soapAction = method.getInputAction();
} else {
this.soapAction = method.getBinding().getSOAPAction();
}
this.javaMethod = method;
{// prepare objects for creating messages
List<ParameterImpl> rp = method.getRequestParameters();
BodyBuilder bodyBuilder = null;
List<MessageFiller> fillers = new ArrayList<MessageFiller>();
for (ParameterImpl param : rp) {
ValueGetter getter = getValueGetterFactory().get(param);
switch(param.getInBinding().kind) {
case BODY:
if(param.isWrapperStyle()) {
if(param.getParent().getBinding().isRpcLit())
bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
else
bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
} else {
bodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
}
break;
case HEADER:
fillers.add(new MessageFiller.Header(
param.getIndex(),
param.getBridge(),
getter ));
break;
case ATTACHMENT:
fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
break;
case UNBOUND:
break;
default:
throw new AssertionError(); // impossible
}
}
if(bodyBuilder==null) {
// no parameter binds to body. we create an empty message
switch(owner.soapVersion) {
case SOAP_11:
bodyBuilder = BodyBuilder.EMPTY_SOAP11;
break;
case SOAP_12:
bodyBuilder = BodyBuilder.EMPTY_SOAP12;
break;
default:
throw new AssertionError();
}
}
this.bodyBuilder = bodyBuilder;
this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
}
this.isOneWay = method.getMEP().isOneWay();
}