简体   繁体   English

我在wso2集成工作室的rest api项目中遇到问题

[英]I got a problem in rest api project in wso2 integration studio

I Have this xml:我有这个 xml:

<?xml version="1.0" encoding="UTF-8"?>
<api context="/testapi" name="testapi" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" url-mapping="/testapi">
        <inSequence>
            <property expression="get-property('query.param.qp')" name="qp1" scope="default" type="STRING"/>
            <property expression="$ctx:query.param.qp" name="qp2" scope="default" type="STRING"/>
            <property expression="$url:qp" name="qp3" scope="default" type="STRING"/>
            <payloadFactory media-type="json">
                <format> {"Method1":"$1",&#xd;
"Method2":"$2",&#xd;
"Method3":"$3"}</format>
                <args>
                    <arg evaluator="xml" expression="get-property('qp1')"/>
                    <arg evaluator="xml" expression="get-property('qp2')"/>
                    <arg evaluator="xml" expression="get-property('qp3')"/>
                </args>
            </payloadFactory>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>
</api>

when validating the code in the integration studio these problems appears:在集成工作室中验证代码时,会出现以下问题:

Element 'format' cannot have character [children], because the type's content type is element-only. testapi.xml /test1/test1Configs/src/main/synapse-config/api line 9  XML Problem

The content of element 'faultSequence' is not complete. One of '{"http://ws.apache.org/ns/synapse":call, "http://ws.apache.org/ns/synapse":call-template, "http://ws.apache.org/ns/synapse":drop, "http://ws.apache.org/ns/synapse":log, "http://ws.apache.org/ns/synapse":loopback, "http://ws.apache.org/ns/synapse":property, "http://ws.apache.org/ns/synapse":propertyGroup, "http://ws.apache.org/ns/synapse":respond, "http://ws.apache.org/ns/synapse":send, "http://ws.apache.org/ns/synapse":sequence, "http://ws.apache.org/ns/synapse":store, "http://ws.apache.org/ns/synapse":conditionalRouter, "http://ws.apache.org/ns/synapse":filter, "http://ws.apache.org/ns/synapse":switch, "http://ws.apache.org/ns/synapse":validate, "http://ws.apache.org/ns/synapse":bean, "http://ws.apache.org/ns/synapse":class, "http://ws.apache.org/ns/synapse":pojoCommand, "http://ws.apache.org/ns/synapse":ejb, "http://ws.apache.org/ns/synapse":script, "http://ws.apache.org/ns/synapse":spring, "http://ws.apache.org/ns/synapse":enrich, "http://ws.apache.org/ns/synapse":makefault, "http://ws.apache.org/ns/synapse":header, "http://ws.apache.org/ns/synapse":payloadFactory, "http://ws.apache.org/ns/synapse":jsontransform, "http://ws.apache.org/ns/synapse":smooks, "http://ws.apache.org/ns/synapse":rewrite, "http://ws.apache.org/ns/synapse":xquery, "http://ws.apache.org/ns/synapse":xslt, "http://ws.apache.org/ns/synapse":datamapper, "http://ws.apache.org/ns/synapse":fastXSLT, "http://ws.apache.org/ns/synapse":cache, "http://ws.apache.org/ns/synapse":dblookup, "http://ws.apache.org/ns/synapse":dbreport, "http://ws.apache.org/ns/synapse":enqueue, "http://ws.apache.org/ns/synapse":event, "http://ws.apache.org/ns/synapse":throttle, "http://ws.apache.org/ns/synapse":transaction, "http://ws.apache.org/ns/synapse":aggregate, "http://ws.apache.org/ns/synapse":callout, "http://ws.apache.org/ns/synapse":clone, "http://ws.apache.org/ns/synapse":iterate, "http://ws.apache.org/ns/synapse":foreach, "http://ws.apache.org/ns/synapse":entitlementService, "http://ws.apache.org/ns/synapse":oauthService, "http://ws.apache.org/ns/synapse":builder, "http://ws.apache.org/ns/synapse":rule, "http://ws.apache.org/ns/synapse":bam, "http://ws.apache.org/ns/synapse":publishEvent, "http://ws.apache.org/ns/synapse":NTLM}' is expected. testapi.xml /test1/test1Configs/src/main/synapse-config/api line 3  XML Problem


