use of org.apache.axis2.jaxws.description.ServiceDescription in project axis-axis2-java-core by apache.
the class HandlerLifecycleManagerImpl method createHandlerInstance.
public Handler createHandlerInstance(MessageContext mc, Class handlerClass) throws LifecycleException, ResourceInjectionException {
if (handlerClass == null) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("createHandlerInstanceErr"));
}
ServiceDescription serviceDesc = mc.getEndpointDescription().getServiceDescription();
ResourceInjectionServiceRuntimeDescription injectionDesc = null;
if (serviceDesc != null) {
injectionDesc = ResourceInjectionServiceRuntimeDescriptionFactory.get(serviceDesc, handlerClass);
}
try {
this.instance = handlerClass.newInstance();
} catch (InstantiationException e) {
throw ExceptionFactory.makeWebServiceException(e);
} catch (IllegalAccessException e) {
throw ExceptionFactory.makeWebServiceException(e);
}
// Invoke PostConstruct
if (injectionDesc != null && injectionDesc.getPostConstructMethod() != null) {
invokePostConstruct(injectionDesc.getPostConstructMethod());
}
return (Handler) this.instance;
}
use of org.apache.axis2.jaxws.description.ServiceDescription in project axis-axis2-java-core by apache.
the class MethodMarshallerFactory method isContextPathConstruction.
/**
* @param op
* @return true if JAXBContext constructed using CONTEXT PATH
*/
private static boolean isContextPathConstruction(OperationDescription op, ClassLoader cl) {
ServiceDescription serviceDesc = op.getEndpointInterfaceDescription().getEndpointDescription().getServiceDescription();
MarshalServiceRuntimeDescription marshalDesc = MarshalServiceRuntimeDescriptionFactory.get(serviceDesc);
// Get the JAXBContext...Since this is a cached object we incur no penalty by looking at this point.
Holder<JAXBUtils.CONSTRUCTION_TYPE> holder = new Holder<JAXBUtils.CONSTRUCTION_TYPE>();
try {
JAXBContext context = JAXBUtils.getJAXBContext(marshalDesc.getPackages(), holder, marshalDesc.getPackagesKey(), cl, null);
} catch (JAXBException e) {
throw ExceptionFactory.makeWebServiceException(e);
}
if (holder.value == JAXBUtils.CONSTRUCTION_TYPE.BY_CONTEXT_PATH) {
// objects) are available.
return true;
} else {
// that we need to do the specialized "minimal" marshalling.
return false;
}
}
use of org.apache.axis2.jaxws.description.ServiceDescription in project axis-axis2-java-core by apache.
the class MethodMarshallerFactory method getMarshaller.
public static MethodMarshaller getMarshaller(OperationDescription op, boolean isClient, ClassLoader cl) {
// Always make sure the MarshalServiceRuntimeDescription is built before getting the MethodMarshaller.
// Getting the MarshalServiceRuntimeDescription will ensure that it is built.
ServiceDescription serviceDesc = op.getEndpointInterfaceDescription().getEndpointDescription().getServiceDescription();
MarshalServiceRuntimeDescription marshalDesc = MarshalServiceRuntimeDescriptionFactory.get(serviceDesc);
MethodMarshaller marshaller = null;
if (op.getSoapBindingStyle() == SOAPBinding.Style.DOCUMENT) {
marshaller = createDocLitMethodMarshaller(op, isClient, cl);
} else if (op.getSoapBindingStyle() == SOAPBinding.Style.RPC) {
marshaller = createRPCLitMethodMarshaller(isClient);
}
return marshaller;
}
use of org.apache.axis2.jaxws.description.ServiceDescription in project axis-axis2-java-core by apache.
the class MTOMFeatureTests method testDisabled.
public void testDisabled() {
ServiceDescription sd = DescriptionFactory.createServiceDescription(DisabledService.class);
EndpointDescription ed = sd.getEndpointDescription(new QName(ns, disabledServicePortName));
assertTrue("The EndpointDescription should not be null.", ed != null);
boolean mtomEnabled = ed.isMTOMEnabled();
assertTrue("@MTOM included, and should be disabled.", mtomEnabled == false);
}
use of org.apache.axis2.jaxws.description.ServiceDescription in project axis-axis2-java-core by apache.
the class SubmissionAddressingFeatureTests method testDisabled.
public void testDisabled() {
ServiceDescription sd = DescriptionFactory.createServiceDescription(DisabledService.class);
EndpointDescription ed = sd.getEndpointDescription(new QName(ns, disabledServicePortName));
assertNotNull(ed);
AxisService axisService = ed.getAxisService();
Parameter versionParam = axisService.getParameter(AddressingConstants.WS_ADDRESSING_VERSION);
Parameter disabledParam = axisService.getParameter(AddressingConstants.DISABLE_ADDRESSING_FOR_IN_MESSAGES);
Parameter requiredParam = axisService.getParameter(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);
String version = Utils.getParameterValue(versionParam);
String disabled = Utils.getParameterValue(disabledParam);
String required = Utils.getParameterValue(requiredParam);
assertEquals(AddressingConstants.Final.WSA_NAMESPACE, version);
assertEquals("false", disabled);
assertEquals(AddressingConstants.ADDRESSING_UNSPECIFIED, required);
}
Aggregations