本文整理汇总了Java中javax.xml.ws.soap.MTOM类的典型用法代码示例。如果您正苦于以下问题:Java MTOM类的具体用法?Java MTOM怎么用?Java MTOM使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MTOM类属于javax.xml.ws.soap包,在下文中一共展示了MTOM类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isMTOMEnabled
import javax.xml.ws.soap.MTOM; //导入依赖的package包/类
public boolean isMTOMEnabled() {
if (isMTOMEnabledCache != null) {
return isMTOMEnabledCache.booleanValue();
}
// isMTOMEnabled is a combination of the @BindingType and the @MTOM setting.
MTOM mtomAnnotation =
(MTOM) getAnnoFeature(MTOMFeature.ID);
// If the @MTOM annotation is set, it wins
if (mtomAnnotation != null) {
isMTOMEnabledCache = Boolean.valueOf(mtomAnnotation.enabled());
return isMTOMEnabledCache.booleanValue();
}
// Else look at the bindingType
String bindingType = getBindingType();
isMTOMEnabledCache = Boolean.valueOf(isMTOMBinding(bindingType));
return isMTOMEnabledCache.booleanValue();
}
示例2: isMtomEnabled
import javax.xml.ws.soap.MTOM; //导入依赖的package包/类
protected boolean isMtomEnabled(Class<?> beanClass)
{
BindingType bindingType = (BindingType)beanClass.getAnnotation(BindingType.class);
MTOM mtom = (MTOM)beanClass.getAnnotation(MTOM.class);
boolean mtomEnabled = mtom != null && mtom.enabled();
if (!mtomEnabled && bindingType != null)
{
String binding = bindingType.value();
mtomEnabled = binding.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING) || binding.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING);
}
return mtomEnabled;
}
示例3: configure
import javax.xml.ws.soap.MTOM; //导入依赖的package包/类
public void configure(EndpointDescription endpointDescription) {
MTOM mtomAnnoation =
(MTOM) ((EndpointDescriptionJava) endpointDescription).getAnnoFeature(MTOMFeature.ID);
AxisService service = endpointDescription.getAxisService();
//Disable MTOM
Parameter enableMTOM = new Parameter(Constants.Configuration.ENABLE_MTOM, Boolean.FALSE);
Parameter threshold = new Parameter(Constants.Configuration.MTOM_THRESHOLD, 0);
if (mtomAnnoation == null) {
throw ExceptionFactory.
makeWebServiceException(Messages.getMessage("mtomAnnotationErr"));
}
//Enable MTOM.
if (mtomAnnoation.enabled()) {
if (log.isDebugEnabled()) {
log.debug("Enabling MTOM via annotation.");
}
enableMTOM.setValue(Boolean.TRUE);
}
//Set the threshold value.
if (mtomAnnoation.threshold() > 0) {
if (log.isDebugEnabled()) {
log.debug("Setting MTOM threshold to [" + mtomAnnoation.threshold() + "].");
}
threshold.setValue(mtomAnnoation.threshold());
}
try {
service.addParameter(enableMTOM);
service.addParameter(threshold);
}
catch (Exception e) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("mtomEnableErr"),
e);
}
}
示例4: configMtomAnnotation
import javax.xml.ws.soap.MTOM; //导入依赖的package包/类
private void configMtomAnnotation(final Class<?> clazz, final PortComponent portComponent) {
final MTOM mtom = clazz.getAnnotation(MTOM.class);
if (mtom != null) {
if (portComponent.getEnableMtom() == null) {
portComponent.setEnableMtom(mtom.enabled());
}
if (portComponent.getMtomThreshold() == null) {
portComponent.setMtomThreshold(mtom.threshold());
}
}
}
示例5: this
import javax.xml.ws.soap.MTOM; //导入依赖的package包/类
/**
*
* creates an instance of RunTimeModeler given a <code>sei</code> and <code>binding</code>
* @param portClass The SEI class to be modeled.
* @param serviceName The ServiceName to use instead of one calculated from the implementation class
* @param wsdlPort {@link com.sun.xml.internal.ws.api.model.wsdl.WSDLPort}
* @param features web service features
*/
/*public RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, @NotNull WSDLPortImpl wsdlPort, @NotNull WebServiceFeature... features){
this(portClass, serviceName, wsdlPort, wsdlPort.getBinding().getBindingId(), features);
}*/
/*private RuntimeModeler(@NotNull Class portClass, @NotNull QName serviceName, WSDLPortImpl binding, BindingID bindingId, @NotNull WebServiceFeature... features) {
this.portClass = portClass;
this.serviceName = serviceName;
this.binding = binding;
this.bindingId = bindingId;
this.features = features;
}*/
public RuntimeModeler(@NotNull DatabindingConfig config){
this.portClass = (config.getEndpointClass() != null)? config.getEndpointClass() : config.getContractClass();
this.serviceName = config.getMappingInfo().getServiceName();
this.binding = config.getWsdlPort();
this.classLoader = config.getClassLoader();
this.portName = config.getMappingInfo().getPortName();
this.config = config;
this.wsBinding = config.getWSBinding();
metadataReader = config.getMetadataReader();
targetNamespace = config.getMappingInfo().getTargetNamespace();
if (metadataReader == null) metadataReader = new ReflectAnnotationReader();
if (wsBinding != null) {
this.bindingId = wsBinding.getBindingId();
if (config.getFeatures() != null) wsBinding.getFeatures().mergeFeatures(config.getFeatures(), false);
if (binding != null) wsBinding.getFeatures().mergeFeatures(binding.getFeatures(), false);
this.features = WebServiceFeatureList.toList(wsBinding.getFeatures());
} else {
this.bindingId = config.getMappingInfo().getBindingID();
this.features = WebServiceFeatureList.toList(config.getFeatures());
if (binding != null) bindingId = binding.getBinding().getBindingId();
if (bindingId == null) bindingId = getDefaultBindingID();
if (!features.contains(MTOMFeature.class)) {
MTOM mtomAn = getAnnotation(portClass, MTOM.class);
if (mtomAn != null) features.add(WebServiceFeatureList.getFeature(mtomAn));
}
if (!features.contains(com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)) {
com.oracle.webservices.internal.api.EnvelopeStyle es = getAnnotation(portClass, com.oracle.webservices.internal.api.EnvelopeStyle.class);
if (es != null) features.add(WebServiceFeatureList.getFeature(es));
}
this.wsBinding = bindingId.createBinding(features);
}
}
示例6: annotationType
import javax.xml.ws.soap.MTOM; //导入依赖的package包/类
@Override
public Class<? extends Annotation> annotationType() {
return MTOM.class;
}
示例7: annotationType
import javax.xml.ws.soap.MTOM; //导入依赖的package包/类
public Class<? extends Annotation> annotationType() {
return MTOM.class;
}