|
From: Marcus W. <mar...@ho...> - 2004-01-13 10:13:21
|
Dear all, =20 I have tried the following code to test the toParty and fromParty in the = ack message. Hermes swaps the first fromPartyID and toPartyID and DROPS = all the rest partyID when generating the asynchronous acknowledgment. =20 Can Hermes not to drops the partyID? Since those information would be = useful for the toParty or any other intermediate. =20 Actually, I=A1=A6m now trying to add an intermediary router between MSHs = and get the problems. i.e. MSH(s) <----> Intermediary Router < ---- > MSH(s) Here is the logic of intermediary router 1. Get the ToPartyID (e.g. DUNS number in this case) from ebxml 2. Use ToPartyID as a key to get the real destination from the = routing table. 3. Post the ebxml to the real destination =20 =20 In the test case, the router can=A1=A6t route the ACK message since it = drop all the ToPartyID except the first one. Can Hermes remains those = ID in the future release? Or anyone can suggest a better implementation = to this issue? =20 Marcus Wong _____________________________________________________ Client Source _____________________________________________________ import java.net.*; import java.util.*; import hk.hku.cecid.phoenix.message.handler.*; import hk.hku.cecid.phoenix.message.packaging.*; =20 public class LoopBack implements MessageListener { =20 public static void main(String [] args) { LoopBack sample =3D new LoopBack(); =20 sample.run(); } =20 public void run() { try { System.out.println("Packaging..."); =20 String cpaID =3D "CPA_2002"; String conversationID =3D "Item_No_128" ; String service =3D = "http://www.cecid.hku.hk/ebxml/service"; String action =3D "Order"; =20 ApplicationContext ac =3D new ApplicationContext( cpaID, = conversationID, service, action); String transportType =3D "HTTP"; String toMshUrl =3D "http://localhost:8081/msh"; Request mshReq =3D new Request(ac, new URL(toMshUrl), = this, transportType); =20 EbxmlMessage message =3D new EbxmlMessage(); MessageHeader header =3D message.addMessageHeader(); =20 header.addFromPartyId("http://localhost:8082/msh", = "abcid"); header.addFromPartyId("http://localhost:8084/msh"); header.addFromPartyId("12345","DUNS"); =20 header.addToPartyId( "http://localhost:8085/msh", = "abcid"); header.addToPartyId( "http://localhost:8086/msh"); header.addToPartyId("678910","DUNS"); =20 header.setCpaId(cpaID); header.setConversationId(conversationID); header.setService(service); header.setAction(action); header.setTimestamp(Utility.toUTCString(new Date())); =20 String messageId =3D Utility.generateMessageId(new = Date(), message); header.setMessageId(messageId); =20 message.saveChanges(); =20 System.out.println("Try to send..."); mshReq.sendReliably(message,false); Thread.sleep(10000); } catch(Exception e) { e.printStackTrace(); } } =20 public URL getClientUrl() { return null; } =20 public void onMessage(EbxmlMessage ebxmlMessage) { } } =20 =20 _________________________________________ Request (Port 8085): _________________________________________ <soap-env:Envelope =A1K> =A1K <eb:From> <eb:PartyId eb:type=3D"abcid">http://localhost:8082/msh</eb:PartyId> <eb:PartyId>http://localhost:8084/msh</eb:PartyId> <eb:PartyId eb:type=3D"DUNS">12345</eb:PartyId> </eb:From> <eb:To> <eb:PartyId eb:type=3D"abcid">http://localhost:8085/msh</eb:PartyId> <eb:PartyId>http://localhost:8086/msh</eb:PartyId> <eb:PartyId eb:type=3D"DUNS">678910</eb:PartyId> </eb:To> =A1K <eb:MessageId>20040113-083038250-CPA_2002.http://www.cecid.hku.hk/ebxml/s= ervice.Order.1@10.30.10.138</eb:MessageId> =A1K <eb:AckRequested = xmlns:eb=3D"http://www.oasis-open.org/committees/ebxml-msg/schema/msg-hea= der-2_0.xsd" eb:version=3D"2.0" soap-env:mustUnderstand=3D"1" = eb:signed=3D"false" = soap-env:actor=3D"urn:oasis:names:tc:ebxml-msg:actor:toPartyMSH"/></soap-= env:Header> =A1K </soap-env:Envelope> =20 =20 _________________________________________ Reply (Port 8082) _________________________________________ <soap-env:Envelope =A1K> =A1K <eb:From> <eb:PartyId eb:type=3D"abcid">http://localhost:8085/msh</eb:PartyId> </eb:From> <eb:To> <eb:PartyId eb:type=3D"abcid">http://localhost:8082/msh</eb:PartyId> </eb:To> =A1K <eb:Acknowledgment = xmlns:eb=3D"http://www.oasis-open.org/committees/ebxml-msg/schema/msg-hea= der-2_0.xsd" eb:version=3D"2.0" soap-env:mustUnderstand=3D"1"> <eb:Timestamp>2004-01-13T08:30:38Z</eb:Timestamp> <eb:RefToMessageId>20040113-083038250-CPA_2002.http://www.cecid.hku.hk/eb= xml/service.Order.1@10.30.10.138</eb:RefToMessageId> <eb:From> <eb:PartyId eb:type=3D"abcid">http://localhost:8085/msh</eb:PartyId> </eb:From> </eb:Acknowledgment> =A1K </soap-env:Envelope> |