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.

Similar Messages

  • Binary Attachments - MTOM vs. SOAP with Attachments

    Hello everybody,
    i am kind of stuck by implementing a soap to proxy scenario! I wanted to use MTOM to transfer the messages together with the attachments, but until now i couldn't find out if this is possible at all using the ws-adapter with backend proxy (version 701)!
    I have seen this already:
    http://help.sap.com/saphelp_nwpi711/helpdata/de/48/d5a1fe5f317a4e8e35801ed2c88246/frameset.htm
    unfortunately im not a abap coder, but i can see using attachments in proxys should work!
    But how? Am i forced to used soap with attachments on sending webservice? If yes, have you got an example for me?
    I would appreciate any help!
    Thanks in advance,
    Markus

    Hi Amar,
    thanks for your reply, i know the mtom theory, but i don't know how to do it with sap pi on proxy side!
    (By the way, your link throws a 404!)
    Using soap adapter with enabled "keep Attachments" option, the MTOM-Attachment is getting processed, but on proxy side, using soap adapter (keeping attachments) to call proxy, it crashes on the backend side (version 701).
    I tried to make a webservice out of the proxy in soamanager, but i didn't get this working, as i have never done this. Also i didn't find an option for mtom in soamanager. I am also wondering why mtom is only supported in ws-adapter 7.10 but not in 7.11, why is this? And is it possible to use soap-adapter on OB-side and WS-Adapter on IB-side, or can i only use ws-adapter for direct communication?
    Lot's of questions i am facing ;-)...
    Kind regards,
    Markus

  • SOAP with attachments, attachment streaming

    Hello all,
    We are currently in the process of designing an integration service that uses web services (SOAP) as the means of communication.
    There are very large binary attachments included with these SOAP messages. MTOM ja SAAJ are to be used (propably CXF).
    However, as these attachments are very large (100MB), I would like to stream the attachments "through" the integration server.
    Is this possible? Can I somehow stream the SOAP attachment from the source system directly into the target without saving it as a whole into the integrating server application?
    Thank you for all your help! All solution suggestions are apprechiated :-)

    Hi Aalap,
    In version 1 of WebLogic Workshop SOAP attachments are not supported.
    Attachments will be supported in the next version. If support for SOAP
    attachment is an important requirement for you application, you can use
    WebLogic Web Services which supports SOAP Attachments.
    Please refer to the following document for more information on this
    http://e-docs.bea.com/wls/docs70/webserv/index.html
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Aalap" <[email protected]> wrote in message
    news:3da1ebc4$[email protected]..
    >
    >
    Hi,
    Does Workshop support SOAP with Attachments? I am writing a web servicewhich
    serves files (like MS-Word documents etc) to clients upon receiving theirrequest.
    So what are the various options for sending the file to the client?
    Please help.
    Thanks in advance.
    Regards,
    Aalap Parikh.

  • Web Service with attachments (SOAP with attachments) without PI

    Hi,
    Is it possible to send across file(say PDF) using ABAP web services. I know it can be done with Java using SOAP with attachments. Is something similar available for ABAP ? since if we transfer raw binary data as type string / xstring it may have a performance impact.
    I could not see any option for attachments when using web service wizard from SE37 / soamanager
    Note I am not using PI, this Web service would be consumed by a 3rd party tool. There is very little material available on transferring files using web service with SOAP attachments.
    Regards,
    Aditya

    Hi thanks for your input, but did you have to encode your binary data stream in say Base64 / utf-8 ? Also if you are transferring files in bulk(say 10 -100 files)  how does your web  service indicate end of one file or what is the best way so as to avoid performance problems.
    Regards,
    Aditya

  • Streaming soap with attachments

    dear all
    this might be a piece of cake for some of you out there but it is causing me a lot of stress given the fact that there is not enogh documentation out there regarding this topic
    I am writing a web service that uses soap with attachments to send a large streaming data,
    The concept works quite well but when I started to test it I got this problem.
    When my client program calls a method that should return a real time data the streaming starts after 10 seconds
    How can I avoid the fact that the message calls waits that long before the data starts streaming in?
    To be more specific
    I have a method that returns a streaming data in 10 seconds [getSteamingData(long seconds)]
    I would like to test if I already get some data steaming in after one second of it starts.
    To do so I started a thread that checks the OutputSteam size every 1 second and then compare the result with the previous size say a second ago, there should be an increase in size each second!!!
    But when I start the thread? the streaming does not start right away instead, it starts after 10 seconds causing the thread to return null size
    In real life with real large streaming data that 10 seconds could be 10 hours or God forbidden 10 years
    Is there a way around or is that not possible in SwA?
    Anybody have any idea
    thanks in advance

    Hi Aalap,
    In version 1 of WebLogic Workshop SOAP attachments are not supported.
    Attachments will be supported in the next version. If support for SOAP
    attachment is an important requirement for you application, you can use
    WebLogic Web Services which supports SOAP Attachments.
    Please refer to the following document for more information on this
    http://e-docs.bea.com/wls/docs70/webserv/index.html
    Thanks
    Raj Alagumalai
    WebLogic Workshop Support
    "Aalap" <[email protected]> wrote in message
    news:3da1ebc4$[email protected]..
    >
    >
    Hi,
    Does Workshop support SOAP with Attachments? I am writing a web servicewhich
    serves files (like MS-Word documents etc) to clients upon receiving theirrequest.
    So what are the various options for sending the file to the client?
    Please help.
    Thanks in advance.
    Regards,
    Aalap Parikh.

  • Can Oracle BPEL handle Doc/Lit SOAP with Attachments?

    I have successfully followed the instructions for using Oracle BPEL 10.1.3.4 to handle SOAP With Attachments with an RPC-style WSDL, detailed here:
    http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/manipdoc.htm#sthref955
    I have a simple Echo service that receives and attachment and responds with the same attachment.
    I actually would like to accomplish the same thing using a Doc/Literal Wrapped WSDL. My initial testing shows that BPEL can indeed receive the attachment ( I can see it in the dehydration store), but it is not added to the response.
    Is this possible using Doc/Lit with SwA in BPEL 10.1.3.4?

    As I've investigated the issue some more, I've found that the real issue is receiving an attachment on the SOAP response from the BPEL process. Using a Doc/Lit-Wrapped WSDL, I can receive a request with an attachment, and add it to outgoing requests successfully. But when I do a straight copy from the request message to the response message (Echo Service), the response contains the correct "href" attribute but there is no attachment, and moreover, no MIME multipart message is returned.
    NOTE: I was successful in using an RPC/Literal WSDL to accomplish the successful echo of the attachment.
    Also, when looking in the OPMN logs, I see the following line for the RPC-based BPEL process, but not for the Doc/Lit:
    <2009-11-23 13:43:35,684> <DEBUG> <attachment.collaxa.cube.engine> <CXBinaryDataHandler::createDataSource> for binary location=uuid:aaa091d17e1b5545:67c00c53:1252285bf07:-7fc2
    <2009-11-23 13:43:35,716> <DEBUG> <attachment.collaxa.cube.engine.data> <ConnectionFactory::getConnection> GOT CONNECTION 1 Autocommit = false
    <2009-11-23 13:43:35,716> <DEBUG> <attachment.collaxa.cube.engine> <CXBinaryDataHandler::createDataSource> for binary location=uuid:aaa091d17e1b5545:67c00c53:1252285bf07:-7fc1
    and the "binary location" value corresponds with the "href" attribute seen in the BPEL audit logs.

  • BPEL 11g SOAP with Attachments

    Does anyone have any examples utilizing SOAP with Attachments with BPEL 11g?
    I have previously worked with SwA in BPEL 10g, but I have not been able to successfully port my BPEL projects to 11g. I am able to send in an attachment without error, but the outgoing requests and/or responses do not contain the attachment as they should.
    Note: I am trying to use traditional SOAP with Attachments (hrefs) and not MTOM

    Hi ,
    Even we too have same requirement where soap with attachment (swa) has to pass through bpel process(11g).You hava mentioned that ur able to attach file to req..please can u share your sample for reference.
    Thanks for suggestions.

  • How to create Inbound SOAP With Attachments

    Hi All,
    Does someone know how to create an Inbound SOAP Message (from SAP XI to a Business System) with attachments?
    We get an Idoc from a SAP R/3 system and transform this Idoc to an other XML format messages, but we want this message as an attachment and not as the payload in the SOAP Envelope.
    We tried the PayloadSwapBean module, but we don't have an attachment to swap with, but maybe we used the wrong paramaters.
    Thanks,
    Frank

    Hi Stefan,
    Does this quick response mean I challenged you?
    Our scenario is that we send an IDoc (ORDERS05) from our R/3-backend-system to XI (3.0/SP15). In an integration process (A/S-bridge) we transform this IDoc to an UBL-Order XML-message, and we want to send this XML-message as an attachment to a (synchronous) SOAP-call to a vendor. Like I said, despite the SAPHelp-content, we don't get this working. Whatever we try, the UBL-Ordermessage is contained in the SOAP-body.
    What makes it even more strange, is that XI itself is based on the SOAP-with-attachments-standard...
    So, any help is much appreciated!
    Regards, Fred

  • HTTPS or SOAP with attachments as text files

    Hi ,
    I it possible to receive or send text files using SOAP with attachments or HTTPS with attachments?
    Best Regards,
    Harleen Kaur Chadha

    Hello Harleen,
                  Check the following links, where you can send the text files as attachments.
    Sending Text file without mapping using SOAP
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    Regards..
    Krishna..

  • 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.

  • Query on SOAP with attachments with Weblogic

    Hi all,
    I'm new to webservice and workshop, and I have to develop a webservice using bea workshop to be able to process multiple files and store it on a document server. I suppose that the webservice clients will be able to formulate their request in the form of SOAP messages with attachments(documents to be stored), but I'm not sure whether this is the best method and weblogic(8.1) supports it.
    Currently I have created a jws file which has successfully connected and been authenticated by the Document server, so for my next step, I'm trying to create a new file in the document server but I'm stuck at trying to write code to get attachment from the SOAP message in the jws file. Can anyone enlighten me?
    Thanks!

    Hi
    WebLogic Workshop web services can exchange one or more SOAP attachments.
    There is a sample and information on how to do that under the link
    http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/getstarted/conUsingSOAPAttachments.html
    Thanks
    Vimala

  • Soap with attachments

    I am a newbie to Soap do anyone have examples on soap with attachment.My requirement I need to send a zip file as an attachment from server to client using soap protocol and download that on client.I think we can do with SAAJ but do anyone have example..I need it immediately.Thanks in advance.
    Ragavendra.

    The jwsdp 1.1 tutorial has an example of using saaj to add an attachment to a soap message. See JWSDP_HOME\docs\tutorial\doc\JAXM5.html and search for "Adding Attachments". For attaching a zip file, a DataHandler is probably easiest:
    DataHandler dh = new DataHandler(new FileDataSource("skwish.zip"));
    AttachmentPart attachment = message.createAttachmentPart(dh);
    attachment.setContentId("zip_data"); // optional
    message.addAttachmentPart(attachment); Mike

  • Webservices for soap adapter

    Hi,
    how to Create Webservices for XI message interfaces?
    Please help me out.
    Thanks.

    hi
    For more information check this links
    /people/shabarish.vijayakumar/blog/2007/11/07/walkthrough--soap-xi-rfcbapi
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7ccd3e4e-0501-0010-95ae-afa58cb46b75
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    /people/community.user/blog/2006/10/24/exposing-bapi-as-web-services-through-sap-xi
    http://www.riyaz.net/blog/index.php/2007/12/10/xipi-consuming-xi-web-services-using-web-dynpro-part-i/
    http://www.riyaz.net/blog/index.php/2007/12/11/xipi-consuming-xi-web-services-using-web-dynpro-part-ii/

  • XI and Soap with attachments

    We have a Http -> XI(3.0)-> Webservice scenario, where the webservice returns a SOAP response with one or more zip file as attachments.
    Any information on configuring SOAP adapter to receive the multiple attachments and pass it to outbound http interface will be helpful.
    Inorder to test this scenario, we are also looking for a webservice which can return one or more attachments. Please let us know if you happen to know of a similar webservice.

    While configuring your SOAP Adapter in the Integration Directory you can select the option "Keep Attachments" under "Conversion Parameters"

  • Error Generating WebService for SOAP over JMS

    Hi,
    I've been tring to create an addition web service thta takes two input and returns the sum. I was able to generate the WSDL using JDevelopers GUI tool for generating WSDL, but I notices that there was no transport layer, in thebinding that suppoerted SOAP, and the "create web service from WSDL" wizard also gave and error message:
    oracle.jdeveloper.webservices.model.WebServiceException: The chosen WSDL contains no SOAP 1.1 bindings and is therefore unsuitable for generation of a JAX-RPC web service for WLS. Only SOAP 1.1 bindings are supported for generation of JAX-RPC web services for deployment to WLS.
    This is the WSDL I created:
    <?xml version="1.0" encoding="UTF-8" ?>
    <definitions targetNamespace="http://www.example.org/addition"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://www.example.org/addition"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:jms="http://schemas.xmlsoap.org/wsdl/jms/"
    xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/">
    <types>
    <xsd:schema targetNamespace="http://www.example.org/addition/types"
    elementFormDefault="qualified"/>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:add="http://www.example.org/addition"
    targetNamespace="http://www.example.org/addition"
    elementFormDefault="qualified">
    <xsd:element name="additionInput">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="a" type="xsd:int"/>
    <xsd:element name="b" type="xsd:int"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="additionOutput">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="sum" type="xsd:int"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </types>
    <message name="AdditionInputMessage">
    <part name="payload" element="tns:additionInput"/>
    </message>
    <message name="AdditionOutputMessage">
    <part name="payload" element="tns:additionOutput"/>
    </message>
    <portType name="AdditionPortType">
    <operation name="addition">
    <input message="tns:AdditionInputMessage"/>
    <output message="tns:AdditionOutputMessage"/>
    </operation>
    </portType>
    <binding name="AdditionPortTypeJMSBinding" type="tns:AdditionPortType">
    <jms:binding type="ObjectMessage"/>
    <format:typeMapping encoding="Java" style="Java">
    <format:typeMap typeName="tns:additionInput" formatType=""/>
    <format:typeMap typeName="tns:additionOutput" formatType=""/>
    </format:typeMapping>
    <operation name="addition">
    <input>
    <jms:input parts="payload"/>
    <jms:property name="payloadProperty" part="payload"/>
    </input>
    <output>
    <jms:output parts="payload"/>
    <jms:property name="payloadProperty" part="payload"/>
    </output>
    </operation>
    </binding>
    <service name="AdditionPortType">
    <port name="AdditionPortTypePort" binding="tns:AdditionPortTypeJMSBinding"/>
    </service>
    </definitions>
    Could someone please help me out? I've been struggling with this problem for two weeks and can't make any headway. It's really driving me nuts. I've looked all over the web, and while everyone agrees that SOAP over JMS is possible, no one sems to have a working solution. One example I was able to get hold of used ant for deployment, but the deploy task failed when I ran it. Please, please help me.

    Hi,
    I've been tring to create an addition web service thta takes two input and returns the sum. I was able to generate the WSDL using JDevelopers GUI tool for generating WSDL, but I notices that there was no transport layer, in thebinding that suppoerted SOAP, and the "create web service from WSDL" wizard also gave and error message:
    oracle.jdeveloper.webservices.model.WebServiceException: The chosen WSDL contains no SOAP 1.1 bindings and is therefore unsuitable for generation of a JAX-RPC web service for WLS. Only SOAP 1.1 bindings are supported for generation of JAX-RPC web services for deployment to WLS.
    This is the WSDL I created:
    <?xml version="1.0" encoding="UTF-8" ?>
    <definitions targetNamespace="http://www.example.org/addition"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://www.example.org/addition"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:jms="http://schemas.xmlsoap.org/wsdl/jms/"
    xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/">
    <types>
    <xsd:schema targetNamespace="http://www.example.org/addition/types"
    elementFormDefault="qualified"/>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:add="http://www.example.org/addition"
    targetNamespace="http://www.example.org/addition"
    elementFormDefault="qualified">
    <xsd:element name="additionInput">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="a" type="xsd:int"/>
    <xsd:element name="b" type="xsd:int"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="additionOutput">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="sum" type="xsd:int"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </types>
    <message name="AdditionInputMessage">
    <part name="payload" element="tns:additionInput"/>
    </message>
    <message name="AdditionOutputMessage">
    <part name="payload" element="tns:additionOutput"/>
    </message>
    <portType name="AdditionPortType">
    <operation name="addition">
    <input message="tns:AdditionInputMessage"/>
    <output message="tns:AdditionOutputMessage"/>
    </operation>
    </portType>
    <binding name="AdditionPortTypeJMSBinding" type="tns:AdditionPortType">
    <jms:binding type="ObjectMessage"/>
    <format:typeMapping encoding="Java" style="Java">
    <format:typeMap typeName="tns:additionInput" formatType=""/>
    <format:typeMap typeName="tns:additionOutput" formatType=""/>
    </format:typeMapping>
    <operation name="addition">
    <input>
    <jms:input parts="payload"/>
    <jms:property name="payloadProperty" part="payload"/>
    </input>
    <output>
    <jms:output parts="payload"/>
    <jms:property name="payloadProperty" part="payload"/>
    </output>
    </operation>
    </binding>
    <service name="AdditionPortType">
    <port name="AdditionPortTypePort" binding="tns:AdditionPortTypeJMSBinding"/>
    </service>
    </definitions>
    Could someone please help me out? I've been struggling with this problem for two weeks and can't make any headway. It's really driving me nuts. I've looked all over the web, and while everyone agrees that SOAP over JMS is possible, no one sems to have a working solution. One example I was able to get hold of used ant for deployment, but the deploy task failed when I ran it. Please, please help me.

