Error 415 when sending a zipped SOAP message ( SWA - SOAP with Attachments) using apache Camel

Asked

Viewed 19 times

0

I am doing an integration. Using Soapui worked perfectly. but when it came to java the problem of "415" occurred. In Soapui in the Attachment part I put an option called"Part" and in it a specific code that is inside the xml "Cid". But I can’t do that in Apache Camel and I believe that’s the reason for the mistake. I’ll put excerpts of the code to make it easier to understand.

     XML DE ENVIO
    (... coisas que vem antes..)
                <ProcessCode>10005</ProcessCode>
                <MessageType>100</MessageType>
                <ExchangePattern>7</ExchangePattern>
                <SourceId>1</SourceId>
                <EnterpriseId>XXXXXXXXX</EnterpriseId>
                <Token>XXXXXXXXXXXX</Token>
                <ContentType>text/xml</ContentType>
                <ContentEncoding>utf-8</ContentEncoding>
            </CrossTalk_Header>
        </CrossTalk_Message>
        ]]>
    </exc:crosstalkMessage>
    <exc:message>cid:29617931228</exc:message>
</exc:CompressedSend>

Using the Soapui tool I can put the zip file I want and in it using the "part" property I put this code that comes marked with the "Cid" (follows the image)

resultado sucesso ao usar o SoapUi

If I remove this code "255..." from the "Part" option I receive instead of the success message the error message 415. This same message I’m getting on apache Camel using java. I still haven’t figured out a way to put this Cid in the Attachment of exchange in Camel. Here’s a snippet of the code.

from("direct:Sendzip").process({
                    Exchange exchange ->
                        File cteZip = new File("(path......)/teste123.zip")
                        exchange.in.setBody(primeiraBuscaXml)
                        exchange.in.setHeader(config.getSoapActionHeader(),config.getSoapActionHeaderValue())
                        exchange.in.addAttachment('29617931228',new DataHandler(new FileDataSource(cteZip)))
                }).to(cxfEndpoint)

I did not find a place where to put this "Cid". I even tried to put the code there but in fact it still worked.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.