0

我真的是 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();

}

现在我想捕获接收消息以进行进一步处理......我该怎么做?

4

1 回答 1

0

仔细看HAPI提供的例子

ReceivingApplication handler = new ExampleReceiverApplication(); 

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

于 2013-12-02T04:14:55.477 回答