Announcement

Collapse

NextGen Connect 3.10.1 Released!

NextGen (Mirth) Connect 3.10.1 is now available as an appliance update and on our GitHub page. This release contains bug fixes. See the release notes for the list of fixes.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

creating a base64binary to send to SOAP method

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

  • creating a base64binary to send to SOAP method

    I am using Mirth 1.5 and am trying to build a channel from file reader to SOAP Sender.

    The method in the SOAP sender requires the hl7 message as a base64binary as the input. So I've used the following as a mapperby the name order and set the

    FileUtil.encode(messageObject.getRawData()); and set the value of the feild to ${order}

    On trying to deploy the channel, it fails deploying with the following error:

    org.mule.config.ConfigurationException: Failed to parse configuration resource "C:\\Program Files\\Mirth\\conf\\mule-config.xml" (org.mule.config.ConfigurationException)
    at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:196)
    at com.webreach.mirth.server.Mirth.startMule(Mirth.ja va:178)
    at com.webreach.mirth.server.Mirth.restartMule(Mirth. java:160)
    at com.webreach.mirth.server.Mirth.run(Mirth.java:115 )
    Caused by: org.mule.config.ConfigurationException: Failed to parse configuration resource "C:\\Program Files\\Mirth\\conf\\mule-config.xml"
    at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:12 1)
    at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:202)
    at org.mule.config.builders.MuleXmlConfigurationBuild er.configure(MuleXmlConfigurationBuilder.java:194)
    ... 3 more
    Caused by: org.mule.umo.lifecycle.InitialisationException: Initialisation Failure: missing ) after argument list (d55a0ffc-ac2e-4eae-9748-04e8a0e3157d#3)
    at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2919)
    at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2945)
    at org.apache.commons.digester.Digester.endElement(Di gester.java:1133)
    at org.apache.xerces.parsers.AbstractSAXParser.endEle ment(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digeste r.java:1685)
    at org.mule.config.builders.AbstractDigesterConfigura tion.process(AbstractDigesterConfiguration.java:11 9)
    ... 5 more

    {}

    any suggesstions

    Post edited by: anna, at: 06/06/2007 00:13

    Post edited by: anna, at: 06/07/2007 00:06

  • #2
    Re:creating a base64binary to send to SOAP method

    Managed to deploy the channel but I get the following error:

    ERROR-410: SOAP Connector error
    ERROR MESSAGE: Error invoking WebService
    AxisFault
    faultCode: {http://xml.apache.org/axis/}HTTP
    faultSubcode:
    faultString: (401)Authorization Required
    faultActor:
    faultNode:
    faultDetail:
    {}:return code: 401
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN">
    <HTML>
    <HEAD>
    <TITLE>Error 401--Unauthorized</TITLE>
    <META NAME="GENERATOR" CONTENT="WebLogic Server">
    </HEAD>
    <BODY bgcolor="white">
    <FONT FACE=Helvetica><BR CLEAR=all>
    <TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all>
    <FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 401--Unauthorized</H2>
    </FONT></TD></TR>
    </TABLE>
    <TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3>
    </FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.4.2 401 Unauthorized</H4>
    </FONT><P><FONT FACE="Courier New">The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include relevant diagnostic information. HTTP access authentication is explained in section 11.</FONT></P>
    </FONT></TD></TR>
    </TABLE>

    </BODY>
    </HTML>

    {http://xml.apache.org/axis/}HttpErrorCode:401

    (401)Authorization Required
    at org.apache.axis.transport.http.HTTPSender.readFrom Socket(HTTPSender.java:744)
    at org.apache.axis.transport.http.HTTPSender.invoke(H TTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visi t(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain .java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.jav a:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClien t.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java :2765)
    at org.apache.axis.client.Call.invoke(Call.java:2748)
    at org.apache.axis.client.Call.invoke(Call.java:1862)
    at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.invokeWebService(AxisMessag eDispatcher.java:225)
    at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.doSend(AxisMessageDispatche r.java:254)
    at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
    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:89)
    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:161)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:183)
    at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:111)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Unknown Source)

    How do I pass the username and password to authorize the message sending?

    Comment


    • #3
      Re:creating a base64binary to send to SOAP method

      The WS is working fine.

      The problem is realted to the Auth scheme.

      The WS you're invoking has a WS-Security Policy defined. Mirth can handle some basic WS-Security situations.

      Contact with the WS provider, and ask for the security implementation.

      Comment


      • #4
        Re:creating a base64binary to send to SOAP method

        I do have a username and password to connect to their Server, but how do I add it to the channel I've configured? Do I have to add the login details into the SOAP envilope?

        Comment


        • #5
          Re:creating a base64binary to send to SOAP method

          It can be done using special SOAP headers.

          For example, to add a user/pass you need to add:

          <wsse:UsernameToken>
          <wsse:Username>Username</wsse:Username>
          <wsse:Password Type="wsse:PasswordText">ThePassword</wsse:Password>
          </wsse:UsernameToken>

          You can search the full SOAP headers in google.

          Comment


          • #6
            Re:creating a base64binary to send to SOAP method

            Thank you albertosaez for your input.

            Have changed the SOAP envelope to

            <?xml version="1.0" encoding="utf-16"?>
            <soap:Envelope
            xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
            xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/xx/secext"
            xmlns:a="http://soap.example.org/authentication/2001/01/"
            xmlns:b="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <soap:Header>
            <wsse:Security>
            <wsse:UsernameToken >
            <wsse:Username> usr </wsse:Username>
            <wsse:Password> pwd </wsse:Password>
            </wsse:UsernameToken>
            </wsse:Security>
            </soap:Header>
            <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <submitOrder xmlns="http://medplus.com/orders">
            <order xmlns="java:com.medplus.serviceHub.orders.webservi ce">
            <hl7Order>${encoder.encode(${message.rawData})}</hl7Order>
            </order>
            </submitOrder>
            </soap:Body>
            </soap:Envelope>

            before that I had tried it with the following SOAP Envelope

            <?xml version="1.0" encoding="utf-16"?>
            <soap:Envelope
            xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
            xmlns:a="http://soap.example.org/authentication/2001/01/"
            xmlns:b="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <soap:Header>
            <a:Authentication>
            <Username>usr</Username>
            <Password>pwd</Password>
            </a:Authentication>
            </soap:Header>
            <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <submitOrder xmlns="http://medplus.com/orders">
            <order xmlns="java:com.medplus.serviceHub.orders.webservi ce">
            <hl7Order>${encoder.encode(${message.rawData})}</hl7Order>
            </order>
            </submitOrder>
            </soap:Body>
            </soap:Envelope>

            Either way I get the same error:

            ERROR-410: SOAP Connector error
            ERROR MESSAGE: Error invoking WebService
            AxisFault
            faultCode: {http://xml.apache.org/axis/}HTTP
            faultSubcode:
            faultString: (401)Authorization Required
            faultActor:
            faultNode:
            faultDetail:
            {}:return code: 401
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Draft//EN">
            <HTML>
            <HEAD>
            <TITLE>Error 401--Unauthorized</TITLE>
            <META NAME="GENERATOR" CONTENT="WebLogic Server">
            </HEAD>
            <BODY bgcolor="white">
            <FONT FACE=Helvetica><BR CLEAR=all>
            <TABLE border=0 cellspacing=5><TR><TD><BR CLEAR=all>
            <FONT FACE="Helvetica" COLOR="black" SIZE="3"><H2>Error 401--Unauthorized</H2>
            </FONT></TD></TR>
            </TABLE>
            <TABLE border=0 width=100% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Courier New"><FONT FACE="Helvetica" SIZE="3"><H3>From RFC 2068 <i>Hypertext Transfer Protocol -- HTTP/1.1</i>:</H3>
            </FONT><FONT FACE="Helvetica" SIZE="3"><H4>10.4.2 401 Unauthorized</H4>
            </FONT><P><FONT FACE="Courier New">The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity MAY include relevant diagnostic information. HTTP access authentication is explained in section 11.</FONT></P>
            </FONT></TD></TR>
            </TABLE>

            </BODY>
            </HTML>

            {http://xml.apache.org/axis/}HttpErrorCode:401

            (401)Authorization Required
            at org.apache.axis.transport.http.HTTPSender.readFrom Socket(HTTPSender.java:744)
            at org.apache.axis.transport.http.HTTPSender.invoke(H TTPSender.java:144)
            at org.apache.axis.strategies.InvocationStrategy.visi t(InvocationStrategy.java:32)
            at org.apache.axis.SimpleChain.doVisiting(SimpleChain .java:118)
            at org.apache.axis.SimpleChain.invoke(SimpleChain.jav a:83)
            at org.apache.axis.client.AxisClient.invoke(AxisClien t.java:165)
            at org.apache.axis.client.Call.invokeEngine(Call.java :2765)
            at org.apache.axis.client.Call.invoke(Call.java:2748)
            at org.apache.axis.client.Call.invoke(Call.java:1862)
            at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.invokeWebService(AxisMessag eDispatcher.java:225)
            at com.webreach.mirth.server.mule.providers.soap.axis .AxisMessageDispatcher.doSend(AxisMessageDispatche r.java:254)
            at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:166)
            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:89)
            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:161)
            at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:128)
            at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
            at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
            at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
            at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.processFile(FileMessageReceiver.ja va:183)
            at com.webreach.mirth.server.mule.providers.file.File MessageReceiver.poll(FileMessageReceiver.java:111)
            at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
            at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
            at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
            at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
            at java.lang.Thread.run(Unknown Source)



            any suggestions?

            Post edited by: anna, at: 06/12/2007 01:41

            Comment


            • #7
              Re:creating a base64binary to send to SOAP method

              As per what I have lately learnt sending user/pass in plain text inside the SOAP message will not work. I will need to do HTTPS Authentication on the POST. How can this be done through Mirth?

              Comment

              Working...
              X