The content of element 'outSequence' is not complete. One of '{"http://ws.apache.org/ns/synapse":call, "http://ws.apache.org/ns/synapse":call-template, "http://ws.apache.org/ns/synapse":drop, "http://ws.apache.org/ns/synapse":log, "http://ws.apache.org/ns/synapse":loopback, "http://ws.apache.org/ns/synapse":property, "http://ws.apache.org/ns/synapse":propertyGroup, "http://ws.apache.org/ns/synapse":respond, "http://ws.apache.org/ns/synapse":send, "http://ws.apache.org/ns/synapse":sequence, "http://ws.apache.org/ns/synapse":store, "http://ws.apache.org/ns/synapse":conditionalRouter, "http://ws.apache.org/ns/synapse":filter, "http://ws.apache.org/ns/synapse":switch, "http://ws.apache.org/ns/synapse":validate, "http://ws.apache.org/ns/synapse":bean, "http://ws.apache.org/ns/synapse":class, "http://ws.apache.org/ns/synapse":pojoCommand, "http://ws.apache.org/ns/synapse":ejb, "http://ws.apache.org/ns/synapse":script, "http://ws.apache.org/ns/synapse":spring, "http://ws.apache.org/ns/synapse":enrich, "http://ws.apache.org/ns/synapse":makefault, "http://ws.apache.org/ns/synapse":header, "http://ws.apache.org/ns/synapse":payloadFactory, "http://ws.apache.org/ns/synapse":jsontransform, "http://ws.apache.org/ns/synapse":smooks, "http://ws.apache.org/ns/synapse":rewrite, "http://ws.apache.org/ns/synapse":xquery, "http://ws.apache.org/ns/synapse":xslt, "http://ws.apache.org/ns/synapse":datamapper, "http://ws.apache.org/ns/synapse":fastXSLT, "http://ws.apache.org/ns/synapse":cache, "http://ws.apache.org/ns/synapse":dblookup, "http://ws.apache.org/ns/synapse":dbreport, "http://ws.apache.org/ns/synapse":enqueue, "http://ws.apache.org/ns/synapse":event, "http://ws.apache.org/ns/synapse":throttle, "http://ws.apache.org/ns/synapse":transaction, "http://ws.apache.org/ns/synapse":aggregate, "http://ws.apache.org/ns/synapse":callout, "http://ws.apache.org/ns/synapse":clone, "http://ws.apache.org/ns/synapse":iterate, "http://ws.apache.org/ns/synapse":foreach, "http://ws.apache.org/ns/synapse":entitlementService, "http://ws.apache.org/ns/synapse":oauthService, "http://ws.apache.org/ns/synapse":builder, "http://ws.apache.org/ns/synapse":rule, "http://ws.apache.org/ns/synapse":bam, "http://ws.apache.org/ns/synapse":publishEvent, "http://ws.apache.org/ns/synapse":NTLM}' is expected.   testapi.xml /test1/test1Configs/src/main/synapse-config/api line 3  XML Problem


Cannot find the declaration of element 'project'.   pom.xml /test1/test1CompositeExporter   line 3  XML Problem


Referenced file contains errors (jar:file:/D:/WSO2-Integration-Studio-8.1.0-win32-x86_64/IntegrationStudio/plugins/org.wso2.integrationstudio.gmf.esb.diagram_8.1.0.202211111317.jar!/resources/schema/endpoint.xsd).  For more information, right click on the message in the Problems View and select "Show Details..."   testapi.xml /test1/test1Configs/src/main/synapse-config/api line 1  XML Problem

I try to build rest api with wso2 integration studio我尝试用 wso2 集成工作室构建 rest api

You have to delete those Caracters "&#xd" from your JSON Payload as below:您必须从您的 JSON 有效负载中删除这些字符“&#xd”,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<api context="/testapi" name="testapi" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" url-mapping="/testapi">
        <inSequence>
            <property expression="get-property('query.param.qp')" name="qp1" scope="default" type="STRING"/>
            <property expression="$ctx:query.param.qp" name="qp2" scope="default" type="STRING"/>
            <property expression="$url:qp" name="qp3" scope="default" type="STRING"/>
            <payloadFactory media-type="json">
                <format> {"Method1":"$1",
"Method2":"$2",
"Method3":"$3"}</format>
                <args>
                    <arg evaluator="xml" expression="get-property('qp1')"/>
                    <arg evaluator="xml" expression="get-property('qp2')"/>
                    <arg evaluator="xml" expression="get-property('qp3')"/>
                </args>
            </payloadFactory>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </resource>
</api>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何增加 WSO2 Integration Studio 的超时时间? - How to increase the timeout at WSO2 Integration Studio? 在 wso2 Integration Studio 中安排任务 - Scheduling tasks in wso2 Integration Studio wso2 Integration Studio中动态变量的全球化 - Globalization of dynamic variables in wso2 Integration Studio 在 WSO2 Integration Studio 中读取 a.txt 文件 - Reading a .txt file in WSO2 Integration Studio 如何从WSo2 Integration Studio数据服务项目中读取mongo查询结果为Json格式的数据? - How to read data from mongo query result as Json Format in WSo2 Integration Studio Data Service Project? 如何在创建 API 时发送查询参数,该 API 使用 WSO2 Integration Studio 中的查询参数? - How to send a query parameter when creating an API that consumes an API that takes a query parameter in WSO2 Integration Studio? 如何在 wso2 Integration Studio 中跳过 CSV 文件中的标题? - How do I skip headers in CSV file in wso2 Integration Studio? 如何在 WSO2 Integration Studio 中将属性注入端点 url 调用? - How to inject a property into endpoint url call in WSO2 Integration Studio? WSO2 Integration Studio 不工作 MacOS Ventura 13 - WSO2 Integration Studio Not Work MacOS Ventura 13 WSO2:RabbitMQ 使用 Integration Studio 的 AMQP 传输消费者代理 - WSO2: RabbitMQ AMQP Transport consumer proxy using Integration Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM