EAI接口开发中,有时候为了方便扯皮,需要将发送给外系统或者外系统发送过来的报文打成xml文件保存。这时BS:EAI XML Write to File就派上用场。BS中三个方法都可以使用。
以Account对应的IO的为例,IO结构:
Account
AccField1
AccField2
AccField3
Contact
ConField1
ConField2
ConField3
<AccountAccField1="value"AccField2="value"AccField3="value">
<ContactConField1="value"ConField1="value"ConField1="value">
<Account>
<Account>
<AccField1>value</AccField1>
<AccField2>value</AccField2>
<AccField3>value</AccField3>
<Contact>
<ConField1>value</ConField1>
<ConField2>value</ConField2>
<ConField3>value</ConField3>
</Contact>
</Account>
<AccField1>value</AccField1>
<AccField2>value</AccField2>
<AccField3>value</AccField3>
<Contact>
<ConField1>value</ConField1>
<ConField2>value</ConField2>
<ConField3>value</ConField3>
</Contact>
</Account>
- GenerateNamespaceDecl:显示命名空间,在发送报文中,如果收发双方命名空间不一致,接收方就会解析不出来相应信息。默认为false,应设置为true。
- UseSiebelMessageEnvelope:如果为true,报文的头尾会被<SiebelMessage>包起来,默认为true,应设为false。
设置后的报文(命名空间视IO和IC的userproperty而定):
<Account xmlns="xxxx">
<AccField1 xmlns="xxxx">value</AccField1>
<AccField2 xmlns="xxxx">value</AccField2>
<AccField3 xmlns="xxxx">value</AccField3>
<Contact xmlns="xxxx">
<ConField1 xmlns="xxxx">value</ConField1>
<ConField2 xmlns="xxxx">value</ConField2>
<ConField3 xmlns="xxxx">value</ConField3>
</Contact>
</Account>
<AccField1 xmlns="xxxx">value</AccField1>
<AccField2 xmlns="xxxx">value</AccField2>
<AccField3 xmlns="xxxx">value</AccField3>
<Contact xmlns="xxxx">
<ConField1 xmlns="xxxx">value</ConField1>
<ConField2 xmlns="xxxx">value</ConField2>
<ConField3 xmlns="xxxx">value</ConField3>
</Contact>
</Account>