web stats
Skip to end of metadata
Go to start of metadata

Create a new Java project and create a class that extends com.mirth.connect.connectors.ws.AcceptMessage

Example

I suggest that you include the following classes in your project:

Export this project as a jar file and add it to your custom-lib folder in your mirthconnect directory

Restart Mirth Connect

You can now create your own custom web service listener

 
  • No labels

6 Comments

  1. Has anyone some more explanation how to build a custom web service in Mirth?

  2. Note that to actually process a message through a channel, you need to call processData on the WebServiceReceiver object.

    1. Note that to actually process a message through a channel, you need to call processData on the WebServiceReceiver object.

      Sorry, but what does it mean?

      i'm beginner in mirth developement.

      Thanks

       

  3. Hello there is a way to give back to the client two values , such as < id > 33 < / id > < name> test < / name> ?
  4. I tried but it does not work.

    I create a new Java project and create a class CustomAcceptMessage, i configure the build path with 

    C:\Program Files (x86)\Mirth Connect\extensions\ws\ws-server.jar

    but when i deploy the mirth channel 

    "

    Custom web service class initialization failed
    java.lang.ClassNotFoundException: com.custom.webservice.CustomAcceptMessage
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.mirth.connect.connectors.ws.WebServiceReceiver.onStart(WebServiceReceiver.java:114)
    at com.mirth.connect.donkey.server.channel.SourceConnector.start(SourceConnector.java:103)
    at com.mirth.connect.donkey.server.channel.Channel.start(Channel.java:671)
    at com.mirth.connect.server.controllers.DonkeyEngineController$DeployTask.doDeploy(DonkeyEngineController.java:1274)
    at com.mirth.connect.server.controllers.DonkeyEngineController$DeployTask.execute(DonkeyEngineController.java:1171)
    at com.mirth.connect.server.channel.ChannelTask.call(ChannelTask.java:59)
    at com.mirth.connect.server.channel.ChannelTask.call(ChannelTask.java:16)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    Custom web service class initialization failed
    java.lang.ClassNotFoundException: com.custom.webservice.CustomAcceptMessage

    "

  5. Hi, this example is not working anymore in 3.5 version. 

    Can anybody tell me how to do it in 3.5 version? Where to find the .jar library?

    it's only to change the method name of web service (not accept message)

    thanks in advance