Thilina,

 

Thank you for the information.

 

When you say to use "messagecontext.getAttachments()", I assume you mean
"messagecontext.getAttachmentMap()"?  I don't see the method
"getAttachments".

 

I added the following to the stub (I tried this in various places).  The
"contentIDs" array comes back empty as if there are no attachments.  Is
there a certain place I need to add this?  Am I doing it wrong?

 

                String[] contentIDs =
_messageContext.getAttachmentMap().getAllContentIDs();

 

Also, when stepping through the debugger I see that the size of the
attachmentsMap (in messageContext) is 0.  Again, it seems that Axis2 is not
recognizing the attachment.

 

I set up a TCP Tunnel and here is what I see for the SOAP message:

 

------------------------------------------------------

 

HTTP/1.1 200 OK

Server: Systinet Server for C++ 6.5
(SSC-6.5-2005-12-01-2103-i386-win32msvc71) - Microsoft Windows XP Service
Pack 2 (Build 2600))

MIME-Version: 1.0

Content-Type: multipart/related;
boundary="xxx-WASP-CPP-MIME-Boundary-xxx-02A9D668-02a9d668-xxx-END-xxx";
type="text/xml"

Connection: Keep-Alive

Transfer-Encoding: chunked

 

00000544

 

--xxx-WASP-CPP-MIME-Boundary-xxx-02A9D668-02a9d668-xxx-END-xxx

Content-Type: text/xml; charset=UTF-8

Content-Transfer-Encoding: binary

 

<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><SOAP-ENV:Body
xmlns:s0="http://mvdoc.metafile.com/";
xmlns:s1="http://www.w3.org/2001/XMLSchema";><s0:GetDocumentPageAsMIME2Respon
se><s0:response
xsi:type="s0:DocumentPage2"><s0:AvailableFormatList>image/x-emf,text/plain,a
pplication/pdf,image/bmp,image/tiff,image/jpeg,image/png</s0:AvailableFormat
List><s0:CanAnnotate>1</s0:CanAnnotate><s0:DocumentId>MzZ-PFA-PC9QPn4wMDBkNT
YzYjVjYjY4Nzk4MTFkOGNhYTFlYzI1NzlhMH5ZQVRFMDAwMH4*</s0:DocumentId><s0:Docume
ntName>COLD Pick
List</s0:DocumentName><s0:HasOptionalAnnotations>0</s0:HasOptionalAnnotation
s><s0:HitPageNumber>0</s0:HitPageNumber><s0:HitWordCount>0</s0:HitWordCount>
<s0:NativeMimeType>image/x-emf</s0:NativeMimeType><s0:PageInfo
xsi:type="s0:SourceInfo"><s0:FileName
xsi:nil="1"/><s0:FileNameExtension>.pdf</s0:FileNameExtension><s0:IncludesOv
erlay>0</s0:IncludesOverlay><s0:MimeType>application/pdf</s0:MimeType><s0:So
urceStream/></s0:PageInfo><s0:PageNumber>1</s0:PageNumber><s0:UniqueId>000d5
63b5cb6879811d8caa1ec2579a0</s0:UniqueId></s0:response></s0:GetDocumentPageA
sMIME2Response></SOAP-ENV:Body></SOAP-ENV:Envelope>

3F1A

 

--xxx-WASP-CPP-MIME-Boundary-xxx-02A9D668-02a9d668-xxx-END-xxx

Content-Location: uuid:1f9943f0-fe0a-137a-b175-000d56ad9e03

Content-Type: application/binary

Content-Transfer-Encoding: binary

 

%PDF-1.31 0 obj<< /Producer (Metafile Information Systems, Inc.)/Creator
(MFILIB Image Library)/CreationDate (Mon Jul 07 08:47:50 2008)>> endobj2 0
obj<< /Type /Catalog /Pages 3 0 R >> endobj3 0 obj<< /Type /Pages /Count 1
/Kids [ 6 0 R ] >> endobj4 0 obj<< /Type /XObject /Subtype /Image /Name
/Im00000001 /Filter /DCTDecode /Width 3000 /Height 2402 /BitsPerComponent 8
/ColorSpace /DeviceRGB /DecodeParms << /K -1 /Columns 3000 >> /Length 5 0 R
>> stream

[...BINARY CONTENTS REMOVED BY SCOTT W...]

9/Info 1 0 R /Root 2 0 R >>startxref416685%%EOF

--xxx-WASP-CPP-MIME-Boundary-xxx-02A9D668-02a9d668-xxx-END-xxx--

 

0

 

------------------------------------------------------

 

I'm not sure if I can post my WSDL, but I can look into running a trace if
that would help.

 

Thanks,

 

Scott

 

From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 02, 2008 1:24 AM
To: [email protected]; [EMAIL PROTECTED]
Subject: Re: ADB and MIME attachments

 

Hi,
ADB supports MTOM only.. ADB will help if the wsdl specifies the attachments
as base64binary elements.. 

If the attachment is SwA (implies by your post), then you would need to use
Axis2 lower level API's such as OperationClient to obtain the attachments.
You may be able to access them by modifying the stub's, if you can access
the incoming messagecontext by doing so.. You can access the attachments
using messagecontext.getAttachments() when you have a pointer to the
incoming message context..

Posting of the message traces and the wsdl  would help us to figure out the
issue more clearly..

thanks,
Thilina

On Tue, Jul 1, 2008 at 2:44 PM, Scott Waldner <[EMAIL PROTECTED]> wrote:

I am writing a client connecting to a web service containing operations that
return MIME attachments.  I have no control over this web service -- I am
simply trying to consume it (hence I cannot change it to use MTOM).  I have
been connecting to the web service and consuming these MIME attachments
using Axis 1, so I know that the web service is functioning correctly.

 

I would now like to upgrade to Axis2 1.4.  I have generated ADB client
bindings using wsdl2java.  However, I have been unsuccessful in retrieving
these MIME attachments.

 

1) Does anyone have an example of retrieving MIME attachments while using
ADB?

 

2) Can anyone offer any advice on how best to go about this as every attempt
I've made has been unsuccessful?  I've been modifying the generated stubs
just to see if I could get the attachment and while I see the attachment
coming across the wire (using a TCP tunnel), I'm not sure that Axis2 is
recognizing the MIME attachment.  I can't find any references to it as I
step through the debugger.

 

Any advise would be greatly appreciated.

 

Thanks,

 

Scott




-- 
Thilina Gunarathne - http://thilinag.blogspot.com 

Reply via email to