XML 前缀无效
我正在尝试向 Swift Alliance Access(SAA) 发送 XML 消息。我的示例 xml 消息如下所示。但我收到“无效的 XML 前缀”错误消息。当我根据 XSD 检查 XML 时。它说有效。错误消息说它可能与SAA消息合作伙伴或xml内容有关,但我找不到解决方案。
也许这种情况与 XML 无关。我只是想确保 XML 没有问题。 SAA 消息合作伙伴配置也可能导致此问题。
我可能会错过什么?
XSD 文件太大。如果有人想看的话我可以上传。
<Saa:DataPDU xmlns:Saa="urn:swift:saa:xsd:saa.2.0">
<Saa:Revision>2.0.13</Saa:Revision>
<Saa:Header>
<Saa:Message>
<Saa:SenderReference>12345678</Saa:SenderReference>
<Saa:MessageIdentifier>pacs.008.001.08</Saa:MessageIdentifier>
<Saa:Format>MX</Saa:Format>
<Saa:SubFormat>Input</Saa:SubFormat>
<Saa:Sender>
<Saa:BIC12>XXXXXXXXXXXX</Saa:BIC12>
</Saa:Sender>
<Saa:Receiver>
<Saa:BIC12>YYYYYYYYYYYY</Saa:BIC12>
</Saa:Receiver>
</Saa:Message>
</Saa:Header>
</Saa:DataPDU>
解码 XML 数据时发生错误。检查消息伙伴配置或文件内容。 上下文 = SerializerException ErrorMessafe=decodePDU:“无效的 XML 前缀”
I am trying to send XML message to Swift Alliance Access(SAA). My sample xml message is like below. But I am getting "Invalid XML prefix" error message. When I check the XML against XSD. It says valid. The error message says it may be related to SAA message partner or xml content, but I couldn't find a solution.
Maybe the situation is not related to XML. I just want to make sure there is no problem with the XML. SAA Message Partner configuration can also cause this.
What could I be missing?
XSD file is too big. I can upload it if anyone wants to see it.
<Saa:DataPDU xmlns:Saa="urn:swift:saa:xsd:saa.2.0">
<Saa:Revision>2.0.13</Saa:Revision>
<Saa:Header>
<Saa:Message>
<Saa:SenderReference>12345678</Saa:SenderReference>
<Saa:MessageIdentifier>pacs.008.001.08</Saa:MessageIdentifier>
<Saa:Format>MX</Saa:Format>
<Saa:SubFormat>Input</Saa:SubFormat>
<Saa:Sender>
<Saa:BIC12>XXXXXXXXXXXX</Saa:BIC12>
</Saa:Sender>
<Saa:Receiver>
<Saa:BIC12>YYYYYYYYYYYY</Saa:BIC12>
</Saa:Receiver>
</Saa:Message>
</Saa:Header>
</Saa:DataPDU>
An error occured while decoding XML data. Check the message partner configuration or the file content.
Context = SerializerException
ErrorMessafe = decodePDU: "Invalid XML Prefix"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 XML 是命名空间格式良好,并且您说您已根据管理 XSD 成功验证了它。
抱怨“无效 XML 前缀”的代码没有任何理由抱怨,因为唯一有效的 XML 命名空间前缀是
Saa
,而且它已正确定义。推测: 令人抓狂的代码设计不当,需要硬连线的 XML 命名空间前缀,但它无权这样做。Your XML is namespace-well-formed, and you say that you've successfully validated it against the governing XSD.
The code that's griping about an "Invalid XML prefix" has no basis to complain since the only XML namespace prefix in play is
Saa
, and it's properly defined. Speculation: The griping code is improperly designed and is expecting a hard-wired XML namespace prefix, which it has no right to do.