Problem in webservice with Attachments

Hi,
   I am having a simple java class with create attachment method.That method takes the byte array as argument and writes that file to the hard disk.I am exposing this method as a
webservice,so that that webservice is used as external service in Application service.In the NW Studio there is no option to make transport type as "SOAP with attachments".Is it the right way to use byte array  in webservices.Is there any other way such as XOP,MTOM ..Can anybody help me out on this regard.
Thanks,
sudhir

Hi please check the link below.
https://app.primecontract.com/ua/webhelp/webwfp/wf_attachments_bg.html
http://www.uiowa.edu/hr/imfo/workflow/attachment.pdf
Murthy.

Similar Messages

  • Problem sending mail with attachments???

    Hi Everybody,
    I have got a problem sending mail with attachments...
    I am able to send a plain mail ... but when i am trying to send mail along with an attachment ... its not being sent....
    its not showing any error it is simply hanging...
    what should i do?
    If u know any solns please do suggest me....
    Thanks in advance

    activation.jar is already there...
    initially i wrote a swing program as a front end and it was working abs fine... in my sense it was properly sending mails along with the attachments...
    when i changed the front-end to JSP handled by Servlets i am getting a problem...
    and even the swing program stopped working ...
    now swing program is getting compiled but it is hanging at run time showing an exception "Exception occured during event dispatching"
    i dont understand what probably may be the problem...
    if u can trace out, please give me any suggestions
    Thanks in advance and regards

  • Problems sending email with attachments

    This is a long story.  We use a satellite connection at home and in our motorhome most of the time.  We use our air card (USB 760) for special needs and when we are travelling without our motorhome.
    The past two weekends I have had to use the aircard.  During that use I prepared some email with various sized attachments (max 1.2 meg).  On the first weekend the email with attachments would not send (Eudora/POP3/Godaddy).  Then I tried a different ISP I have to use for a special assignment (Eudora/POP3/Bellweather.net) and it went through. 
    When I got back to the house, I contacted Godaddy and they did not find anything in their system that would cause a problem.  During the testing with them, the email with attachments went through just fine (on satellite).  I laid it off to a Godaddy problem.
    This past weekend, I prepared another email with a small attachment and it would not send via either ISP.  Then I connected to the motel wireless and it went just fine via Godaddy.
    So, all of the testing points to a problem with my Verizon connection.  I have checked and I have the latest software.  The Verizon tech folks have evelated it to see if they can figure out what is going on.
    Anyone else have the same problem?  Any thoughts on what the problem might be?
    Jim Shepherd
    three zero three 478 thirty five zero one.

    Message attachments are allowed in Hosted VZEmail Services using your USB 760 air card. However, to enhance security some attachment types will be blocked and cannot be sent.
    The blocked attachment types include, but are not limited to, the following:
    .exe
    .bat
    .pif
    .msi
    .vbs
    .com 
    Thank you, LatachaM_VZW

  • Problem mx:WebService with ActionWebService

    I have been using Flex Builder 3 for pretty often in my work.
    Last week new Flex Builder 3 beta 3 came up, I installed new
    Flex Builder 3 beta3.
    This program was usually working on Flex Builder 3 beta2,
    after I upgrade to beta3 to re-compile exact same program,
    doesn't receive any values any more.
    I believe this is bug on mx:WebService.
    This is SOAP response example.
    <?xml version="1.0" encoding="UTF-8" ?>
    <env:Envelope xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns:env="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance">
    <env:Body>
    <n1:SayHelloResponse xmlns:n1="urn:ActionWebService"
    env:encodingStyle="
    http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="n1:MyStruct">
    <rslt xsi:type="xsd:string">Hello, aaa</rslt>
    </return>
    </n1:SayHelloResponse>
    </env:Body>
    </env:Envelope>
    Server side program is create by Ruby on Rails,using
    ActionWebService. This program is sending SOAP response that
    contains a struct. But,in Flex builder 3 beta 3's mx:WebService
    event.result doesn't receive any data. It seems recognize and
    events are happening, but inside value is always come up with
    "null".
    Thank you.

    The best way to get help with WebService issues is to log a
    bug in JIRA against the Flex SDK:
    http://bugs.adobe.com/flex/
    When logging WebService issues, be sure to include the WSDL,
    any schema imports, a snippet of how the request is being made if
    there's a problem encoding the SOAP request, and a capture of the
    HTTP SOAP response XML if there's a problem with decoding (as there
    appears to be in your scenario below).
    I'd check the type of your event.result first. Make sure that
    you're not casting your result with the as operator to an
    incompatible type because you'll just get null instead of a
    coercion error.

  • WebService with attachments. How?

    Hi,
    i have a WebService which send an attachment. I've generated
    the webservices classes, but i'm receive an error if i try to call
    the service
    TypeError: Error #1083: Das Präfix "0.urn" für
    Element "0.urn:uuid:[email protected]" ist
    nicht gebunden.
    is somebody knows an flex example where i can see how to do
    this? (maybe i do something wrond)
    Use flex3builder RELEASE

    Hi yevgen,
    SOAP MTOM seems not to
    be supported by flex 3. There is an "unresolved"
    entry in
    the bug database.
    Here is another
    link
    , but for flexbuilder 2!!!!!!!!!!!, which may give you some more
    infos about the support of webservice. Didn´t found a similar
    doc for flex 3.
    kcell

  • Webservice with attachments

    Hi All,
    I wanted to checkin a document as an Attachment via web service in UCM. When i run the service from the client i get an error message saying Content item 'CT_000014' was not successfully checked in. The content item must have a primary file. I read in a thred on the forum that UCM's default behavirous is send the doc as attachment. is this correct, do I need to do something else to enable this behaviour.
    many thanks,
    sapan
    Edited by: user577672 on Aug 4, 2010 2:40 PM
    PS. I have tried setting responseType and Content_type variable but i still got the same error.

    Hi,
    This is a sample SOAP request for CheckInUniversal web service:
    <?xml version='1.0' ?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
    <idc:service xmlns:idc="http://www.oracle.com/IdcService/" IdcService="CHECKIN_UNIVERSAL">
    <idc:document dDocName="SoapUpload2" dDocAuthor="sysadmin" dDocTitle="Soap Upload 2 Document" dDocType="ADACCT" dSecurityGroup="Public" dDocAccount="">
    <idc:file name="primaryFile" href="C:/stellent/custom/Soap/JavaSamples/SoapClientUpload/soaptest.doc">
    </idc:file>
    </idc:document>
    </idc:service>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    source: http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/sdk/soap/wwhelp/wwhimpl/js/html/wwhelp.htm
    Regards,
    Stoyan

  • Sending emails with attachments through outlook 2003

    Hello,
    I have recently switch from cablevison to Fios. With Cablevison, I never had a problem with email. However, now I am having problems sending emails with attachments using outlook 2003. I have called Verizon and we troubleshooted the problem and they feel this is a Microsoft problem.
    I can send email's without attachments through outlook and verizon.net, but I can't send emails with attachments through outlook, I can send them though verizon.net.  All my settings are correct for sending and receiving email.
    I called Microsoft and they say it a Verizon problem...
    HELP, does anyone have a solution?????
    Thanks
    Len628

    Which antivirus software do you run on your computer? Are there any errors posting?  Have you shut off any email firewalls temporarily to attempt to isolate your issue?  Do you have outlook 2003 on more than 1 pc in your home?  Have your tried to attach a small text file and send it to see if that goes thru successfully?
    Joe D
    Verizon Telecom
    Fiber Solution Center
    Notice: Content posted by Verizon employees is meant to be informational and does not supercede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan.Follow us on Twitter™!

  • WLS7 WebServices SOAP with attachments problem

    I have implemented a WebService in Weblogic. If I use the standard Sun
              JAXM library to invoke the service without any attachments, it works
              fine. However, if I use the standard JAXM functionality to add a gif
              image to the message, Weblogic throws an exception (attached below)
              before it even invokes the handler class for my Web Service.
              Basically, the JAXM library does not insert the "start=..." element in
              the top level "Content-Type" HTTP header field. Should Weblogic cope
              with this, or is it not designed to work with the Sun JAXM library. I
              am using the latest version of the Sun WebServices Developers Kit and,
              hence, the latest version of the JAXM library. Do BEA recommend a
              different client library be used to invoke Weblogic WebServices? If
              so which one(s) are supported?
              I have another question. Assuming I can find a client which will
              deliver to Weblogic an HTTP SOAP mesage that it considers to be valid,
              how do attachments get passed to the "component" class? I understand
              how I could iterate through the mime segments / attachments from
              within the "handler", but I don't understand how / if attachments are
              passed onto the actual component class. Reading from the FAQ:
              Q. Does WebLogic Server 7.0 support SOAP Messages with Attachments?
              A. Yes. As long as the data type of the attachment is on the list of
              supported JAX-RPC data types, then WebLogic Server will automatically
              handle parameters to Web services that are SOAP attachments. If you
              want to do further processing of the attachment, you can use handlers
              to intercept the request and response SOAP message (which includes the
              attachment.)
              I get the impression that attachments are "magically" available to
              code within the component, but I don't understand the actual mechanics
              of this.
              Any thoughts would be gratefully received.
              Cheers,
              Steve
              javax.xml.soap.SOAPException: No start attachment specified in the
              Multipart/Rel
              ated document
              at weblogic.webservice.core.soap.SOAPMessageImpl.handleMimeMessage(SOAPM
              essageImpl.java:174)
              at weblogic.webservice.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.
              java:118)
              at weblogic.webservice.core.soap.MessageFactoryImpl.createMessage(Messag
              eFactoryImpl.java:27)
              at weblogic.webservice.binding.soap.HttpServerBinding.receive(HttpServer
              Binding.java:50)
              at weblogic.webservice.core.DefaultWebService.invoke(DefaultWebService.j
              ava:216)
              at weblogic.webservice.server.servlet.ServletBase.serverSideInvoke(Servl
              etBase.java:362)
              at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke
              (WebServiceServlet.java:269)
              at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.jav
              a:346)
              at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServic
              eServlet.java:237)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
              (ServletStubImpl.java:1058)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:401)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:306)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
              n.run(WebAppServletContext.java:5412)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
              eManager.java:744)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:3086)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:2544)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
              <08-Jan-03 15:22:54 GMT> <Error> <HTTP> <101017>
              <[ServletContext(id=2655643,nam
              e=mms_service_05.war,context-path=/mms_service_05)] Root cause of
              ServletExcepti
              on
              javax.xml.soap.SOAPException: No start attachment specified in the
              Multipart/Rel
              ated document
              at weblogic.webservice.core.soap.SOAPMessageImpl.handleMimeMessage(SOAPM
              essageImpl.java:174)
              at weblogic.webservice.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.
              java:118)
              at weblogic.webservice.core.soap.MessageFactoryImpl.createMessage(Messag
              eFactoryImpl.java:27)
              at weblogic.webservice.binding.soap.HttpServerBinding.receive(HttpServer
              Binding.java:50)
              at weblogic.webservice.core.DefaultWebService.invoke(DefaultWebService.j
              ava:216)
              at weblogic.webservice.server.servlet.ServletBase.serverSideInvoke(Servl
              etBase.java:362)
              at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke
              (WebServiceServlet.java:269)
              at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.jav
              a:346)
              at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServic
              eServlet.java:237)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
              (ServletStubImpl.java:1058)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:401)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:306)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
              n.run(WebAppServletContext.java:5412)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
              eManager.java:744)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:3086)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:2544)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
              >
              

    import javax.activation.DataHandler;
    public class EchoAttachmentService implements com.bea.jws.WebService
    static final long serialVersionUID = 1L;
    * @common:operation
    * @jws:protocol form-get="false" form-post="false"
    public String echoAttachment(DataHandler dh)
    return("***Service received DataHandler of type: " + dh.getContentType());
    Error Description:
    ERROR: EchoAttachment.jws:19: Java type DataHandler is unsupported over a web
    service.
    SUGGESTION: Use a supported type such as a class with public fields, a JavaBean,
    a primitive type, String, BigInteger/BigDecimal, Calendar, GDate/GDuration, QName,
    URI, byte[], or an XMLBeans type.

  • Problem with attachments and antivirus.scanners

    Hi!
    Problem is: Sending any attachment from Tiger (10.4.8) mail, all attachments are removed by a virus scanner at receiving end:
    This message was modified by F-Secure Anti-Virus E-Mail Scanning.
    Tried Windows friendly, text only, repair permissions, sending under other isp etc. no help.
    If this same message with same attachment is send from next mac with Panther, it is received ok.
    Receiving company is big and wont alter their virus-scanners and the problem clearly lies in Tiger.
    Any help welcome.
      Mac OS X (10.4.8)  

    The subject of your message should have been "Problems with attachments and F-Secure antivirus" since this is not a problem with all antivirus software, only with F-Secure.
    Check this thread for a possible temporary solution when sending attachments to those who use F-Secure.
    http://discussions.apple.com/thread.jspa?messageID=2837384&#2837384

  • Question: Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages? - Problem: I have 1400 e-mails with attachments that need to be conv

    Is there a way to create a PDF from outlook e-mail that does not embed the attachment? better, is there a way to convert the e-mail with attachement (not embeded) as pdf pages?
    - Problem: I have 1400 e-mails with attachments that need to be converted into pdf and the attachments cannot be embeded.
    System: PC Windows 7 using Acrobat X Prof. - Thank you!

    Hi ,
    There is an option of embedding index for faster search while converting email to a PDF .
    However I am not sure that will serve your purpose or not .
    I would recommend you to get in touch with Microsoft support as well .
    Meanwhile I'll work on it and get back to you in case I get a desired solution .
    Regards
    Sukrit Dhingra

  • I'm using OS 10.6.8 and Mail 4.5. When I receive mails with attachments which are visible the save button doesn't work. Some contacts have problems opening files sent by me using Mail too. This was never a problem on pre-Intel. A real Mac **** up !

    I'm using OS 10.6.8 and Mail 4.5. When I receive mails with attachments which are visible the save button doesn't work. And some contacts occasionally have problems opening files sent by me using Mail too. This was never a problem on pre-Intel Mac. A real Mac **** up ! Any ideas ?

    Can you drag and drop the attachments visible in the email to the Desktop OK or does that fail ?
    Re the sending: Are these recipients on Mac's or PC's as the file type could be an issue, if on Mac's then try setting the Mail Preferences Composing setting to Plain Text not Rich Text and see if that improves things.

  • Jdeveloper 11g : Generating webservices with streaming attachments support

    Hi,
    We are trying to create a Java Webservice with support for streaming attachments. In 10g we are using the Attachments API from the oracle.webservices.attachments package.
    In Jdev 10g we were doing it the following way:
    public String getXMLFile(String name,String fileName,Attachments atts) throws RemoteException
    try
    AttachmentFactory factory = AttachmentFactory.newInstance();
    Attachment imageAtt = factory.createAttachment(fileName, "text/plain", new FileInputStream(fileName));
    atts.getOutgoingAttachments().addAttachment(imageAtt);
    } catch (Exception e) {
    System.out.println(e.getMessage());
    return "Hello " + name;
    This webservice is deployed in Oracle AS.
    How do we do it in Jdev 11g and we want to deploy the service in WLS 10.1.3. If we try to create a webservice over this class in Jdev 11g we get the error :"no-arg default constructor not present".
    Any pointers would be highly appreciated.
    Thanks and Regards,
    Pritom

    Hi Vishal,
    I created the class as mentioned in the link. But when I try to test the web service, I get the following error :
    weblogic.application.ModuleException: [HTTP:101216]Servlet: "oracle.apps.ddr.testFileDownload" failed to preload on startup in Web application: "Application7-Project1-context-root".
    javax.xml.ws.WebServiceException: Annotation @com.sun.xml.internal.ws.developer.StreamingAttachment(parseEagerly=true, dir=, memoryThreshold=40000) is not recognizable, atleast one constructor of class com.sun.xml.internal.ws.developer.StreamingAttachmentFeature should be marked with @FeatureConstructor
         at com.sun.xml.ws.binding.WebServiceFeatureList.getWebServiceFeatureBean(WebServiceFeatureList.java:176)
         at com.sun.xml.ws.binding.WebServiceFeatureList.parseAnnotations(WebServiceFeatureList.java:148)
         at com.sun.xml.ws.binding.WebServiceFeatureList.<init>(WebServiceFeatureList.java:113)
    Any ideas on how I can make it work ?
    Thanks and Regards,
    Pritom

  • Problem invoking document type webservices with SAAJ

    I cannot invoke document type webservices with SAAJ. No problems invoking rpc-style services. Can anyone help me to invoke doc-type webservices with SAAJ. Very urgent. Thank you.

    Siva Sankar
    You may use Field Exit to do this enhancement. You can create fieldexit from report RSMODPRF.
    In order to use field exit check/activate Profile Parameter abap/fieldexit using t code RZ11.
    Thanks & regards
    Amol Lohade

  • Problems with attachments - where is my content?

    Hi all!
    I've got a problem with my attachment in the shopping cart. We have implement a function, where the user is able to sent an email with an attachment from the shopping cart.
    If the user, who added the attachment to the shopping cart will send the email, the field PHIO_CONTENT in the table ATTACH in the shopping cart structure BBPS_SC_APP_DOCUMENT is filled an i can attach these data to the email.
    But when the shopping cart will be transfered to another user during the approval worklflow, the field PHIO_CONTENT is emtpy. All other data is already existing (like PHIO_OBJID). I've got the URL to the document too (field DISP_URL = http://sapdb01.XXX.XXXXXXX.de:8000/sap/ebp/docserver/Zellen%25252Exls?phioget&KpId=DDAB1A80829CEFF1B402001A4B4A73D6&KpClass=BBP_P_DOC&sap-client=010).
    Does anybody knows why the data (field PHIO_CONTENT) will not by stored in the shopping cart? Is it neccessay to load the file from doc-server? If so, how can I read the files from the document server?
    Thank you for help!
    Greetings, Florian

    Hello Florian,
    I have a similar assignment where I need to send e-mail with attachments from the SC. The attachemnts can be in varius formats, i.e. DOC, XLS, TXT etc.  I wonder how do you handle the attachments?  I read the attachments using  BBP_PD_SC_GETDETAIL and send e-mail using class cl_document_bcs. The content of the attachemnts are in binary format and receipient can't open them. 
    Thanks

  • Webservice for soap with attachments

    HI
    I am try to develop webservice for soap with attachments for the sending images like jpg,tiff,gif.
    it works fine when I statically attach the file
    but when i pass dynamically the file name it will give me error for the call.invoke() method
    Following is the code and the error details
    I am using eclipse wtp2.0 and using weblogic appserver 8.1 and axis-1.4
    that is my configuration details.
    // This is my service code
    import java.io.File;
    import java.io.IOException;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.mail.MessagingException;
    import javax.xml.soap.AttachmentPart;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPBodyElement;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPMessage;
    import org.apache.axis.Message;
    import org.apache.axis.MessageContext;
    import org.apache.axis.message.SOAPEnvelope;
    //import org.apache.axis.soap.MessageFactoryImpl;
    import com.sun.corba.se.spi.activation.Repository;
    public class AttachmentServer1
         SOAPMessage msg = null;
         Message response= null;
         FileDataSource fileSource;
         DataHandler dataHandler = null;
         MessageContext context = null;
              public void sendImage(String fileName) throws MessagingException, IOException{
              try {
                        //java.lang.System.setProperty("javax.xml.soap.MessageFactory","com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
                        java.lang.System.setProperty("javax.xml.soap.MessageFactory","org.apache.axis.soap.MessageFactoryImpl");
                        MessageFactory fac = MessageFactory.newInstance();
                        msg = fac.createMessage();
                        context = MessageContext.getCurrentContext();
                        response = context.getRequestMessage();
                        if(msg != null){
                             System.out.println("From inside if statement");
                             //File f = new File("D:/1.png");
                             File f = new File(fileName);
                             fileSource = new FileDataSource(f);     
                             dataHandler =new DataHandler(fileSource);
                             System.out.println("From inside if statement 1");
                             AttachmentPart part = msg.createAttachmentPart(dataHandler);
                             System.out.println("From inside if statement part");
                             //part.setContentType("image/jpeg");
                             //part.setMimeHeader("Content-Type", "image/jpg");
                             //part.setContent(dataHandler, "image/jpg");
                             SOAPPart soapPart = msg.getSOAPPart();
                             javax.xml.soap.SOAPEnvelope envelope = soapPart.getEnvelope();
                             SOAPBody body = envelope.getBody();
                             SOAPBodyElement bodyElement = body.addBodyElement(envelope.createName("attach"));
                             SOAPElement element = bodyElement.addChildElement(envelope.createName("parent"));
                             System.out.println("From inside if statement 2");
                             part.setContentId("axis");
                             msg.addAttachmentPart(part);
                             element.addAttribute(envelope.createName("href"), part.getContentId());
                             System.out.println("From inside if statement 3");
                             msg.saveChanges();
                             System.out.println("From inside if statement 4");
                             System.out.println(part.getContentId());
                        }else
                             try {
                                  throw new Exception("Responce message is null");
                             } catch (Exception e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                   } catch (SOAPException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
    // This is the client code
    import java.io.File;
    import java.io.FileOutputStream;
    import java.util.Iterator;
    import javax.activation.DataHandler;
    import javax.xml.namespace.QName;
    import javax.xml.soap.AttachmentPart;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPException;
    import org.apache.axis.Message;
    import org.apache.axis.MessageContext;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.message.SOAPEnvelope;
    public class AttachmentClient {
         public static void getImage(){
              try{
                   String endPoint = "http://localhost:7001/Test/services/AttchmentServer";
                   Service service = new Service();
                   Call call = (Call)service.createCall();
                   call.setOperationName(new QName("sendImage"));
                   call.setTargetEndpointAddress(endPoint);
                   call.setUseSOAPAction(true);
                   call.invoke(new Object[] {});
                   MessageContext context = call.getMessageContext();
                   Message msg = context.getCurrentMessage();
                   Iterator obj = msg.getAttachments();
                   while(obj.hasNext()){
                        try{
                             AttachmentPart part = (AttachmentPart) obj.next();
                             File graphFile = new File("test.jpg");
                             FileOutputStream outputStream = new FileOutputStream(graphFile);
                             DataHandler dataHandler = part.getDataHandler();
                             if(dataHandler != null){
                                  dataHandler.writeTo(outputStream);
                                  outputStream.flush();
                                  System.out.println("File Saved at:"+graphFile.getAbsolutePath());
                             }else{
                                  System.out.println("null");
                        }catch(Exception e){
                             e.printStackTrace();
              }catch(Exception e){
                   e.printStackTrace();
         public static void main(String args[]) throws SOAPException
              getImage();
    // The error is something like that
    - Exception:
    java.lang.RuntimeException: javax.mail.MessagingException: Error in input stream;
    nested exception is:
         java.io.IOException: End of stream encountered before final boundary marker.AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: javax.mail.MessagingException: Error in input stream;
    nested exception is:
         java.io.IOException: End of stream encountered before final boundary marker.
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace:javax.mail.MessagingException: Error in input stream;
    nested exception is:
         java.io.IOException: End of stream encountered before final boundary marker.
         at javax.mail.internet.InternetHeaders.load(InternetHeaders.java:122)
         at javax.mail.internet.InternetHeaders.<init>(InternetHeaders.java:93)
         at org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:499)
         at org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPartRelatedInputStream.java:433)
         at org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(MultiPartRelatedInputStream.java:439)
         at org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(AttachmentsImpl.java:171)
         at org.apache.axis.attachments.AttachmentsImpl.getAttachmentByReference(AttachmentsImpl.java:341)
         at org.apache.axis.encoding.DeserializationContext.getObjectByRef(DeserializationContext.java:617)
         at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.populateDataHandler(JAFDataHandlerDeserializer.java:74)
         at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.startElement(JAFDataHandlerDeserializer.java:59)
         at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
         at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
         at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
         at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
         at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
         at org.apache.axis.client.Call.invoke(Call.java:2467)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
         at AttachmentClient2.getImage(AttachmentClient2.java:27)
         at AttachmentClient2.main(AttachmentClient2.java:58)
         {http://xml.apache.org/axis/}hostname:solusoft18
    javax.mail.MessagingException: Error in input stream;
    nested exception is:
         java.io.IOException: End of stream encountered before final boundary marker.
         at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
         at org.apache.axis.attachments.MultiPartRelatedInputStream.readTillFound(MultiPartRelatedInputStream.java:609)
         at org.apache.axis.attachments.MultiPartRelatedInputStream.readAll(MultiPartRelatedInputStream.java:433)
         at org.apache.axis.attachments.MultiPartRelatedInputStream.getAttachments(MultiPartRelatedInputStream.java:439)
         at org.apache.axis.attachments.AttachmentsImpl.mergeinAttachments(AttachmentsImpl.java:171)
         at org.apache.axis.attachments.AttachmentsImpl.getAttachmentByReference(AttachmentsImpl.java:341)
         at org.apache.axis.encoding.DeserializationContext.getObjectByRef(DeserializationContext.java:617)
         at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.populateDataHandler(JAFDataHandlerDeserializer.java:74)
         at org.apache.axis.encoding.ser.JAFDataHandlerDeserializer.startElement(JAFDataHandlerDeserializer.java:59)
         at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
         at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
         at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
         at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
         at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
         at org.apache.axis.client.Call.invoke(Call.java:2467)
         at org.apache.axis.client.Call.invoke(Call.java:2366)
         at org.apache.axis.client.Call.invoke(Call.java:1812)
         at AttachmentClient2.getImage(AttachmentClient2.java:27)
         at AttachmentClient2.main(AttachmentClient2.java:58)
    Caused by: javax.mail.MessagingException: Error in input stream;

    Hi David,
    The "covert byte[] to a base64 encoded string" solution, is probably your best
    bet given the scenario you described.
    Regards,
    Mike Wooten
    "David Ruana" <[email protected]> wrote:
    >
    Weblogic 6.1 (SP2) does not support SOAP with attachments. In the meanwhile,
    what
    is the best approach in order to send a SOAP message which has binary
    data?
    My EJB is currently receiving a byte[] and returning also a byte[]. The
    only solution
    I can think of right now is to convert the byte[] into a String in base64
    format.
    Would you recommend that?
    Thanks in advance.

Maybe you are looking for