Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用HAPI服务器捕获传入消息_Java_Hapi - Fatal编程技术网

Java 如何使用HAPI服务器捕获传入消息

Java 如何使用HAPI服务器捕获传入消息,java,hapi,Java,Hapi,我对Hapi HL7非常陌生,并使用了示例服务器类 public static void main(String[] args) throws Exception { HapiContext context = new DefaultHapiContext(); MinLowerLayerProtocol mllp = new MinLowerLayerProtocol(); mllp.setCharset("UTF-8"); context.setLowerLa

我对Hapi HL7非常陌生,并使用了示例服务器类

public static void main(String[] args) throws Exception {
    HapiContext context = new DefaultHapiContext();
    MinLowerLayerProtocol mllp = new MinLowerLayerProtocol();
    mllp.setCharset("UTF-8");
    context.setLowerLayerProtocol(mllp);


    int port = 2010; // The port to listen on
    boolean useTls = false; // Should we use TLS/SSL?

    HL7Service server = context.newServer(port, useTls);

    ReceivingApplication handler = new ExampleReceiverApplication();


    server.registerApplication("*", "*", handler);
    server.registerConnectionListener(new MyConnectionListener());

    server.setExceptionHandler(new MyExceptionHandler());

    server.startAndWait();

}
现在我想捕捉接收到的消息以便进一步处理。。。
我怎样才能做到这一点呢?

仔细看看HAPI提供的示例

ReceivingApplication handler = new ExampleReceiverApplication(); 

这个类可以处理传入的消息

嗨,danke für deine Antwort。我是mittlerweile selbst die Lösung gefunden。我已经收到了一份完整的申请。registerApplication(“ADT”、“A01”、新的MyHandler());我的主人是贝斯皮尔汉德勒(Expample')的主人,我的父亲是一位伟大的女主人。丹克