我想將SOAP服務作爲REST(json)API發佈。該服務操作我要揭露有一個XML序列元素在WSDL/XSD定義:JSON to SOAP WSO2 Api manager xml序列
<xs:complexType name="hellolist">
<xs:sequence>
<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="hellolistResponse">
<xs:sequence>
<xs:element name="return" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
我不知道如何映射JSON數組使用PayloadFactory一個XML序列。我找到的所有示例僅處理簡單的json和SOAP消息,如sample WSO2 transformation。 我想改變這個JSON消息:
{"hellolist":{"name":["Peter","Mary","Ann","James"]}}
爲了這個SOAP消息:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dum="http://dummyservice2.com/">
<soapenv:Header/>
<soapenv:Body>
<dum:hellolist>
<name>Peter</name>
<name>Mary</name>
<name>Ann</name>
<name>James</name>
</dum:hellolist>
</soapenv:Body>
</soapenv:Envelope>
你stucked與映射JSON數組到SOAP?這就是全部? –
是的,問題是每個請求中JSON數組的長度都不相同。 –