Examples of AxisMessage


Examples of org.apache.axis2.description.AxisMessage

    return queryParams;
  }
 
  private static Result getResultFromAxisOperation(DataService dataService, AxisOperation axisOperation)
      throws DataServiceFault {
    AxisMessage axisMessage = getAxisMessageFromOperation(axisOperation, "out");
    // if no out message, then no result
    if (axisMessage == null) {
      return null;
    }   
    String elementName = null, rowName = null, namespace = null;   
    XmlSchemaElement wrapperSchemaElement = axisMessage.getSchemaElement();
    elementName = wrapperSchemaElement.getName();
    namespace = wrapperSchemaElement.getQName().getNamespaceURI();
   
    XmlSchemaType wrapperSchemaType = wrapperSchemaElement.getSchemaType();   
    if (!(wrapperSchemaType instanceof XmlSchemaComplexType)) {
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

        SOAPEnvelope soapEnvelope = soapFactory.getDefaultEnvelope();
        SOAPBody body = soapEnvelope.getBody();
        XmlSchemaElement xmlSchemaElement;
        AxisOperation axisOperation = messageContext.getAxisOperation();
        if (axisOperation != null) {
            AxisMessage axisMessage =
                    axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            xmlSchemaElement = axisMessage.getSchemaElement();

            if (xmlSchemaElement == null) {
                OMElement bodyFirstChild =
                        soapFactory
                                .createOMElement(messageContext.getAxisOperation().getName(), body);
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

                               List<ResourceDescription> facts,
                               InputAdapterFactory factory) {
        try {
            String methodName = axisOperation.getName().getLocalPart();
            String partQName = methodName + Java2WSDLConstants.MESSAGE_SUFFIX;
            AxisMessage inMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            inMessage.setName(partQName);
            XmlSchemaSequence sequence = generateSchema(facts,
                    partQName, factory.getInputAdapters(), "parameter");
            XmlSchemaComplexType methodSchemaType =
                    createSchemaTypeForMethodPart(partQName);
            if (sequence != null) {
                methodSchemaType.setParticle(sequence);
            }
            QName elementQName = typeTable.getQNamefortheType(partQName);
            setParentElementQName(facts, elementQName);
            inMessage.setElementQName(elementQName);
            service.addMessageElementQNameToOperationMapping(methodSchemaType.getQName(),
                    axisOperation);
        } catch (Exception e) {
            throw new LoggedRuntimeException("Error when preparing in-message " +
                    "of operation : " + axisOperation.getName(), e, log);
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

            if (!OMElementResourceAdapter.TYPE.equals(firstDescription.getType())) {
                throw new LoggedRuntimeException("Invalid result !! result type is invalid", log);
            }
            String methodName = axisOperation.getName().getLocalPart();
            String partQName = methodName + RESPONSE;
            AxisMessage outMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            outMessage.setName(partQName);
            XmlSchemaSequence sequence = generateSchema(firstDescription.getChildResources(),
                    partQName, factory.getOutputAdapters(), "item");
             XmlSchemaComplexType methodSchemaType =
                    createSchemaTypeForMethodPart(partQName);
            if(sequence != null){
                methodSchemaType.setParticle(sequence);
            }
            QName elementQName = typeTable.getQNamefortheType(partQName);
            setParentElementQName((List)results.get(0).getChildResources(), elementQName);
            outMessage.setElementQName(elementQName);
            firstDescription.setElementQName(elementQName);
            service.addMessageElementQNameToOperationMapping(methodSchemaType.getQName(),
                    axisOperation);
        } catch (Exception e) {
            throw new LoggedRuntimeException("Error when preparing out-message " +
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

   * @param operation
   */
  private static String getParameterListForOperation(AxisOperation operation) {
    //Logic copied from BuilderUtil.buildsoapMessage(...)
    StringBuffer paramList = new StringBuffer();
    AxisMessage axisMessage =
        operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    XmlSchemaElement xmlSchemaElement = axisMessage.getSchemaElement();
    if(xmlSchemaElement != null){     
        XmlSchemaType schemaType = xmlSchemaElement.getSchemaType();
        if (schemaType instanceof XmlSchemaComplexType) {
            XmlSchemaComplexType complexType = ((XmlSchemaComplexType)schemaType);
            XmlSchemaParticle particle = complexType.getParticle();
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

                        operationPolicy.getId());
            }

            if (!(axisOperation instanceof OutOnlyAxisOperation)) {
                // Get Service Operation Message Policies
                AxisMessage axisInMessage = axisOperation
                        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

                // Get the message in policy
                List<PolicyComponent> messageInPolicyList = new ArrayList<PolicyComponent>(
                        axisInMessage.getPolicySubject().getAttachedPolicyComponents());
                Policy messageInPolicy = PolicyUtil.getMergedPolicy(messageInPolicyList, axisInMessage);

                if (messageInPolicy != null) {
                    // Add this policy as a resource to the list
                    addPolicyResource(policyResources,
                            messageInPolicy, PolicyInclude.AXIS_MESSAGE_POLICY);
                    // Refer this policy from the operation resource
                    operationResource.setProperty(RegistryResources.ServiceProperties
                            .MESSAGE_IN_POLICY_UUID, messageInPolicy.getId());
                }
            }

            // Get the message out policy
            if (!(axisOperation instanceof InOnlyAxisOperation)) {
                AxisMessage axisOutMessage = axisOperation
                        .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                List<PolicyComponent> messageOutPolicyList = new ArrayList<PolicyComponent>(
                        axisOutMessage.getPolicySubject().getAttachedPolicyComponents());
                Policy messageOutPolicy = PolicyUtil
                        .getMergedPolicy(messageOutPolicyList, axisOutMessage);

                if (messageOutPolicy != null) {
                    // Add this policy as a resource to the list
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

    public Set getTopElements() {

        Set topSchemaElements = new HashSet();
        AxisOperation axisOperation;
        AxisMessage axisMessage;
        TopElement topElement;
        XmlSchemaElement xmlSchemaElement;
        SOAPHeaderMessage soapHeaderMessage;

        for (Iterator operationIter = axisService.getOperations(); operationIter.hasNext();) {
            axisOperation = (AxisOperation) operationIter.next();
            for (Iterator messageIter = axisOperation.getMessages(); messageIter.hasNext();) {
                axisMessage = (AxisMessage) messageIter.next();
                topElement = new TopElement(axisMessage.getElementQName());
                xmlSchemaElement = axisMessage.getSchemaElement();
                topElement.setTypeQName(xmlSchemaElement.getSchemaTypeName());
                topSchemaElements.add(topElement);
                // adding header messages
                for (Iterator soapHeaderIter = axisMessage.getSoapHeaders().iterator(); soapHeaderIter.hasNext();) {
                    soapHeaderMessage = (SOAPHeaderMessage) soapHeaderIter.next();
                    topElement = new TopElement(soapHeaderMessage.getElement());
                    topSchemaElements.add(topElement);
                    xmlSchemaElement = getSchemaElement(soapHeaderMessage.getElement());
                    topElement.setTypeQName(xmlSchemaElement.getSchemaTypeName());
                    topSchemaElements.add(topElement);
                }
            }

            for (Iterator faultMessagesIter = axisOperation.getFaultMessages().iterator();
                 faultMessagesIter.hasNext();) {
                axisMessage = (AxisMessage) faultMessagesIter.next();
                topElement = new TopElement(axisMessage.getElementQName());
                xmlSchemaElement = axisMessage.getSchemaElement();
                topElement.setTypeQName(xmlSchemaElement.getSchemaTypeName());
                topSchemaElements.add(topElement);
            }
        }
        return topSchemaElements;
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

        mc.setServiceContext(sc);

        mc.setTo(new EndpointReference("axis2/services/NullService"));
        mc.setWSAAction("DummyOp");

        AxisMessage axisMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        mc.setAxisMessage(axisMessage);

        return mc;
    }
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

     * @param param
     */
    protected void addCSpecifcAttributes(Document doc, AxisOperation operation, Element param,
                                         String messageType) {
        String typeMappingStr;
        AxisMessage message;

        if (messageType.equals(WSDLConstants.MESSAGE_LABEL_IN_VALUE))
            message = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        else
            message = operation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

        QName typeMapping = message.getElementQName();

        String paramType = this.mapper.getTypeMappingName(message.getElementQName());
        if (doc == null || paramType == null || param == null) {
            return;
        }

        if (message != null) {
            String type = this.mapper.getTypeMappingName(message.getElementQName());
            typeMappingStr = (type == null)
                    ? ""
                    : type;
        } else {
            typeMappingStr = "";
View Full Code Here

Examples of org.apache.axis2.description.AxisMessage

            AxisOperation axisOperation = service.getOperation(new QName(methodName));
            if (axisOperation == null) {
                axisOperation = Utils.getAxisOperationForJmethod(jMethod);
                if (WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(
                        axisOperation.getMessageExchangePattern())){
                    AxisMessage outMessage = axisOperation.getMessage(
                            WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                    if (outMessage !=null ){
                        outMessage.setName(methodName + RESPONSE);
                    }
                }
                addToService = true;
            }
            // Maintain a list of methods we actually work with
            list.add(jMethod);

            processException(jMethod,axisOperation);
            uniqueMethods.put(methodName, jMethod);
            JParameter[] paras = jMethod.getParameters();
            String parameterNames[] = null;
            AxisMessage inMessage = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
            if (inMessage != null) {
                inMessage.setName(methodName + Java2WSDLConstants.MESSAGE_SUFFIX);
            }
            if (paras.length > 0) {
                parameterNames = methodTable.getParameterNames(methodName);
                sequence = new XmlSchemaSequence();

                methodSchemaType = createSchemaTypeForMethodPart(methodName);
                methodSchemaType.setParticle(sequence);
                inMessage.setElementQName(typeTable.getQNamefortheType(methodName));
                service.addMessageElementQNameToOperationMapping(methodSchemaType.getQName(),
                        axisOperation);
            }

            for (int j = 0; j < paras.length; j++) {
                JParameter methodParameter = paras[j];
                String parameterName = null;
                JAnnotation paramterAnnon =
                        methodParameter.getAnnotation(AnnotationConstants.WEB_PARAM);
                if (paramterAnnon != null) {
                    parameterName =
                            paramterAnnon.getValue(AnnotationConstants.NAME).asString();
                }
                if (parameterName == null || "".equals(parameterName)) {
                    parameterName = (parameterNames != null && parameterNames[j] != null) ?
                            parameterNames[j] : getSimpleName(methodParameter);
                }
                JClass paraType = methodParameter.getType();
                if (nonRpcMethods.contains(getSimpleName(jMethod))) {
                    generateSchemaForType(sequence, null, getSimpleName(jMethod));
                    break;
                } else {
                    generateSchemaForType(sequence, paraType, parameterName);
                }
            }
            // for its return type
            JClass returnType = jMethod.getReturnType();

            if (!returnType.isVoidType()) {
                String partQname = methodName + RESPONSE;
                methodSchemaType =
                        createSchemaTypeForMethodPart(partQname);
                sequence = new XmlSchemaSequence();
                methodSchemaType.setParticle(sequence);
                JAnnotation returnAnnon =
                        jMethod.getAnnotation(AnnotationConstants.WEB_RESULT);
                String returnName = "return";
                if (returnAnnon != null) {
                    returnName = returnAnnon.getValue(AnnotationConstants.NAME).asString();
                    if (returnName != null && !"".equals(returnName)) {
                        returnName = "return";
                    }
                }
                if (nonRpcMethods.contains(getSimpleName(jMethod))) {
                    generateSchemaForType(sequence, null, returnName);
                } else {
                    generateSchemaForType(sequence, returnType, returnName);
                }
                AxisMessage outMessage = axisOperation.getMessage(
                        WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                outMessage.setElementQName(typeTable.getQNamefortheType(partQname));
                outMessage.setName(partQname);
                service.addMessageElementQNameToOperationMapping(methodSchemaType.getQName(),
                        axisOperation);
            }
            if (addToService) {
                service.addOperation(axisOperation);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.