我已经编写了简单的消息流,其中HTTPInput节点接收JSON消息并发回SOAP消息。我已经添加了HTTPInput、Compute和HTTPReply节点。计算节点具有以下ESQL。
BEGIN
SET OutputRoot.SOAP.users[] =
(SELECT I.id AS id,
I.name AS name,
I.userName AS username,
I.email AS email
FROM InputRoot.JSON.Data[]
AS I);
RETURN TRUE;
END;
当我使用下面的JSON进行服务调用时
{
"id": 1,
"name": "lalala Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
}
}
我得到的XML响应是
<SOAP_Domain_Msg>
<users>
<id>1</id>
<name>lalala Graham</name>
<email>Sincere@april.biz</email>
</users>
</SOAP_Domain_Msg>
我的问题是,我希望将此响应放在SOAP信封中。我尝试在HTTPReply节点之前添加SOAP信封节点,但得到以下错误。
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>BIP3113E: Exception detected in message flow MFSamplej2s (integration node integration_server)</faultstring>
<faultactor>http://localhost:7800/users</faultactor>
<detail>
<text>Exception. BIP2230E: Error detected whilst processing a message in node 'MFSamplej2s.SOAP Envelope'. : C:\ci\product-build\WMB\src\WebServices\WSLibrary\ImbSOAPEnvelopeNode.cpp: 280: ImbSOAPEnvelopeNode::evaluate: ComIbmSOAPEnvelopeNode: MFSamplej2s#FCMComposite_1_1
BIP3171E: A message using an incorrect parser ('SOAP') was detected in node: 'SOAP Envelope' : C:\ci\product-build\WMB\src\WebServices\WSLibrary\ImbSOAPEnvelopeNode.cpp: 613: ImbSOAPEnvelopeNode::getMessageBody: :</text>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
任何帮助都是非常有帮助的。
发布于 2019-12-04 18:46:56
发布于 2019-12-04 19:14:32
这与以下代码一起工作。
SET OutputRoot.XMLNSC.ns1:citizen.ns1[] =
(SELECT I.username AS username,
I.personID AS personID,
I.familyName AS familyName,
I.title AS title,
I.dob AS dob
FROM InputRoot.JSON.Data[] AS I);
必须用XMLNSC替换SOAP,然后SOAP响应就来了。实际上,这是在@Supun分享的链接中。
https://stackoverflow.com/questions/59174013
复制相似问题