|
From: Patrick Y. <kc...@ce...> - 2004-03-20 07:21:49
|
Hi,
Your program is correct. However, since you are writing a MSH client, =
the Request object will try to locate a property file called =
msh_client.properties.xml in the client side. Inside the property file, =
you need to fill in various information, including the location of the =
MSH server you want the client to connect to. Please try to locate the =
file and update the values inside the property file.
Hope this helps.
Regards, -Patrick
----- Original Message -----=20
From: Yerubandi Rao=20
To: Ebxmlms-Develop (E-mail) ; Ebxmlms-General (E-mail)=20
Cc: messaging-dev=20
Sent: Saturday, March 20, 2004 7:39 AM
Subject: [ebxmlms-general] Application Context :: Receiving all =
messages
i am trying to write a servlet that receives all messages ( =
irrespective of cpaid, conversationid, service , action ).
i am trying something like this-----------
public class Pong extends HttpServlet implements MessageListener {
String toMshUrl =3D "http://192.168.18.72:8080/msh"; < peer MSH =
address>
String localMsh =3D "http://localhost:8080/msh/"; < localMSH address>
Request req =3D null;
public void init(ServletConfig config) throws ServletException {
super.init(config); =20
try
{
ApplicationContext ac =3D new ApplicationContext( "*", "*", "*","*"); =
< wild card'ing >=20
req =3D new Request(ac,new URL( ),this,"HTTP"); /* from the doc's , =
looks like i need to do something like this */=20
}
catch ( Exception ex)
{
ex.printStackTrace();
} =20
}
so my question is in the request object , what do i need to pass in =
for URL . if someone can explain in a detailed manner , i would really =
appreciate it.
i tried passing in the URL of http://localhost:8080/msh <my local MSH =
url > , then the servlet just hangs. i tried debugging it using JBossIDE =
and i see that it hangs in expectMapResponse() method of Request class.
-Venkat
---------------------------------------------------
Complete Code
---------------------------------------------------
import hk.hku.cecid.phoenix.message.handler.ApplicationContext;
import hk.hku.cecid.phoenix.message.handler.MessageListener;
import hk.hku.cecid.phoenix.message.handler.Request;
import hk.hku.cecid.phoenix.message.handler.Utility;
import hk.hku.cecid.phoenix.message.packaging.EbxmlMessage;
import hk.hku.cecid.phoenix.message.packaging.MessageHeader;
import java.io.IOException;
import java.net.URL;
import java.util.Date;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Pong extends HttpServlet implements MessageListener {
String toMshUrl =3D "http://192.168.18.72:8080/msh";
String localMsh =3D "http://localhost:8080/msh/";=20
Request req =3D null;
public void init(ServletConfig config) throws ServletException {
super.init(config); =20
try
{
ApplicationContext ac =3D new ApplicationContext( "*", "*", "*","*"); =
=20
req =3D new Request(ac,new URL(localMsh),this,"HTTP");=20
}
catch ( Exception ex)
{
ex.printStackTrace();
} =20
}
=20
public void doGet(HttpServletRequest request,HttpServletResponse =
response)
throws ServletException, IOException {
doPost(request,response);
}
=20
public void doPost(HttpServletRequest request,HttpServletResponse =
response)
throws ServletException, IOException { =20
}
=20
public URL getClientUrl() {
return null;
}
public void onMessage(EbxmlMessage ebxmlMessage)=20
{ =20
System.out.println(" SSI Incoming Message Handler "); =20
if ( ebxmlMessage.getErrorList() =3D=3D null)
{ =20
stdOut(ebxmlMessage);
} =20
}
=20
void stdOut(EbxmlMessage ebxmlMessage )
{
try
{
ebxmlMessage.writeTo(System.out);=20
System.out.flush();
}
catch( Exception ex)
{
ex.printStackTrace();
}
}
}
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=CCk
_______________________________________________
ebxmlms-general mailing list
ebx...@li...
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general
|