How to send information & file in Java web service on Weblogic?


XML & Web services: How to send information & file in Java web service on Weblogic?

  1. Hi, I'm quite new to web services, so I'm not sure which approach I should use for the above mentioned requirement. What I need to do is to send some information about a document (author, version, date created, etc.) together with the document itself through a java web service running on Weblogic using SOAP messaging. So far I have tried using the DataHandler class to send the document as a SOAP attachment and I have tried to send the document information as a custom type (return type of web service is a Java class Object with various parameter eg. docProfile with attributes author, version, date) through SOAP (document-wrapped style). They both work fine on their own. But I have no idea how to send both the document and the document information together in a SOAP message. Can someone enlighten me? Using BEA Weblogic workshop 8.14 Thanks!
  2. I guess you are asking about soap messages with attachments : SOAPMessage message = messageFactory.createMessage(); // Get the SOAP part and set its content to domSource SOAPPart soapPart = message.getSOAPPart(); soapPart.setContent(domSource); SOAPBody body = message.getSOAPBody(); SOAPBodyElement docElement = body.addDocument(document); This link below may help : Bhagvan K