dcsimg
Sending Document object as a attachment
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mohan_sambre
Posted On:   Wednesday, June 5, 2002 12:07 AM

Hi i am new to SOAP. i am using jaxm to send the document as a attachment. my code is like this SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); AttachmentPart ap_return = msg.createAttachmentPart(); ap_return.setContent(docXSD,"text/xml"); msg.addAttachmentPart(ap_return); if (msg.saveRequired()) msg.saveChanges(); where msg is SOAPMessage object and docXSD is a document representaion after parsing the xml string. i am getting the error like this java.lang.ClassCastException: org.apache.xerces.dom.DeferredDocumentImpl at com.sun.xml.messaging.soap.XmlDataContentHandle   More>>

Hi i am new to SOAP.
i am using jaxm to send the document as a attachment.
my code is like this


			

SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();

AttachmentPart ap_return = msg.createAttachmentPart();

ap_return.setContent(docXSD,"text/xml");

msg.addAttachmentPart(ap_return);

if (msg.saveRequired())

msg.saveChanges();


where msg is SOAPMessage object and docXSD is a document representaion after parsing the xml string.


i am getting the error like this

java.lang.ClassCastException:
org.apache.xerces.dom.DeferredDocumentImpl
at com.sun.xml.messaging.soap.XmlDataContentHandler.writeTo(XmlDataContHandler.java:131)
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java9)
at javax.activation.DataHandler.writeTo(DataHandler.java:305)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1089)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:635)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233)
at com.sun.xml.messaging.soap.MessageImpl.saveChanges(MessageImpl.java:372)




can anyone throw the light???
thanks in advance
mohan    <<Less
About | Sitemap | Contact