Mule-Track订单(Tshirt服务)返回格式错误的JSON?

Mule-Track订单(Tshirt服务)返回格式错误的JSON?,json,mule,mule-studio,Json,Mule,Mule Studio,我正在向Mulesoft T恤服务发送一个跟踪订单的请求。 我通过邮递员(Chrome)发送了一个JSON请求,邮递员返回了一个错误:格式错误的JSON 但是Mulesoft Studio控制台中没有任何内容 多叶流 <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" version="EE-3.5.0" xmlns="h

我正在向Mulesoft T恤服务发送一个跟踪订单的请求。 我通过邮递员(Chrome)发送了一个JSON请求,邮递员返回了一个错误:格式错误的JSON

但是Mulesoft Studio控制台中没有任何内容

多叶流

    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" version="EE-3.5.0" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
    http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
    http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
    http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
    http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
    http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">
    <ws:consumer-config doc:name="Web Service Consumer" name="Web_Service_Consumer" port="TshirtServicePort" service="TshirtService" serviceAddress="http://tshirt-service.cloudhub.io" wsdlLocation="tshirt.wsdl"/>
    <data-mapper:config doc:name="xml_listinventoryresponse__to_json" name="xml_listinventoryresponse__to_json" transformationGraphPath="xml_listinventoryresponse__to_json.grf"/>
    <data-mapper:config doc:name="xml_ordertshirtresponse__to_json" name="xml_ordertshirtresponse__to_json" transformationGraphPath="xml_ordertshirtresponse__to_json.grf"/>
    <data-mapper:config doc:name="string_to_xml_authenticationheader_" name="string_to_xml_authenticationheader_" transformationGraphPath="string_to_xml_authenticationheader_.grf"/>
    <data-mapper:config name="JSON_To_Xml_OrderTshirt_" transformationGraphPath="json_to_xml_ordertshirt_.grf" doc:name="JSON_To_Xml_OrderTshirt_"/>
    <data-mapper:config name="JSON_To_Xml_TrackOrder_" transformationGraphPath="json_to_xml_trackorder_.grf" doc:name="JSON_To_Xml_TrackOrder_"/>
    <data-mapper:config name="XML_To_JSON" transformationGraphPath="xml_to_json.grf" doc:name="XML_To_JSON"/>



<flow name="OrderTracking" doc:name="OrderTracking">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8001" path="orderTracking" doc:name="HTTP"/>
<data-mapper:transform config-ref="JSON_To_Xml_TrackOrder_" doc:name="JSON To Xml<TrackOrder>"/>
<ws:consumer config-ref="Web_Service_Consumer" operation="TrackOrder" doc:name="TrackOrder"/>
<data-mapper:transform config-ref="XML_To_JSON" doc:name="XML To JSON"/>
<http:response-builder status="200" contentType="application/json" doc:name="HTTP Response Builder"/>
</flow>

</mule>

您的JSON请求似乎不正确。 转换为XML时提供的JSON如下所示

<?xml version="1.0" encoding="UTF-8" ?>
<email>info8001@mulesoft.com</email>
<orderId>264</orderId>

info8001@mulesoft.com
264
这是不完整的,因为没有根元素将数据包含在XML中


尝试修改JSON,看看它是否有效。

Mule xml编写时没有最后的xml,如果我添加了结束xml标记,它会给出错误。
<?xml version="1.0" encoding="UTF-8" ?>
<email>info8001@mulesoft.com</email>
<orderId>264</orderId>