Maybe you are looking for

  • Syncing Apple TV  and iPhoto

    I am trying to sync my iPhoto library to my Apple TV, the progress bar in iTunes says Syncing "Apple TV", but it is not actually showing the files syncing, and my MBP fan is running and my Apple TV is hot, and it is taking way too long. Did anyone el

  • My new ipod touch is stuck on a screen with the itunes logo, a picture of the charger and an arrow between the two.

    My new ipod touch has become stuck.  The screen has an image of the itunes logo near the top an arrow pointing up just below that, and an image of the charger at the bottom.  I don't know what this means.  I've tried charging it, and turning it off a

  • My LG Lucid keeps turning itself off

    I haven't had any problems with it, until recently. I've had it about three or four months, and now it just randomly turns itself off. It just started doing this yesterday, and today it's happened six or seven times. I do use my phone a lot, I listen

  • Preventing Skype Users Accessing a Toll Free Numbe...

    Is it possible to request from Skype to block Skype users from dialing a specific Toll Free Number? I work for a Teleconferencing Company and it seems like Fraudsters are using Skype to dial a Toll Free Number of ours and continually attempt to commi

  • How to implement bundle-like mechanism in Arch Linux

    I like Chakra's bundle system and I want to make it in Arch. I heard that bundle system is just a separate file system(like loop? I am not sure). Can you give some details? However, I think there must be some reasons that Arch does not implement such