当前位置: 首页>>代码示例>>Java>>正文


Java AxisOperation.getMessage方法代码示例

本文整理汇总了Java中org.apache.axis2.description.AxisOperation.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java AxisOperation.getMessage方法的具体用法?Java AxisOperation.getMessage怎么用?Java AxisOperation.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.description.AxisOperation的用法示例。


在下文中一共展示了AxisOperation.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addCSpecifcAttributes

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * @param doc
 * @param operation
 * @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);
    }

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

    String type = this.mapper.getTypeMappingName(message.getElementQName());
    typeMappingStr = (type == null) ? "" : type;
    addAttribute(doc, "caps-type", paramType.toUpperCase(), param);

    if (!paramType.equals("") && !paramType.equals("void") &&
            !typeMappingStr.equals(C_DEFAULT_TYPE) && typeMappingStr.contains("adb_")) {
        addAttribute(doc, "ours", "yes", param);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:31,代码来源:CEmitter.java

示例2: getAbstractResponseMessageContext

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public MessageContext getAbstractResponseMessageContext(MessageContext requestMessageContext) throws AxisFault {
    MessageContext outMessageCtx = MessageContextBuilder.createOutMessageContext(requestMessageContext);

    SOAPFactory factory = getSOAPFactory(requestMessageContext);
    AxisOperation operation = requestMessageContext.getOperationContext().getAxisOperation();
    AxisService service = requestMessageContext.getAxisService();

    OMElement bodyContent;
    AxisMessage outMessage = operation.getMessage(OperationsConstants.OUT);

    bodyContent = factory.createOMElement(outMessage.getName(),
            factory.createOMNamespace(namespace,
                    service.getSchemaTargetNamespacePrefix()));
    try {
        setPayload(bodyContent);
    } catch (XMLStreamException e) {
        String msg = "Error in adding the payload to the response message";
        log.error(msg);
        throw new AxisFault(msg, e);
    }

    SOAPEnvelope soapEnvelope = factory.getDefaultEnvelope();
    soapEnvelope.getBody().addChild(bodyContent);
    outMessageCtx.setEnvelope(soapEnvelope);
    return outMessageCtx;
}
 
开发者ID:wso2,项目名称:carbon-governance,代码行数:27,代码来源:AbstractOperation.java

示例3: getParameterListForOperation

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Retrieves list of parameter names & their type for a given operation
 * @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();
	        if (particle instanceof XmlSchemaSequence || particle instanceof XmlSchemaAll) {
	            XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase)particle;
	            Iterator iterator = xmlSchemaGroupBase.getItems().getIterator();

	            while (iterator.hasNext()) {
	                XmlSchemaElement innerElement = (XmlSchemaElement)iterator.next();
	                QName qName = innerElement.getQName();
	                if (qName == null && innerElement.getSchemaTypeName()
	                        .equals(org.apache.ws.commons.schema.constants.Constants.XSD_ANYTYPE)) {
	                    break;
	                }
	                long minOccurs = innerElement.getMinOccurs();
	                boolean nillable = innerElement.isNillable();
	                String name =
	                        qName != null ? qName.getLocalPart() : innerElement.getName();
	                String type = innerElement.getSchemaTypeName().toString();
	                paramList.append(","+type +" " +name);
	            }
	        }
	   }	            	
	}
	//remove first ","
	String list = paramList.toString();		
	return list.replaceFirst(",", "");
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:41,代码来源:XMPPSender.java

