Search in sources :

Example 1 with ServiceDescription

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;
}
Also used : ServiceDescription(org.apache.axis2.jaxws.description.ServiceDescription) ResourceInjectionServiceRuntimeDescription(org.apache.axis2.jaxws.runtime.description.injection.ResourceInjectionServiceRuntimeDescription) Handler(javax.xml.ws.handler.Handler)

Example 2 with ServiceDescription

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;
    }
}
Also used : MarshalServiceRuntimeDescription(org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription) ServiceDescription(org.apache.axis2.jaxws.description.ServiceDescription) Holder(javax.xml.ws.Holder) JAXBException(javax.xml.bind.JAXBException) JAXBContext(javax.xml.bind.JAXBContext) JAXBUtils(org.apache.axis2.jaxws.message.databinding.JAXBUtils)

Example 3 with ServiceDescription

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;
}
Also used : MarshalServiceRuntimeDescription(org.apache.axis2.jaxws.runtime.description.marshal.MarshalServiceRuntimeDescription) ServiceDescription(org.apache.axis2.jaxws.description.ServiceDescription) DocLitWrappedMethodMarshaller(org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller) DocLitBareMethodMarshaller(org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMethodMarshaller) MethodMarshaller(org.apache.axis2.jaxws.marshaller.MethodMarshaller) RPCLitMethodMarshaller(org.apache.axis2.jaxws.marshaller.impl.alt.RPCLitMethodMarshaller) DocLitWrappedPlusMethodMarshaller(org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedPlusMethodMarshaller) DocLitBareMinimalMethodMarshaller(org.apache.axis2.jaxws.marshaller.impl.alt.DocLitBareMinimalMethodMarshaller) DocLitWrappedMinimalMethodMarshaller(org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMinimalMethodMarshaller)

Example 4 with ServiceDescription

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);
}
Also used : ServiceDescription(org.apache.axis2.jaxws.description.ServiceDescription) QName(javax.xml.namespace.QName) EndpointDescription(org.apache.axis2.jaxws.description.EndpointDescription)

Example 5 with ServiceDescription

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);
}
Also used : ServiceDescription(org.apache.axis2.jaxws.description.ServiceDescription) QName(javax.xml.namespace.QName) AxisService(org.apache.axis2.description.AxisService) Parameter(org.apache.axis2.description.Parameter) EndpointDescription(org.apache.axis2.jaxws.description.EndpointDescription)

Aggregations

ServiceDescription (org.apache.axis2.jaxws.description.ServiceDescription)136 QName (javax.xml.namespace.QName)113 EndpointDescription (org.apache.axis2.jaxws.description.EndpointDescription)94 DescriptionBuilderComposite (org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite)87 Service (javax.xml.ws.Service)56 AxisService (org.apache.axis2.description.AxisService)49 URL (java.net.URL)45 Parameter (org.apache.axis2.description.Parameter)29 ServiceDelegate (org.apache.axis2.jaxws.spi.ServiceDelegate)28 HashMap (java.util.HashMap)26 WebServiceClient (javax.xml.ws.WebServiceClient)20 JavaClassToDBCConverter (org.apache.axis2.jaxws.description.builder.converter.JavaClassToDBCConverter)18 WebServiceException (javax.xml.ws.WebServiceException)15 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)15 WebService (javax.jws.WebService)14 MethodDescriptionComposite (org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite)14 WebServiceAnnot (org.apache.axis2.jaxws.description.builder.WebServiceAnnot)14 Definition (javax.wsdl.Definition)13 ParameterDescriptionComposite (org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite)12 HandlerChainsType (org.apache.axis2.jaxws.description.xml.handler.HandlerChainsType)11