我的目的是通过另一个Hermes2向MSH(Hermes2 http://www.cecid.hku.hk/hermes.php)发送ebxml消息。
我发送相当简单的消息(没有附件),这是消息:
POST /corvus/httpd/ebms/sender HTTP/1.0
User-Agent: PEAR-SOAP 0.12.0-beta
Host: 10.0.4.9
Content-Type: text/xml; charset=UTF-8
Content-Length: 698
SOAPAction: "PaymentAddRequest"
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<cpaId>ZSK_KOLEK</cpaId>
<service>http://www.squiz.pl/zsk/ebxml</service>
<action>PaymentAddRequest</action>
<convId>convId</convId>
<fromPartyId>KOLEK</fromPartyId>
<fromPartyType>urn:oasis:names:tc:ebxml-cppa:partyid-type:duns</fromPartyType>
<toPartyId>ZSK-C</toPartyId>
<toPartyType>urn:oasis:names:tc:ebxml-cppa:partyid-type:duns</toPartyType>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
作为回应,我得到了以下信息:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<message_id xmlns="http://service.ebms.edi.cecid.hku.hk/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">20150112-092001-65410@127.0.1.1</message_id>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
邮件已注册,但随后在logs / ebms.log中出现以下错误
[Thread-1855 ] <ERROR> <cecid.ebms.spa> <Error in outbox task>
hk.hku.cecid.ebms.spa.task.MessageValidationException: Cannot reconstruct the message 20150112-092435-20713@127.0.1.1 from repository
by java.lang.RuntimeException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
by com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
by javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
同时查看数据库中的存储库表我可以看到已插入一行,内容列包含十六进制格式的消息(\ x3c3f786d6c2076657273696f6e3d ...),一旦转换为ASCII,它就说:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd">
<SOAP-ENV:Header xsi:schemaLocation="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
<eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
<eb:From>
<eb:PartyId eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">KOLEK</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">ZSK-C</eb:PartyId>
</eb:To>
<eb:CPAId>ZSK_KOLEK</eb:CPAId>
<eb:ConversationId>convId</eb:ConversationId>
<eb:Service>http://www.squiz.pl/zsk/ebxml</eb:Service>
<eb:Action>PaymentAddRequest</eb:Action>
<eb:MessageData>
<eb:MessageId>20150112-092435-20713@127.0.1.1</eb:MessageId>
<eb:Timestamp>2015-01-12T09:24:35.207+01:00</eb:Timestamp>
</eb:MessageData>
<eb:DuplicateElimination/>
</eb:MessageHeader>
<eb:SyncReply SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="1" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
<eb:AckRequested SOAP-ENV:actor="urn:oasis:names:tc:ebxml-msg:actor:toPartyMSH" SOAP-ENV:mustUnderstand="1" eb:signed="false" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
</SOAP-ENV:Header>
<SOAP-ENV:Body xsi:schemaLocation="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
</SOAP-ENV:Envelope>
但它没有传递到端点,似乎Hermes2甚至没有尝试将它发送到第二个Hermes2。两个实例都配置了适当的伙伴关系。
有人能指出我正确的方向吗?
答案 0 :(得分:0)
好的,我花了很长时间才找到问题,然后找到解决方案,所以希望我可以省时间。
关于Hermes 2安装的文档说它需要PostgreSQL 8.0或更高版本。这是个谎言!删除Postgres 9.3并使用Postgres 8.4重新安装Hermes解决了这个问题。