示例4: testServiceCreate

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void testServiceCreate() throws AxisFault {
    AxisConfiguration axisConfig = configContext.getAxisConfiguration();
    AxisService service =
            AxisService.createService("org.apache.axis2.engine.MyService", axisConfig);
    assertNotNull(service);
    axisConfig.addService(service);
    assertEquals("MyService", service.getName());
    AxisOperation axisOperation = service.getOperation(new QName("add"));
    assertNotNull(axisOperation);
    AxisMessage messge = axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    // messge.getSchemaElement().toString()
    assertNotNull(messge);
    assertNotNull(messge.getSchemaElement());
    assertNotNull(service.getOperation(new QName("putValue")));
    assertNotNull(axisConfig.getService("MyService"));

    RPCServiceClient client = new RPCServiceClient(clinetConfigurationctx, null);

    EndpointReference targetEPR = new EndpointReference(
            "http://127.0.0.1:" + (UtilServer.TESTING_PORT)
                    + "/axis2/services/MyService/add");
    Options options = new Options();

    options.setTo(targetEPR);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    client.setOptions(options);
    ArrayList args = new ArrayList();
    args.add("100");
    args.add("200");

    OMElement response = client.invokeBlocking(
            new QName("http://engine.axis2.apache.org", "add", "ns1"), args.toArray());
    assertEquals(Integer.parseInt(response.getFirstElement().getText()), 300);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:35,代码来源:ServiceCreateTest.java

示例5: createMessageContext

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
private MessageContext createMessageContext(OperationContext oc, ConfigurationContext cc,
                                                int flowType) throws Exception {
        MessageContext mc = cc.createMessageContext();

        mc.setFLOW(flowType);
        mc.setTransportIn(transportIn);
        mc.setTransportOut(transportOut);

        mc.setServerSide(true);
//        mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);

        SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
        mc.setEnvelope(omFac.getDefaultEnvelope());

        AxisOperation axisOperation = oc.getAxisOperation();
        String action = axisOperation.getName().getLocalPart();
        mc.setSoapAction(action);
//        System.out.flush();

        mc.setMessageID(UUIDGenerator.getUUID());

        axisOperation.registerOperationContext(mc, oc);
        mc.setOperationContext(oc);

        ServiceContext sc = oc.getServiceContext();
        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;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:MessageContextSaveCTest.java

示例6: testModuleEngageForAxisService

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void testModuleEngageForAxisService() throws AxisFault {
    AxisService service = AxisService.createService(TestService.class.getName(), axisConfig);
    axisConfig.addService(service);
    AxisModule module = axisConfig.getModule("TestModule");
    assertNotNull(module);
    service.engageModule(module);
    AxisOperation axisOperation = service.getOperation(new QName("testVoid"));
    assertNotNull(axisOperation);
    AxisMessage message = axisOperation.getMessage("In");
    assertNotNull(message);
    List list = message.getMessageFlow();
    boolean found = false;
    for (int i = 0; i < list.size(); i++) {
        Phase phase = (Phase) list.get(i);
        if (phase != null && phase.getName().equals("OperationInPhase")) {
            List handler = phase.getHandlers();
            for (int j = 0; j < handler.size(); j++) {
                Handler handler1 = (Handler) handler.get(j);
                if (handler1.getName().equals("H1")) {
                    found = true;
                }

            }
        }
    }
    assertTrue(found);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:ModuleEnagementTest.java

示例7: engageModuleToAxisMessage1

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void engageModuleToAxisMessage1() throws Exception{
    AxisService service = AxisService.createService(TestService.class.getName(), axisConfig);
    axisConfig.addService(service);
    AxisModule module = axisConfig.getModule("TestModule");
    assertNotNull(module);
    AxisOperation axisOperation = service.getOperation(new QName("testVoid"));
    assertNotNull(axisOperation);
    AxisMessage message = axisOperation.getMessage("In");
    message.engageModule(module);
    assertNotNull(message);
    List list = message.getMessageFlow();
    boolean found = false;
    for (int i = 0; i < list.size(); i++) {
        Phase phase = (Phase) list.get(i);
        if (phase != null && phase.getName().equals("OperationInPhase")) {
            List handler = phase.getHandlers();
            for (int j = 0; j < handler.size(); j++) {
                Handler handler1 = (Handler) handler.get(j);
                if (handler1.getName().equals("H1")) {
                    found = true;
                }

            }
        }
    }
    assertTrue(found);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:28,代码来源:ModuleEnagementTest.java

示例8: engageModuleToAxisMessage2

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void engageModuleToAxisMessage2() throws Exception{
     AxisService service = AxisService.createService(TestService.class.getName(), axisConfig);
     axisConfig.addService(service);
     AxisModule module = axisConfig.getModule("TestModule");
     assertNotNull(module);
     AxisOperation axisOperation = service.getOperation(new QName("testString"));
     assertNotNull(axisOperation);
     AxisMessage message = axisOperation.getMessage("In");
     message.engageModule(module);
     assertNotNull(message);
     message = axisOperation.getMessage("Out");
     List list = message.getMessageFlow();
     boolean found = false;
     for (int i = 0; i < list.size(); i++) {
         Phase phase = (Phase) list.get(i);
         if (phase != null && phase.getName().equals("OperationOutPhase")) {
             List handler = phase.getHandlers();
             for (int j = 0; j < handler.size(); j++) {
                 Handler handler1 = (Handler) handler.get(j);
                 if (handler1.getName().equals("H2")) {
                     found = true;
                 }

             }
         }
     }
     assertFalse(found);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:29,代码来源:ModuleEnagementTest.java

示例9: createMessageContext

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
private MessageContext createMessageContext(OperationContext oc) throws Exception {
        MessageContext mc = configurationContext.createMessageContext();
        mc.setTransportIn(transportIn);
        mc.setTransportOut(transportOut);

        mc.setServerSide(true);
//        mc.setProperty(MessageContext.TRANSPORT_OUT, System.out);

        SOAPFactory omFac = OMAbstractFactory.getSOAP11Factory();
        mc.setEnvelope(omFac.getDefaultEnvelope());

        AxisOperation axisOperation = oc.getAxisOperation();
        String action = axisOperation.getName().getLocalPart();
        mc.setSoapAction(action);
//        System.out.flush();

        mc.setMessageID(UUIDGenerator.getUUID());

        axisOperation.registerOperationContext(mc, oc);
        mc.setOperationContext(oc);

        ServiceContext sc = oc.getServiceContext();
        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;
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:33,代码来源:MessageContextSaveBTest.java

示例10: testAxisMessage

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
public void testAxisMessage() throws Exception {
    String filename =
            AbstractTestCase.basedir + "/test-resources/deployment/AxisMessageTestRepo";
    AxisConfiguration er = ConfigurationContextFactory
            .createConfigurationContextFromFileSystem(filename, filename + "/axis2.xml")
            .getAxisConfiguration();

    assertNotNull(er);
    AxisService service = er.getService("MessagetestService");
    assertNotNull(service);
    AxisOperation op = service.getOperation(new QName("echoString"));
    assertNotNull(op);
    AxisMessage message = op.getMessage("In");
    assertNotNull(message);
    Parameter para = message.getParameter("messageIN");
    assertNotNull(para);
    assertEquals(para.getValue(), "messageIN");


    op = service.getOperation(new QName("echoStringArray"));
    assertNotNull(op);
    message = op.getMessage("In");
    assertNotNull(message);
    para = message.getParameter("messageIN");
    assertNotNull(para);
    assertEquals(para.getValue(), "messageIN");

    message = op.getMessage("Out");
    assertNotNull(message);
    para = message.getParameter("messageOut");
    assertNotNull(para);
    assertEquals(para.getValue(), "messageOut");

}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:35,代码来源:AxisMessageTest.java

示例11: addToAxisService

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Adds the AxisOperation corresponding to this OperationDescription to the AxisService if it
 * isn't already there. It also addes the AxisOperation to any other routing mechanisms for
 * that AxisService: - For Doc/Lit/Bare operations it is added to the
 * MessageElementQNameToOperationMapping
 *
 * @param axisService
 */
void addToAxisService(AxisService axisService) {
    AxisOperation newAxisOperation = getAxisOperation();
    QName axisOpQName = newAxisOperation.getName();
    // See if this operation is already added to the AxisService.  Note that we need to check the 
    // children of the service rather than using the getOperation(axisOpQName) method.  The reason is 
    // that method checks the alias table in addition to the children, and it is possible at this point
    // for an operation to have just been added to the alias table but not yet as a child.  It is this method
    // that will add that newly-created operation to the service.
    AxisOperation existingAxisOperation = (AxisOperation) axisService.getChild(axisOpQName);

    if (existingAxisOperation == null) {
        axisService.addOperation(newAxisOperation);
        // For a Doc/Lit/Bare operation, we also need to add the element mapping
    }
    if (getSoapBindingStyle() == javax.jws.soap.SOAPBinding.Style.DOCUMENT
            && getSoapBindingUse() == javax.jws.soap.SOAPBinding.Use.LITERAL
            && getSoapBindingParameterStyle() == javax.jws.soap.SOAPBinding.ParameterStyle
            .BARE) {
        AxisMessage axisMessage =
                null;
        if (existingAxisOperation!=null) {
            axisMessage = existingAxisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        } else {
            axisMessage = newAxisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        }
        if (axisMessage != null) {
            QName elementQName = axisMessage.getElementQName();
            if (!DescriptionUtils.isEmpty(elementQName) && 
                axisService.getOperationByMessageElementQName(elementQName) == null) {
                axisService.addMessageElementQNameToOperationMapping(elementQName,
                        newAxisOperation);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:44,代码来源:OperationDescriptionImpl.java

示例12: processRequestOutput

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Process the given request's output types.
 * @param cparams The common parameters used in the schema generator
 * @param request The request used to process the output
 */
private static void processRequestOutput(CommonParams cparams, CallableRequest request)
		throws DataServiceFault {
	CallQuery callQuery = request.getCallQuery();
	if (!(callQuery.getQuery().hasResult() || request.isReturnRequestStatus())) {
		return;
	}
	
	AxisOperation axisOp = cparams.getAxisService().getOperation(
			new QName(request.getRequestName()));
	AxisMessage outMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
	outMessage.setName(request.getRequestName() + Java2WSDLConstants.RESPONSE);
	
	if (request.isReturnRequestStatus() && !callQuery.getQuery().hasResult()) {
		outMessage.setElementQName(new QName(DBConstants.WSO2_DS_NAMESPACE,
				DBConstants.REQUEST_STATUS_WRAPPER_ELEMENT));
		return;
	}
	
	Result result = callQuery.getQuery().getResult();
	if (result.isXsAny() || result.getResultType() == ResultTypes.RDF) {
		outMessage.setElementQName(new QName(DBConstants.WSO2_DS_NAMESPACE,
				DBConstants.DATA_SERVICE_RESPONSE_WRAPPER_ELEMENT));
		return;
	}
	
	/* create dummy element to contain the result element */
	XmlSchemaElement dummyParentElement = new XmlSchemaElement();
	dummyParentElement.setQName(new QName(result.getNamespace(), DUMMY_NAME));
	XmlSchema dummySchema = retrieveSchema(cparams, result.getNamespace());
	XmlSchemaComplexType dummyType = new XmlSchemaComplexType(dummySchema);
	dummyType.setName(DUMMY_NAME);
	dummyParentElement.setType(dummyType);
	/* lets do it */
	processCallQuery(cparams, dummyParentElement, callQuery);
	/* extract the element and set it to the message */
	XmlSchemaElement resultEl = (XmlSchemaElement) ((XmlSchemaSequence) dummyType.getParticle())
			.getItems().getItem(0);
	outMessage.setElementQName(resultEl.getRefName());
}
 
开发者ID:wso2,项目名称:carbon-data,代码行数:45,代码来源:DataServiceDocLitWrappedSchemaGenerator.java

示例13: invoke

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
private void invoke(MessageContext inMessage) throws AxisFault {
    String methodName = null;
    try {
        AxisOperation op = inMessage.getOperationContext().getAxisOperation();
        AxisService service = inMessage.getAxisService();
        OMElement methodElement = inMessage.getEnvelope().getBody().getFirstElement();

        AxisMessage inAxisMessage = op.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        String messageNameSpace;
        QName elementQName;
        methodName = op.getName().getLocalPart();

        Invoker invoker = (Invoker) invokerCache.get(methodName);
        if (invoker==null) {
            if (orb==null) {
                Parameter orbParam = service.getParameter(ORB_LITERAL);
                orb = orbParam != null ? (ORB) orbParam.getValue() : CorbaUtil.getORB(service);
            }
            org.omg.CORBA.Object obj = CorbaUtil.resolveObject(service, orb);
            Parameter idlParameter = service.getParameter(IDL_LITERAL);
            if (idlParameter==null)
                throw new CorbaInvocationException("No IDL found");
            IDL idl = (IDL) idlParameter.getValue();
            invoker = CorbaUtil.getInvoker(service, obj, idl, methodName);
            invokerCache.put(methodName, invoker);
        }

        if (inAxisMessage != null) {
            if (inAxisMessage.getElementQName()!=null) {
                elementQName = inAxisMessage.getElementQName();
                messageNameSpace = elementQName.getNamespaceURI();
                OMNamespace namespace = methodElement.getNamespace();
                if (messageNameSpace != null) {
                    if (namespace == null ||
                            !messageNameSpace.equals(namespace.getNamespaceURI())) {
                        throw new AxisFault("namespace mismatch require " +
                                messageNameSpace +
                                " found " +
                                methodElement.getNamespace().getNamespaceURI());
                    }
                } else if (namespace != null) {
                    throw new AxisFault("namespace mismatch. Axis Oepration expects non-namespace " +
                            "qualified element. But received a namespace qualified element");
                }

                Object[] objectArray = CorbaUtil.extractParameters(methodElement, invoker.getParameterMembers());
                invoker.setParameters(objectArray);
            }
            invoker.invoke();
        }
    } catch (CorbaInvocationException e) {
        String msg;
        Throwable cause = e.getCause();
        if (cause != null) {
            msg = cause.getMessage();
            if (msg == null) {
                msg = "Exception occurred while trying to invoke service method " + methodName;
            }
            //log.error(msg, e);
            if (cause instanceof AxisFault) {
                throw (AxisFault) cause;
            }
        } else {
            msg = e.getMessage();
        }
        throw new AxisFault(msg);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:69,代码来源:CorbaInOnlyMessageReceiver.java

示例14: processRequestBoxInput

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
     * Process the given request's input parameters. //todo complete
     * @param cparams The common parameters used in the schema generator
     * @param request The request used to process the input
     */
    private static void processRequestBoxInput(CommonParams cparams, CallableRequest request, List<List<CallableRequest>> allOps)
            throws DataServiceFault {
        String requestName = request.getRequestName();
        AxisOperation axisOp = cparams.getAxisService().getOperation(new QName(requestName));
        CallQuery callQuery = request.getCallQuery();
        Query query = callQuery.getQuery();
        AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
        if (inMessage != null) {
            inMessage.setName(requestName + Java2WSDLConstants.MESSAGE_SUFFIX);
                /* create input message element */
            XmlSchemaElement inputElement = createElement(cparams, query.getInputNamespace(),
                                                          requestName, true);
                /* complex type for input message element */
            XmlSchemaComplexType inputComplexType = createComplexType(cparams,
                                                                      query.getInputNamespace(), requestName, false);
                /* set element type */
            inputElement.setType(inputComplexType);
                /* batch requests */
            for (List<CallableRequest> callableRequests : allOps) {
                for (CallableRequest callableRequest : callableRequests) {
                    XmlSchemaElement nestedEl = new XmlSchemaElement();
                    if (callableRequest != null) {
                        if (!isBoxcarringOp(callableRequest.getRequestName())) {
                            nestedEl.setRefName(cparams.getRequestInputElementMap().get(
                                    callableRequest.getRequestName()));
//                            nestedEl.setMaxOccurs(Long.MAX_VALUE);
                            addElementToComplexTypeAll(cparams, inputComplexType,
                                                       query.getInputNamespace(),
                                                       nestedEl, false, false, true);
                        }
                    } else {
                        throw new DataServiceFault("No parent operation for batch request: "
                                                   + request.getRequestName());
                    }
                }
            }
                /* set the input element qname in message */
            inMessage.setElementQName(inputElement.getQName());
                /* store request name and element qname mapping */
            cparams.getRequestInputElementMap().put(request.getRequestName(),
                                                    inMessage.getElementQName());

        }
    }
 
开发者ID:wso2,项目名称:carbon-data,代码行数:50,代码来源:DataServiceDocLitWrappedSchemaGenerator.java

示例15: processRequestInput

import org.apache.axis2.description.AxisOperation; //导入方法依赖的package包/类
/**
 * Process the given request's input parameters.
 * @param cparams The common parameters used in the schema generator
 * @param request The request used to process the input
 */
private static void processRequestInput(CommonParams cparams, CallableRequest request)
		throws DataServiceFault {
	String requestName = request.getRequestName(); 
	AxisOperation axisOp = cparams.getAxisService().getOperation(new QName(requestName));
	CallQuery callQuery = request.getCallQuery();
	Query query = callQuery.getQuery();
	AxisMessage inMessage = axisOp.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
	if (inMessage != null) {
               inMessage.setName(requestName + Java2WSDLConstants.MESSAGE_SUFFIX);
               /* create input message element */
               XmlSchemaElement inputElement = createElement(cparams, query.getInputNamespace(),
                       requestName, true);
               /* complex type for input message element */
               XmlSchemaComplexType inputComplexType = createComplexType(cparams,
                       query.getInputNamespace(), requestName, false);
               /* set element type */
               inputElement.setType(inputComplexType);
               /* batch requests */
               if (request.isBatchRequest()) {
                   XmlSchemaElement nestedEl = new XmlSchemaElement();
                   CallableRequest parentReq = request.getParentRequest();
                   if (parentReq != null) {
                       nestedEl.setRefName(cparams.getRequestInputElementMap().get(
                               parentReq.getRequestName()));
                       nestedEl.setMaxOccurs(Long.MAX_VALUE);
                       addElementToComplexTypeSequence(cparams, inputComplexType,
                               query.getInputNamespace(),
                               nestedEl, false, false, false);
                   } else {
                       throw new DataServiceFault("No parent operation for batch request: "
                               + request.getRequestName());
                   }
               } else {
                   /* normal requests */
                   XmlSchemaElement tmpEl;
                   Map<String, WithParam> withParams = callQuery.getWithParams();
                   WithParam tmpWithParam;
                   /* create elements for individual parameters */
                   if (callQuery.getWithParams().size() > 0) {
                       for (QueryParam queryParam : query.getQueryParams()) {
                           if (DBConstants.QueryTypes.IN.equals(queryParam.getType())
                                   || DBConstants.QueryTypes.INOUT.equals(queryParam.getType())) {
                               tmpWithParam = withParams.get(queryParam.getName());
                               if (tmpWithParam == null) {
                                   /* this query param's value must be coming from an export, not
                                    * from the operation's parameter */
                                   continue;
                               }
                               tmpEl = createInputEntryElement(cparams, query, queryParam,
                                       tmpWithParam);
                               /* add to input element complex type */
                               addElementToComplexTypeSequence(cparams, inputComplexType,
                                       query.getInputNamespace(), tmpEl, false, false, false);
                           }
                       }
                   } else {
                       /* Adds the operation name to the SOAP body when used with OUT_ONLY requests
                        * and further creates a complex type corresponds to the IN-MESSAGE with
                        * an empty sequence */
                       XmlSchemaSequence emptySeq = new XmlSchemaSequence();
                       inputComplexType.setParticle(emptySeq);
                   }
               }
               /* set the input element qname in message */
               inMessage.setElementQName(inputElement.getQName());
               /* store request name and element qname mapping */
               cparams.getRequestInputElementMap().put(request.getRequestName(),
                       inMessage.getElementQName());

           }
}
 
开发者ID:wso2,项目名称:carbon-data,代码行数:77,代码来源:DataServiceDocLitWrappedSchemaGenerator.java


注:本文中的org.apache.axis2.description.AxisOperation.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。