Announcement

Collapse
No announcement yet.

Connecting to a Web Service

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connecting to a Web Service

    Hey All,

    I am trying to retrieve messages from a web service. I have been giving the wsdl file and a certificate file as well as will have a username and password if need be.

    I am pretty new to Mirth and am at a lost at where to start.

    What I need to know if what is the procedure to call a web service to receive messages? do I need a Web Services Listener? I know you can create a Web Service Sender in the Destination tab and point to the wsdl file and get operations (methods) but from there I am lost? Any help or guidance would be greatly appreciated.

    Thank you,

  • #2
    In order to invoke/consume a web service, you'll want to use a Web Service Sender. Once invoked, you can retrieve the response from the server in a number of ways.

    You can use the "Send Response To" combo box to forward the response to a different channel (or to the same channel, but be careful with that). Or, you can access the response from your Web Service Sender destination in a subsequent destination using the response map (assuming your channel is synchronized, which it should be by default). You could also manually perform any complex parsing/routing in the postprocessor also by using the response map to get the response message from your Web Service Sender destination.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Thank you for the response I have pointed my Web Service Sender to the WSDL but when I try to get operations I am getting the following error:

      Error caching WSDL. Please Check the WSDL URL and authentication settings.

      I do have a username and password but not actually sir on how to pass these credentials to the webservice. Or to Cache do I even need these? Without caching I cannot get any of the operations.

      Thank you in advance.

      Comment


      • #4
        You'll need to check with whoever is hosting the service and ask them what URL, username, and password you should be using.
        Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

        Nicholas Rupley
        Work: 949-237-6069
        Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


        - How do I foo?
        - You just bar.

        Comment


        • #5
          Okay, I have gotten the operations for the WSDL and now I am trying to send files to the webservice when I do I am getting this error in Mirth? I have a certificate given to me. My question is how to I use that certificate in Mirth?

          Thanks,


          ERROR-410: Web Service Connector error
          ERROR MESSAGE: Error connecting to web service.
          com.sun.xml.internal.ws.client.ClientTransportExce ption: HTTP transport error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
          at com.sun.xml.internal.ws.transport.http.client.Http ClientTransport.getOutput(Unknown Source)
          at com.sun.xml.internal.ws.transport.http.client.Http TransportPipe.process(Unknown Source)
          at com.sun.xml.internal.ws.transport.http.client.Http TransportPipe.processRequest(Unknown Source)
          at com.sun.xml.internal.ws.transport.DeferredTranspor tPipe.processRequest(Unknown Source)
          at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unk nown Source)
          at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unkn own Source)
          at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unkno wn Source)
          at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unk nown Source)
          at com.sun.xml.internal.ws.client.Stub.process(Unknow n Source)
          at com.sun.xml.internal.ws.client.dispatch.DispatchIm pl.doInvoke(Unknown Source)
          at com.sun.xml.internal.ws.client.dispatch.DispatchIm pl.invoke(Unknown Source)
          at com.mirth.connect.connectors.ws.WebServiceMessageD ispatcher.processMessage(WebServiceMessageDispatch er.java:176)
          at com.mirth.connect.connectors.ws.WebServiceMessageD ispatcher.doDispatch(WebServiceMessageDispatcher.j ava:106)
          at com.mirth.connect.connectors.ws.WebServiceMessageD ispatcher.doSend(WebServiceMessageDispatcher.java: 204)
          at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:164)
          at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
          at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
          at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
          at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:54)
          at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
          at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
          at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
          at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
          at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
          at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
          at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
          at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:176)
          at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:143)
          at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:487)
          at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:266)
          at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:225)
          at com.mirth.connect.connectors.file.FileMessageRecei ver.processFile(FileMessageReceiver.java:228)
          at com.mirth.connect.connectors.file.FileMessageRecei ver.poll(FileMessageReceiver.java:118)
          at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:97)
          at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
          at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor.runWorker(ThreadPoolExecutor.java: 1061)
          at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :575)
          at java.lang.Thread.run(Unknown Source)
          Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
          at sun.security.ssl.Alerts.getSSLException(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
          at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
          at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
          at sun.security.ssl.ClientHandshaker.serverCertificat e(Unknown Source)
          at sun.security.ssl.ClientHandshaker.processMessage(U nknown Source)
          at sun.security.ssl.Handshaker.processLoop(Unknown Source)
          at sun.security.ssl.Handshaker.process_record(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.performInitialHands hake(Unknown Source)
          at sun.security.ssl.SSLSocketImpl.startHandshake(Unkn own Source)
          at sun.security.ssl.SSLSocketImpl.startHandshake(Unkn own Source)
          at sun.net.http://www.protocol.https.HttpsClien...onnect(Unknown Source)
          at sun.net.http://www.protocol.https.AbstractDe...onnect(Unknown Source)
          at sun.net.http://www.protocol.http.HttpURLConn...Stream(Unknown Source)
          at sun.net.http://www.protocol.https.HttpsURLCo...Stream(Unknown Source)
          ... 38 more
          Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
          at sun.security.validator.PKIXValidator.doBuild(Unkno wn Source)
          at sun.security.validator.PKIXValidator.engineValidat e(Unknown Source)
          at sun.security.validator.Validator.validate(Unknown Source)
          at sun.security.ssl.X509TrustManagerImpl.validate(Unk nown Source)
          at sun.security.ssl.X509TrustManagerImpl.checkTrusted (Unknown Source)
          at sun.security.ssl.X509TrustManagerImpl.checkServerT rusted(Unknown Source)
          ... 50 more
          Caused by: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certification path to requested target
          at sun.security.provider.certpath.SunCertPathBuilder. engineBuild(Unknown Source)
          at java.security.cert.CertPathBuilder.build(Unknown Source)
          ... 56 more

          Comment


          • #6
            I have added the certificate to the cacerts keystore. is there any other keystore that I need to add the certificate to?

            Comment


            • #7
              how exactly did you do that? thanks

              Comment


              • #8
                I found a great tutorial: https://vault.verj.io/ebase/doc/web_services_https.htm

                Comment

                Working...
                X