Announcement

Collapse
No announcement yet.

How to load wsdl from a file

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

  • How to load wsdl from a file

    Hi,

    I have built a channel that sends the contents of a file to a web service: source is FileReader, destination is web service sender.
    Forthe webservice sender, is there a way I can load the wsdl from a file?

  • #2
    YES.. you can do that..

    Choose the Destination Connector type as "SOAP Sender". Click the browse the button and choose the wsdl file to be loaded.

    Then you can click the 'Get Methods' button to get the methods populated.

    Hope this helps.

    Thanks
    selvi

    Comment


    • #3
      There is no Browse Button in Mirth 2.x for web service sender.
      JRP.
      Interoperability Analyst for pharmacy I.S.

      Comment


      • #4
        I tried something with a an wsdl from other manufacturer that didn't work, but may be for you can be usefull.
        If you have any webserver running, take the wsdl and paste it in any folder that can be accessed. For example, if you have an IIS on the server1 with an test aplication (called test). You can paste your mywsdl.wsdl file in the root and access to it with this:

        http://server1/test/mywsdl.wsdl

        This worked for me to obtain the methods, but didn't work because of the manufacturer webservice.

        Hope this helps.

        Comment


        • #5
          Thanks for the tip, Dagan.
          I don't have a web server running conveniently,though. Let me see if I can get one going.
          -ja

          Comment


          • #6
            Originally posted by swanja View Post
            Thanks for the tip, Dagan.
            I don't have a web server running conveniently,though. Let me see if I can get one going.
            -ja
            You can use the public_html folder in Mirth to host the wsdl if you need to.
            Jacob Brauer
            Director, Software Development
            NextGen Healthcare

            sigpic

            Comment


            • #7
              Thanks Jacob. That is very useful to know.
              A colleague here suggested to try a "file" url. I used:

              file:///c:/data/test/MyWebService.wsdl

              and it seemed to work. I am going to test this further. Hooray to the versatility of Mirth

              -ja

              Comment


              • #8
                Both public_html and 'file' url work. But there is a conflict with the Authentication setting (the web service I am testing with requires authentication).

                Perhaps, if the accessing of the .wsdl be made into a design-time activity and accessing of the web service be a run-time activity, this may be resolved? Just a thought.

                [I am using MC v2.1.0]

                -ja

                Comment


                • #9
                  What URI would one use to get to the public_html folder? I've tried a number of things but none appear to work ...

                  Comment


                  • #10
                    As it turns out, I was trying too hard.

                    I was trying
                    http://localhost/public_html/test.wsdl
                    http://localhost/mirth/public_html/test.wsdl
                    http://localhost:8080/public_html/test.wsdl
                    http://localhost:8080/mirth/public_html/test.wsdl

                    ... when all I needed was
                    http://localhost:8080/test.wsdl

                    (If you didn't use the defaults when setting up Mirth Connect, you'll want to replace 8080 with whatever port number you specified for the HTTP server.)

                    Comment


                    • #11
                      When 2.2 is released we will recommend using the file url instead of public_html, since this was improved for 2.2:
                      http://www.mirthcorp.com/community/i...wse/MIRTH-1967
                      Jacob Brauer
                      Director, Software Development
                      NextGen Healthcare

                      sigpic

                      Comment


                      • #12
                        I was able to load the WSDL from file, generate the SOAP envelope, etc.

                        So I put back the https: URL and tried processing a message through the channel. I get an error:
                        ERROR-410: Web Service Connector error
                        ERROR MESSAGE: Error connecting to web service.
                        javax.xml.ws.WebServiceException: Failed to access the WSDL at: file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl. It failed with:
                        Invalid WSDL file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl, expected {http://schemas.xmlsoap.org/wsdl/}definitions found h2 at (lineLine number = 1
                        Column number = 5
                        System Id = file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl
                        Public Id = null
                        Location Uri= file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl
                        CharacterOffset = 8
                        ).
                        ...
                        -- which to me looks like it's still looking for the file: URL.

                        However, if I leave the file: URL in the WSDL field, I also get an error.
                        ERROR-410: Web Service Connector error
                        ERROR MESSAGE: Error connecting to web service.
                        java.lang.IllegalStateException: unsupported protocol: 'file'
                        at org.apache.commons.httpclient.protocol.Protocol.la zyRegisterProtocol(Protocol.java:148)

                        Anybody out there got any words of wisdom?

                        Comment


                        • #13
                          Originally posted by DavidL View Post
                          I was able to load the WSDL from file, generate the SOAP envelope, etc.

                          So I put back the https: URL and tried processing a message through the channel. I get an error:
                          ERROR-410: Web Service Connector error
                          ERROR MESSAGE: Error connecting to web service.
                          javax.xml.ws.WebServiceException: Failed to access the WSDL at: file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl. It failed with:
                          Invalid WSDL file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl, expected {http://schemas.xmlsoap.org/wsdl/}definitions found h2 at (lineLine number = 1
                          Column number = 5
                          System Id = file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl
                          Public Id = null
                          Location Uri= file:/C:/Program%20Files/Mirth/Connect/temp/WebServiceSender5969903927816314230.wsdl
                          CharacterOffset = 8
                          ).
                          ...
                          -- which to me looks like it's still looking for the file: URL.

                          However, if I leave the file: URL in the WSDL field, I also get an error.
                          ERROR-410: Web Service Connector error
                          ERROR MESSAGE: Error connecting to web service.
                          java.lang.IllegalStateException: unsupported protocol: 'file'
                          at org.apache.commons.httpclient.protocol.Protocol.la zyRegisterProtocol(Protocol.java:148)

                          Anybody out there got any words of wisdom?
                          I don't think pointing to a file directly will work for sending messages prior to 2.2. You could try the RC if you like. So far it seems pretty stable.

                          I'm not sure what your issue is when you use the URL. A temp file copy of the WSDL is saved and used during sending when there is authentication involved.
                          Jacob Brauer
                          Director, Software Development
                          NextGen Healthcare

                          sigpic

                          Comment


                          • #14
                            > A temp file copy of the WSDL is saved and used during sending
                            > when there is authentication involved.

                            I'm guessing the cached WSDL is generated when you press "Get Operations". I'm doing that with the file: URL because I can't get the https: URL to work. But even the file: URL doesn't work if authentication is turned on.
                            So *after* I get the WSDL I have to change the URL *and* put in the authentication information. But that information no longer matches what's in the cache.

                            Which makes sense ... unfortunately it would seem to indicate I'm at a dead end.

                            Comment


                            • #15
                              Maybe this is a dumb question, but Do you have to be running a webserver in order to use the Mirth web services listener?
                              I've setup a web services listener, when I put the url in a web browser, i get:
                              "Web Services"
                              "No JAX-WS context information available"
                              cmc

                              Comment

                              Working...
                              X