|
From: Gait B. <gai...@ti...> - 2005-09-09 07:08:58
|
If you want to use onMessage, getClientURL should return a null pointer
I believe.
pso...@no... wrote:
>
> Hi,
> I want to use an http application with msh....but it seems i don't
> receive any message... (onMessage method...)
> (the doPost and doGet method don't receive messages)
>
> For this :
>
> _1 . i create a ClientServlet like this :_
>
> public class ClientServlet extends HttpServlet
> implements MessageListener {
>
>
> public void init(ServletConfig config ) ...{
> super.init(config) ;
>
>
> ApplicationContext appCont = new ApplicationContext(
> "AZE_2005", *, *, *) ;
>
> Request mshReq = new Reques( appCont,
> new URL(mshServerUrl),
> this,
> "http",
> Request.DEFAULT_RETRIES,
>
> Request.DEFAULT_RETRY_INTERVAL,
>
> Request.SYNC_REPLY_NODE_SIGNALS_AND_RESPONSE,
>
> Request.DEFAULT_MESSAGE_ORDER_SEMANTICS,
>
> Request.DEFAULT_PERSIST_DURATION) ;
>
> }
>
> public void onMessage( EbXmlMessage msg ) {
> System.out.println( "clientServlet.onMessage" ) ;
> }
>
> public URL getClientUrl( ) {
> return new URL (clientServletUrl) ;
> }
>
> ...
>
> _2 . i create a Client for sending messages like this: (like
> LoobBack sample)_
>
> _ _
> EbxmlMessage msg = new EbxmlMessage() ;
> MessageHeader head = msg.addMessageHeader() ;
> head.addFromPartyId( "fromPartyId", "fromSample");
> head.addToPartyId( "toPartyId" , "toSample");
>
> head.setCpaID( "AZE_2005");
> head.setConversationId( "item1");
> head.setService( "http://www.cecid.hku.hk/ebxml/service");
> head.setAction( "Order");
> head.setTimestamp( Utility.toUTCString(new Date() ));
> head.setMessageId( Utility.generateMessageId( new Date(),
> message) ) ;
> ... // add the payload also....
> msg.saveChanges() ;
>
> SendRequest rq = new SendRequest() ;
> rq.send(msg, "http://localhost:8080/msh") ;
>
>
> I launch msh server and my ClientServlet then the send message tool...
>
> - The ClientServlet application is registered (in database and in
> mshConnectionTable)
> - The applicationContext is found when the message is received
>
> but......... ClientServlet don't receive a message ...(it's active ..
> tested with the url http://localhost:8010/clientServlet
>
> Any idea ?
> How can i implement this model referenced in "development guide 2.2" ?
>
> Thx,
> Pascal
>
>
>
|