我是Mulesoft的新手,正在創建一個流程,我正在使用一個將XML作爲輸出的Web服務,並且需要將XML轉換爲Mule中的JSON。Mulesoft Web服務XML輸出到JSON
下面是我的騾子流,
下面是郵差漂亮值,
<?xml version="1.0" encoding="UTF-8"?>
<GetProjectResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="namespaceName">
<GetProjectResult><root>
<header>
<status>
<message>Success</message>
</status>
</header>
<data>
<Project>
<ProjectId>12345</ProjectId>
<ProjectShortName>ABCDEF</ProjectShortName>
<BusinessGroupName>ABCDEF GROUP</BusinessGroupName>
<InstitutionShortName>Country</InstitutionShortName>
<CountryName>Sample</CountryName>
<Code>Sample</Code>
</Project>
</data>
</root></GetProjectResult>
</GetProjectResponse>
但我的JSON看起來像這樣,
{
"GetProjectResponse": {
"@xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"@xmlns:xmlns": "namespaceName",
"GetProjectResult": "<root>\n <header>\n <status>\n <message>Success</message>\n </status>\n </header>\n <data>\n <Project>\n <ProjectId>12345</ProjectId>\n <ProjectShortName>ABCDEF</ProjectShortName>\n <BusinessGroupName>ABCDEF GROUP</BusinessGroupName>\n <InstitutionShortName>Country</InstitutionShortName>\n <CountryName>Sample</CountryName>\n <Code>Sample</Code>\n </Project>\n </data>\n</root>"
}
}
我實際的XML是「GetProjectResult」節點內的值,有人能告訴我如何我會做到這一點。
它的工作。非常感謝 – user2665819
明星,你能檢查一下你是否能夠檢查我的另一個問題http://stackoverflow.com/q/37801082/2665819 – user2665819