Unable to include SOAP Attachment in SOAP request

Posted by lyndon.r.javier on 02-Oct-2012 11:20

Hi,

Good Day, I have a question regarding SOAP attachment.

Here is the Summary of my Sonic ESB Process

1. SOAP UI (Call Exposed WS, request with attachment in GZIP)
          1.1 Submit Request

2. Sonic Connect Service (Exposed WS, MTOM enabled, Invoked by the SOAP UI Client)

          2.1 Received the request from SOAP UI request

          2.2 Decompress the request attachment in GZIP and transfromed into another XML structure

          2.3 Compress the transformed XML in GZIP and put to part[attachment]

          2.4 Create a request message and put to part[request]

               Sample request and attachment parts:

               Content-ID: request (Message Part)

                    <?xml version="1.0" encoding="UTF-8"?>

                         <main>

                                 <parent1>

                                        <child1>AAAAA</child1>

                                        <child2>BBBBB</child2>

                                 </parent1>

                                 <parent2>

                                                <inc:Include href="cid:attachment"
                                                        xmlns:inc="http://www.w3.org/2004/08/xop/include"/>

                                 </parent2>

                         </main>

               Content-ID: attachment (Message Part)

                         [B@15c1fb7  ------->> compressed attachment

              

3. Sonic Connect Client (Call External Web Service to submit request, MTOM Enabled)

          3.1 Invoke Extenal Web Service and submit request with attachment

4. Sonic Connect Service (For testing purposes only, act as the external Web Service, MTOM Enabled)

         4.1 Received the request but it only received the part[request] but the attachment is not.

Why the part[attachment] is not included in the request that received by the External Web Service?

What is the proper way to include the part[attachment] to the part[request]?

Thank you in advance.

All Replies

Posted by wtam on 02-Oct-2012 15:08

Hi Lyndon,

You can enable "Scan Message Parts" as Policy for Attachement Detection in the wizard during the creation of SC serivice.  Or, you can set the "detectAttachmentReferences" property in the SC Editor of an existing SC service. Please see the attached screen shots.


Thanks.

Posted by lyndon.r.javier on 02-Oct-2012 17:35

Hi William,

Thanks for your Reply.

We already put the "Scan Message Parts = SCAN_MESSAGE_PARTS", but the same output to the receiveing Web Service. The "request" part is the only available in the Test External Web Service the "attachment" part/content is missing.

Posted by wtam on 02-Oct-2012 17:53

Did you put SCAN_MESSAGE_PARTS in your test (receiving) external SC service?

Posted by lyndon.r.javier on 02-Oct-2012 18:04

Yes William, All of the Sonic Web Service we created has the SCAN_MESSAGE_PARTS configuration. Thanks.

Posted by wtam on 02-Oct-2012 18:37

Please try disabling all ESB Process Tracing in Work Bench (if you have it enabled).

Posted by lyndon.r.javier on 03-Oct-2012 09:24

Hi William,

I did disabled the tracking for Processess and Message Listeners, and add some steps to the Test External Service to check in the log file if the receiving service will process the ESB request, unfortunately the issue is still there. Please check the excerpt of the Log File I got.

Log:

INFO: Outbound Message
---------------------------
ID: 6
Address: https://localhost:8080/TestExternalService/ws
Encoding: UTF-8
Content-Type: text/xml
Headers: {connection=[Keep-Alive], MIME-Version=[1.0], Host=[localhost:8080], SOAPAction=[""], User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)], attachment=[attachment], asyncReplyForDestinaton=[esbProcess:PROCESS], Accept=[*/*]}
Payload: http://schemas.xmlsoap.org/soap/envelope/"> version="1.0" encoding="UTF-8"?>AAAAABBBBBhttp://www.w3.org/2004/08/xop/include"/>>
--------------------------------------
Oct 3, 2012 7:56:47 AM com.progress.sonic.esb.service.connect.security.interceptor.SonicConnectSecurityInInterceptor addPropsToEsbContext
INFO: Service Connect Security Context properties : {HTTPBasicAuth=null, PrincipalName=localhost, TLSX509SubjectFirstCN=localhost, HTTPDigestAuth=null, TLSX509SubjectDN=C=US,ST=State,L=City,O=SPP,OU=Test,CN=localhost, AIPropagatedID=null, AIPropagatedIDLong=null, PrincipalSource=TLSX509SubjectFirstCN}
[12/10/03 07:56:47] ID=dev_ESBTest (info) [test.XmlTransformationServiceInstance] Processing incoming message - MODIFIED
[12/10/03 07:56:47] ID=dev_ESBTest (severe) [Dispatch] Exception calling service test.XmlTransformationServiceInstance: message rejected
[12/10/03 07:56:47] ID=dev_ESBTest (severe) Trace follows...
com.sonicsw.xq.XQServiceException: Unable to get message part 'attachment' (Failed to get part.  No part with content id attachment) (Failed to get part.  No part with content id attachment)

..

..

Caused by: com.sonicsw.xq.XQMessageException: Failed to get part.  No part with content id attachment
at com.sonicsw.xqimpl.envelope.XQMessageImpl.getPart(XQMessageImpl.java:675)

Posted by wtam on 03-Oct-2012 11:57

Any chance you can share a simple project that reproduces it?  So, I can take a look.  Please indicate what version of Sonic are our running.

Thanks.

Posted by lyndon.r.javier on 03-Oct-2012 12:14

Hi William,

We got it now our service now working as what we expected.

We changed the "detectAttachmentReferences=SCAN_MESSAGE_PARTS" by deleting the previous one and create a new Sonic Connect Service with MTOM Enabled and Scan Message Parts Enabled.

Note: The Scan Message Parts wont work by just changing it from "false" to "SCAN_MESSAGE_PARTS", we need to delete the SC Service and recreate a new one with MTOM Enabled and Scan Message Parts Enabled to make the whole properties of the MTOM be enabled.

We appreciate your help in resolving the issue. Thank you very much.

This thread is closed