Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-488

SOAPMessage with an attachment using SAAJ

XMLWordPrintable

      I'm deploying an application on Jboss 4.0.3. This application constructs a SOAPMessage with an attachment using SAAJ api. The message seems to be correct, but when I do a

      SOAPConnection.call(SOAPMessage, url)

      I get the following error:

      FATAL [org.jboss.axis.Message] InvocationTargetException:
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at org.jboss.axis.Message.setup(Message.java:333)
      at org.jboss.axis.Message.(Message.java:212)
      at org.jboss.axis.client.Call.invoke(Call.java:2054)
      at org.jboss.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:125)

      ....
      ....
      Caused by: java.lang.ClassCastException: org.jboss.axis.message.SOAPEnvelopeAxisImpl
      at org.jboss.axis.attachments.AttachmentsImpl.(AttachmentsImpl.java:134)
      ... 93 more

      I noticed that there is no error If I send the message without any attachment:

      AttachmentPart att = message.createAttachmentPart(
      mimeMultipart, mimeMultipart.getContentType());
      att.setContentId("multipart-content-id");

      soapMessage.addAttachmentPart(att);

      Previously I had deployed this application on Jboss 4.0.1 and everything worked fine

              tdiesler@redhat.com Thomas Diesler
              tdiesler@redhat.com Thomas Diesler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: