Announcement

Collapse
No announcement yet.

Send MIME multipart message over HTTP

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

  • Send MIME multipart message over HTTP

    I have a problem sending
    a MIME multipart/related message over HTTP POST

    the message is something like this:

    ---------------
    POST /axis2/services/repositoryAonedoc HTTP/1.1
    Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611 98809912936; type="text/xml"; start="0.urn:uuid:[email protected] apache.org"
    SOAPAction: "SubmitObjectsRequest"
    User-Agent: Axis2
    Host: localhost:9087

    --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36
    Content-Type: text/xml; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Content-ID: <0.urn:uuid:[email protected] .org>

    <?xml version='1.0' encoding='UTF-8'?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <SubmitObjectsRequest ...
    ...
    </SubmitObjectsRequest>
    </soapenv:Body>
    </soapenv:Envelope>


    --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36
    Content-Type: text/plain
    Content-Transfer-Encoding: binary
    Content-ID: <Document01>

    < a text Document>

    --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36--
    ----------------

    I have configured the destination channel like this:

    Connector Type=HttpSender

    Header variables:
    SOAPAction="SubmitObjectsRequest"

    Content-Type=multipart/related; boundary=MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611 98809912936; type="text/xml"; start="0.urn:uuid:[email protected] apache.org"

    Request variables:
    $payload=--MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36
    Content-Type: text/xml; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Content-ID: <0.urn:uuid:[email protected] .org>
    ...

    --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36
    ...
    --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36--


    but it doesn't works
    someone can help me?


    thanks
    Stefano

  • #2
    Re:Send MIME multipart message over HTTP

    Why don't you use a SOAP Sender

    Comment


    • #3
      Re:Send MIME multipart message over HTTP

      I tried to use a SOAP Sender
      but where I put the Mime multipart??
      I think that the SOAP Envelope Textfield needs an XML File and not a multipart

      I tried this:

      SopaActioUri=urn:SubmitObjectsRequest
      Method=SubmitObjectsRequest
      Soap Envelope=
      --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36
      Content-Type: text/xml; charset=UTF-8
      Content-Transfer-Encoding: 8bit
      Content-ID: <0.urn:uuid:[email protected] .org>

      <?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <SubmitObjectsRequest ...>
      ...
      </SubmitObjectsRequest>
      </soapenv:Body>
      </soapenv:Envelope>
      --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36
      Content-Type: text/plain
      Content-Transfer-Encoding: binary
      Content-ID: <Document01>

      <the text document>

      --MIMEBoundaryurn_uuid_181AA8ECA16E16E2D611988099129 36--


      But I get this error from the WebServer:

      ERROR-410: SOAP Connector error
      ERROR MESSAGE: Error invoking WebService
      AxisFault
      faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
      faultSubcode:
      faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog.
      faultActor:
      faultNode:
      faultDetail:
      {http://xml.apache.org/axis/}stackTracerg.xml.sax.SAXParseException: Content is not allowed in prolog.
      at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
      at org.apache.xerces.util.ErrorHandlerWrapper.fatalEr ror(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
      at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
      at org.apache.xerces.impl.XMLScanner.reportFatalError (Unknown Source)
      at org.apache.xerces.impl.XMLDocumentScannerImpl$Prol ogDispatcher.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.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
      at org.apache.axis.encoding.DeserializationContext.pa rse(DeserializationContext.java:227)
      at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:696)
      at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:435)
      at org.apache.axis.client.Call.invoke(Call.java:2698)
      at org.apache.axis.client.Call.invoke(Call.java:1870)
      at com.webreach.mirth.connectors.soap.axis.AxisMessag eDispatcher.invokeWebService(AxisMessageDispatcher .java:261)
      at com.webreach.mirth.connectors.soap.axis.AxisMessag eDispatcher.doSend(AxisMessageDispatcher.java:295)
      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.connectors.file.FileMessageRece iver.processFile(FileMessageReceiver.java:208)
      at com.webreach.mirth.connectors.file.FileMessageRece iver.poll(FileMessageReceiver.java:130)
      at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:118)
      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)
      ....

      Comment


      • #4
        Re:Send MIME multipart message over HTTP

        I'm no expert. Actually just arriving on the merry Mirth scene in the last 2 weeks.
        No expert in SOAP either.

        But the SAX error looks like you have XML content in the document --- so you might have to include the payload document as CDATA,... or simply XML-entity-escape the document e.g., turn all < to &lt; and & to &amp;

        And then you could use the SOAP Sender,... I think.

        -m

        Comment

        Working...
        X