Hi,

I am trying to modify the message example in soap 2.2. I added a attachment 
& trying to get the content of the attachment on soap server. In the client 
I added a mimebodypart to the message as follows:

       FileInputStream fin = new FileInputStream(new
                                             File   "attach.txt"));
        MimeBodyPart attachment = new MimeBodyPart (fin);
        attachment.setHeader (" Name ", " Pump ");
        msg.addBodyPart(attachment);

In the server I tried to get the content of the message but I am only 
getting the content of bodypart 0 which is the soap envolope. Also the 
header is null. But the number of parts are 2. It means attachment did came 
through. What am I doing wrong??????

//SOAP server
   for (int i=0;i<reqCtx.getCount();i++) {
        MimeBodyPart bp = reqCtx.getBodyPart(i);
        //Get the header with "--" seperator
        System.out.println("The header is " + bp.getHeader("--"));
            String content = (bp.getContent()).toString();
            System.out.println("The content is " + content);
        }

Thanks

Sushi

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Reply via email to