Apache SOAP with websphere 6.1

I want to use Apache SOAP in websphere 6.1 since we will be reusing the framework developed already using Apache SOAP.This has been implemented only with weblogic previously.
Now we are trying to use this in combination with websphere 6.1,Is this supported?How to proceed?

Hi Thierry,
When we wrote the web services layer for BEA we purposefully left out
stateful session beans and entity beans because they did not match the
"services" model and there is no standard way to keep the state between
calls to the service. I believe the Apache implementation uses the HTTP
session for this behaviour. I don't know what the problem is with the
Apache SOAP implementation but I can try and help you either 1) use a
stateless session bean to call your sfsb, or 2) convince me that stateful
beans implemented outside the web services standard is something BEA should
support.
Sam
"Thierry Janaudy" <[email protected]> wrote in message
news:[email protected]..
Hello,
I wanted to use BEA's implementation of SOAP, but the problem is that you
cannot call SFSB.
Therefore I tried to install and run Apache SOAP (Which provides a service
for SLSB, SFSB, EB).
However, you I try to remotely list the services through:
java -cp %CP% org.apache.soap.server.ServiceManagerClient
http://localhost:7001/soap/servlet/rpcrouter list
I always get
Exception in thread "main" java.lang.NoSuchMethodError
at org.apache.soap.util.xml.QName.<init>(QName.java:80)
at org.apache.soap.util.xml.QName.matches(QName.java:146)
at org.apache.soap.Envelope.unmarshall(Envelope.java:237)
at org.apache.soap.rpc.Call.invoke(Call.java:230)
at
org.apache.soap.server.ServiceManagerClient.invokeMethod(ServiceManagerClien
t.java:129)
at
org.apache.soap.server.ServiceManagerClient.list(ServiceManagerClient.java:1
51)
at
org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient.java:2
37)
Do you have any idea why?
Thx

Similar Messages

  • PLEASE HELP! Using Apache SOAP with WL61

    Hi,
    I am trying to run the Apache soap within the WL61.
    I have the Apache soap servlet deployed under WL61.
    I am trying to use org.apache.soap.server.ServiceManagerClient
    to deploy the sample AddressBook service. I get the following error: "Unable to
    resolve namespace URI for 'xsd'".
    Now, the Apache SOAP faq says, I need to use the 1.3.0 xeces.jar
    on both server and client to solve this problem.
    However, WL61 server wont come up with the 1.3.0 xerces.jar file
    I am in a catch 22 situation, please help.
    thanks

    I had exactly this problem and by following the advice below I got it to work using
    crimson.jar from apache.
    Step 1: put crimson.jar frst in classpath
    Step 2: put the following in config.xml
    <XMLRegistry DocumentBuilderFactory="org.apache.crimson.jaxp.DocumentBuilderFactoryImpl"
    Name="Xerces JAXP" SAXParserFactory="org.apache.crimson.jaxp.SAXParserFactoryImpl"
    />
    Step 3: updated Server entry in config.xml to point to "Xerces JAXP" as explained
    below.
    I know this does not add a lot to the idea below but it is an alternative.
    Thanks,
    George
    Manoj Cheenath <[email protected]> wrote:
    >
    This is something i found in apache soap mailing list:
    ------- Original Message --------That fixed it! Thanks, Stefan!
    -----Original Message-----
    From: Stefan Dube [mailto:[email protected]]
    Sent: Wednesday, June 13, 2001 4:15 AM
    To: [email protected]
    Subject: RE: compatibility with weblogic 6.1 beta
    Hi!
    I believe the problem is that SOAP 2.2 uses JAXP and WL uses their
    bundled
    xerces as JAXP parser.
    To override this you have to modify the config.xml like this: (or
    use the web
    console)
    Add following element as child of the <Domain> element:
    <XMLRegistry
    DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
    Name="Xerces JAXP"
    SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"
    />
    and modify the <Server> element like this:
    <Server
    InstrumentStackTraceEnabled="true"
    ListenPort="80"
    LogRemoteExceptionsEnabled="true"
    Name="myServer"
    NativeIOEnabled="true"
    XMLRegistry="Xerces JAXP" <-- only this line is important
    >
    Hope that helps,
    -sd
    -----Original Message-----
    From: Erik Onnen [mailto:[email protected]]
    Sent: Wednesday, June 13, 2001 1:33 AM
    To: '[email protected] '
    Subject: RE: compatibility with weblogic 6.1 beta
    The "unable to resolve namespace" problem is because BEA in
    their infinite
    wisdom chose to mesh Xerces into their own libraries.
    Unfortunately they
    used an old version and because it is so embedded, you can't
    just replace a
    JAR. I was able to get 2.1 working on 6.0 sp1 by moving
    Xerces to the front
    of the classpath in the startup script. Ed, when WL won't
    start, what is the
    error you get? I haven't heard of that happening before.
    Steve, when you say
    Xerces is in your classpath, is it at the front, before weblogic.jar?
    -----Original Message-----
    From: Steve Livingston
    To: [email protected]
    Sent: 6/12/01 6:46 PM
    Subject: RE: compatibility with weblogic 6.1 beta
    1) I get the same error (with NT, soap-2.2 and wl-6.1beta) andhave
    found no solution:
    E:\apache\soap-2_2\samples\addressbook>java
    org.apache.soap.server.ServiceManagerClient
    http://slivings:7001/soap/servlet/rpcrouter list
    Deployed Services:
    E:\apache\soap-2_2\samples\addressbook>java
    org.apache.soap.server.ServiceManagerClient
    http://slivings:7001/soap/servlet/rpcrouter deploy dd.xml
    Ouch, the call failed:
    Fault Code = SOAP-ENV:Client
    Fault String = Unable to resolve namespace URI for 'ns2'.
    2) My wl-6.1b will start with xerces in classpath, but same error
    occurs.
    Can anyone help?
    Steve
    -----Original Message-----
    From: Ed Keen [mailto:[email protected]]
    Sent: Monday, June 11, 2001 6:36 PM
    To: '[email protected]'
    Subject: compatibility with weblogic 6.1 beta
    Has anyone gotten Apache soap version 2.2 to work with Weblogic6.1
    beta?
    There seems to be a xerces incompatibility. The weblogic.jarfile
    contains
    the xerces library. If you put xerces.jar first in the classpath,
    weblogic
    won't even start. However, if you put weblogic.jar first in the
    classpath,
    you get this error when attempting to deploy services using the
    ServiceManagerClient: "Unable to resolve namespace URI for 'ns2.'"
    This obviously seems to be a xerces parsing issue. Does
    anyone know of
    a
    workaround for this?
    Thanks,
    EdSanjeev Hegde wrote:
    Hi,
    I am trying to run the Apache soap within the WL61.
    I have the Apache soap servlet deployed under WL61.
    I am trying to use org.apache.soap.server.ServiceManagerClient
    to deploy the sample AddressBook service. I get the following error:"Unable to
    resolve namespace URI for 'xsd'".
    Now, the Apache SOAP faq says, I need to use the 1.3.0 xeces.jar
    on both server and client to solve this problem.
    However, WL61 server wont come up with the 1.3.0 xerces.jar file
    I am in a catch 22 situation, please help.
    thanks

  • Apache soap with WL5.1

    Hi everyone,
    I have a problem to install apache soap.
    I have register rpcrouter and set my classpath correctly. It look like RPCRouterServlet
    get started but it has following error. Anybody has an idea what went wrong and
    how to fix?
    SOAP RPC Router
    Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk to me.
    Thanks,
    Ho.

    Just means that the servlet method would not accept a "GET" method.
    Try communicating with a POST.
    I tried and it worked.
    --Naggi
    "Ho An" <[email protected]> wrote in message
    news:3acdcd05$[email protected]..
    >
    Hi everyone,
    I have a problem to install apache soap.
    I have register rpcrouter and set my classpath correctly. It look likeRPCRouterServlet
    get started but it has following error. Anybody has an idea what wentwrong and
    how to fix?
    SOAP RPC Router
    Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk tome.
    Thanks,
    Ho.

  • Exception while handling service request: org/apache/soap/Envelope

    Hi all,
    i´ve tried to run a message style webservice .
    Now i always get following Error: Exception while handling service request: org/apache/soap/Envelope
    Can anyone tell me what i should do?
    I use Bea 6.1 and Apache Soap 2.2
    I have deployed the Webservice and when i try to run the samples in apache all
    works fine.
    Thank you very much!!

    found the problem.
    I use apache soap with tomcat 5.5.9
    wrong: place the class file in a jar in the common/lib folder of tomcat
    wright: place the class file in the directory webapps/soap/web-inf/classes
    an other problem is when the method not exist

  • APACHE SOAP Errors .Problem with client

    Hello, i have installed a jakarta-tomcat 4.1.31 server
    and added soap to it.
    i 've deployed some services as taught by some tutorials
    but when i try to test the service i get errors.
    Exception in thread main java.lang.NoClassDefFoundError : org/apache/soap/server/ServiceManagerClient
    the same error but with another file
    samples/addresssbook/PutAddress
    it seems to me that the client cannot access the files!
    is it so?
    in case you need further info please say it

    When i try to list my services i get this
    \lib\soap.jar;C:\soap\jakarta-tomcat-4.1.31\common\lib\mail.jar;C:\soap\jakarta-
    tomcat-4.1.31\common\lib\activation.jar
    C:\soap\jakarta-tomcat-4.1.31>set CLASSPATH=C:\soap\jakarta-tomcat-4.1.31\common
    \lib\soap.jar;C:\soap\jakarta-tomcat-4.1.31\common\lib\mail.jar;C:\soap\jakarta-
    tomcat-4.1.31\common\lib\activation.jar;C:\soap\jakarta-tomcat-4.1.31\common\lib
    \xerces.jar
    C:\soap\jakarta-tomcat-4.1.31>java org.apache.soap.server.ServiceManagerClient h
    ttp://localhost:8080/soap/servlet/rpcrouter list
    Exception in thread "main" [SOAPException: faultCode=SOAP-ENV:Client; msg=No Des
    erializer found to deserialize a ':return' using encoding style 'http://schemas.
    xmlsoap.org/soap/encoding/'.; targetException=java.lang.IllegalArgumentException
    : No Deserializer found to deserialize a ':return' using encoding style 'http://
    schemas.xmlsoap.org/soap/encoding/'.]
    at org.apache.soap.rpc.Call.invoke(Call.java:244)
    at org.apache.soap.server.ServiceManagerClient.invokeMethod(ServiceManag
    erClient.java:127)
    at org.apache.soap.server.ServiceManagerClient.list(ServiceManagerClient
    .java:149)
    at org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient
    .java:235)

  • Linkage Error when using Apache SOAP 2.2 with Weblogic 6.1

    Has anyone seen this error before? Apparently I've got some incompatible versions of xerces being loaded. I tried putting different versions of xerces.jar in the front of my classpath, and creating an XML Registry to point to org.apache.xerces.jaxp..., but I always get the same error message.
    D:\soap>java -classpath "/soap-2_2/lib/soap.jar;activation.jar;mail.jar;xerces.jar;." org.apache.soap.server.Servic
    eManagerClient http://localhost:8001/App/servlet/rpcrouter list
    Ouch, the call failed:
    Fault Code = SOAP-ENV:Server.Exception:
    Fault String = loader constraints violated when linking org/xml/sax/InputSource class

    Has anyone seen this error before? Apparently I've got some incompatible versions of xerces being loaded. I tried putting different versions of xerces.jar in the front of my classpath, and creating an XML Registry to point to org.apache.xerces.jaxp..., but I always get the same error message.
    D:\soap>java -classpath "/soap-2_2/lib/soap.jar;activation.jar;mail.jar;xerces.jar;." org.apache.soap.server.Servic
    eManagerClient http://localhost:8001/App/servlet/rpcrouter list
    Ouch, the call failed:
    Fault Code = SOAP-ENV:Server.Exception:
    Fault String = loader constraints violated when linking org/xml/sax/InputSource class

  • Problem in epm 11.1.1.3 configuration with websphere

    hi there,
    i am have installed epm 11.1.1.3 with websphere(ver 6.1) , but when i try to configure the workspace with websphere it asks me to give path for web server plug ins where mod_was_ap20_http.dll are installed .
    i have also installed ibm http server(ver 6.0.1) but i am still not able to find that file .i chose the web server as ibm http server and apache but in both cases it is showing this problem.
    thanks in advance.

    So are you seeing this error when accessing only HFM? Do you have planning or Reporting,does those work fine? Provide more details like what documents have you followed.If you disable SSL does it work?
    Thanks
    Vivek

  • Org.apache.soap.rpc.Call is hanging on invoke()...

    Hi.
    What do you do when you're making a call to a webservice with
    org.apache.soap.rpc.Calland it just plain hangs on the Call.Invoke() method?
    -pfv

    Hi.
    What do you do when you're making a call to a webservice with
    org.apache.soap.rpc.Calland it just plain hangs on the Call.Invoke() method?
    -pfv

  • SOAP with Attachment Support in Web AS Java

    Hello,
    I want to write an extension to an existing Java application running on Web AS to take a PDF (which is a binary object in the context) and submit it using a Web Service call to a  Web Service running on a WebSphere App Server. My idea is to use SOAP with attachments to do this. I know how to create a simple Web Service call with the NWDS, but I am not so sure about a Web Service call with an attachment.
    1) Is SOAP with attachments supported in Web Java/NWDS?
    2) Does it require a specific Web AS 6.40 SP Stack?
    3) Has anyone used this before? Is there anything I need to consider (e.g. encoding of the attachment)?
    4) Is there a maximum file size for the attachment?
    You help is appreciated. And if I get it running I can show it at TechEd
    Cheers!
    Matthias

    I found what causes the problem.
    I use resource bundle to handle i18n and one of bundle is myapp_zh.properties for Chinese locale. In browser I add  Chinese [zh] in Language Preference then the web page should display Chinese character.
    What puzzles me is that encoding of the page with Chinese characters is Chinese Simplified (GB2312) rather than UTF-8. Tomcat correctly sets page Encoding to UTF-8 since I specify <%@ page language="java" contentType="text/html;charset=UTF-8" %> in each JSP file. Why Web AS ignores this and returns Chinese character in GB2312?
    Thanks a lot
    John

  • Apache SOAP 2.2 and WL 6.1

    When trying to use Apache SOAP 2.2 with WL Server 6.1, I get the following error
    when attempting a call.invoke():
    "Unable to resolve namespace 'SOAPSDK3'"
    I can successfully make the SOAP call using a stand-alone application (not inside
    weblogic). I found the following FAQ which described the same problem for WL
    Server 6.1 (beta):
    http://xml.apache.org/soap/faq/faq-for-WL6.1beta.html
    I have not been able to get a working solution though. The XML Registry was already
    setup as described, using the org.apache.xerces.*. I also put xerces.jar in front
    of weblogic.jar in the WL Classpath (not sure if this would have any effect).
    Originally, I had put XERCES 1.3.1 there and had no problem starting WL, but
    got the same error as before - Unable to resolve namespace 'SOAPSDK3'. When I
    placed another version of XERCES, namely 1.4.3 - I could not even start WL properly,
    it crapped out with a memory exception and quit the JVM. I read on WL docs that
    XERCES 1.3.1 is required and you cannot put another version in front of the weblogic.jar,
    otherwise you have problems (they were right on that one). Here are the WL docs:
    http://e-docs.bea.com/wls/docs61/faq/xml.html
    So, I'd be interested to see if you anyone has suggestion as to what I might try.
    It appears that I MUST use XERCES 1.3.1, but when I put the in front of weblogic.jar
    I don't solve the problem. If you know of anything I might try, please let me
    know. Thanks.
    Configuration:
    WL 6.1 on Windows 2000 - application inside EAR file.
    SOAP Client - Apache SOAP 2.2
    SOAP Server - MS SOAP Toolkit (ISAPI - VB dll)
    Christopher Hurley
    Tallán, Inc.
    [email protected]
    cell 201.739.2194

    Don't know whether below is related to your problem:
    https://discussions.apple.com/thread/4831752?tstart=0

  • Synchronous BPEL process calling apache soap 2.3.1 service(s) on jboss

    I have a problem that is quite frustratiing. I have a very simple synchronous BPEL process and I am trying to invoke some legacy services we have deployed using Apache soap 2.3.1 running on jboss. The process executes, the service executes, but the return value is not received by the BPEL process.
    I used obtunnel to capture the data flow and everything seems fine from that perspective. The problem is, if you watch the monitor, the status says active, but the BPEL process returns immediately. It does not wait for the response, so the return value winds up being null. I have tried this numerous times with several services and the result is always the same. This is a serious problem for us. Any suggestions/insight would be very much appreciated.
    Ina case there are any doubts as to whether or not it is actually a synchronous process, from the BPEL code:
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Wed Apr 18 13:19:50 EDT 2007
    Author: bmurray
    Purpose: Synchronous BPEL Process
    -->
    Below is an example from obtunnel:
    ==============
    Listen Port: 5678
    Target Host: pian.wlgore.com
    Target Port: 8080
    ==== Request ====
    POST /soap/servlet/rpcrouter HTTP/1.1
    Host: pian.wlgore.com:5678
    Connection: TE
    TE: trailers, deflate, gzip, compress
    User-Agent: Oracle HTTPClient Version 10h
    SOAPAction: "http://vitalstream.com/webservices/Authenticate"
    Accept-Encoding: gzip, x-gzip, compress, x-compress
    Content-type: text/xml; charset=UTF-8
    Content-length: 829
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <env:Body>
    <ns0:Authenticate xmlns:ns0="http://vitalstream.com/webservices">
    <strAccount xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string">testvar3</strAccount>
    <strToken xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string">testvar1</strToken>
    <strReferrer xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string">testvar4</strReferrer>
    <strSourceURL xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string">testvar</strSourceURL>
    <strClientIP xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string">testvar2</strClientIP>
    </ns0:Authenticate>
    </env:Body>
    </env:Envelope>==== Response ====
    HTTP/1.1 200 OK
    X-Powered-By: Servlet 2.4; Tomcat-5.0.28/JBoss-4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)
    Set-Cookie: JSESSIONID=C656EEE6B641F23F02D6E5BE79CD2A4D.ajp13w; Path=/soap
    Content-Type: text/xml;charset=utf-8
    Content-Length: 480
    Date: Wed, 18 Apr 2007 18:34:19 GMT
    Server: Apache-Coyote/1.1
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:AuthenticateResponse xmlns:ns1="http://vitalstream.com/webservices" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:int">1</return>
    </ns1:AuthenticateResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    ==============
    As you can see, the value is indeed returned from the service, but BPEL indicates a null value for the return:
    <messages><Invoke_1_Authenticate_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="strSourceURL"><strSourceURL xmlns="" xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">testvar</strSourceURL>
    </part><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="strToken"><strToken xmlns="" xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">testvar1</strToken>
    </part><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="strAccount"><strAccount xmlns="" xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">testvar3</strAccount>
    </part><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="strClientIP"><strClientIP xmlns="" xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">testvar2</strClientIP>
    </part><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="strReferrer"><strReferrer xmlns="" xmlns:def="http://www.w3.org/2001/XMLSchema" xsi:type="def:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">testvar4</strReferrer>
    </part></Invoke_1_Authenticate_InputVariable><Invoke_1_Authenticate_OutputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Result">null</part></Invoke_1_Authenticate_OutputVariable></messages>

    Did you specify the correct message type for your return variable?
    <Invoke_1_Authenticate_OutputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Result">
    null
    </part>
    </Invoke_1_Authenticate_OutputVariable>
    As is returns:
    <ns1:AuthenticateResponse
    xmlns:ns1="http://vitalstream.com/webservices" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xsi:type="xsd:int">1</return>
    </ns1:AuthenticateResponse>
    Regards,
    Marc

  • WSDP w/ Apache SOAP-RPC

    Hi,
    Has anyone tried to develop/deploy a web service under WSDP and invoke it from a client app written under Apache SOAP-RPC? Can this be done w/ or w/o 'axis'
    from Apache-SOAP?
    Thanks,
    Marcia

    yes, this can be done ...and even vice versa.
    This is just a soap call and it dees not matter from where it is called.
    Generate the webservice and deploy it. Use the WSDL generated to create the client with Apache Soap. Point to the end point URL for the webservice made with JAX-RPC.
    I tried by creating a webservice with Apache Soap-RPC and accessing through the client made with Jax-RPC.
    regards

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

  • Apache SOAP 2.2 - Weblogic 6.1SP2

    Hi,
    Has anyone managed to get Apache SOAP working with Weblogic 6x?
    I can get everything up and running, but for some reason the classloader
    for the web application (ie; the actual Apache SOAP app) doesn't load the
    classes in my jar file containing the EJB files, serializers, etc.
    Therefore whenever I make a SOAP request I get a server side error reported
    via SOAP that some class or another (one of my own ones) cannot be found.
    I can cure this by sticking my jar file in the server's classpath - however
    this isn't great as it means the JVM's classloader is picking everything up
    and I lose the ability to redeploy.
    Any ideas? In the absence of any other information it would seem that
    Weblogic's classloaders are buggy...
    Cheers,
    Trev

    Hi Trev,
    Let's recap here:
    1. You are deploying the .war file for Apache SOAP, into WLS 6.1 SP2, right? If
    yes, you copied the .war file into the $WL_HOME/config/examples/applications directory,
    or something similar, right?
    2. It (some class or classes in soap.war) couldn't find the classes for your EJB
    so, you "unwarred" it, created a WEB-INF/lib directory, and copied the .jar for
    your EJB into that directory. Then you re-jarred the soap.war, right? If so, did
    you put a <ejb-ref> element in the web.xml (for soap.war), so it (the SOAP webapp)
    would know about the ejb?
    The <ejb-ref> should look something like this:
    <ejb-ref>
    <description></description>
    <ejb-ref-name>examples.webservices.security.PhoneBookService</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>examples.webservices.security.PhoneBookServiceHome</home>
    <remote>examples.webservices.security.PhoneBookService</remote>
    </ejb-ref>
    You'd also need to create a WEB-INF/weblogic.xml file and put something like this
    in it:
    <reference-descriptor>
    <ejb-reference-description>
    <ejb-ref-name>examples.webservices.security.PhoneBookService</ejb-ref-name>
    <jndi-name>examples.webservices.security.PhoneBookService</jndi-name>
    </ejb-reference-description>
    </reference-descriptor>
    But, I would do any of this because your EJB doesn't have "diddly squat" to do
    with Apache SOAP ;-) The Apache SOAP web app is a "standalone" thing, right? You
    want to use your EJB "with it", not be part "of it" right? Exactly! So, let's
    abandon that route...
    3. Next, you tried to turn the Apache SOAP Web Application (.war) into the Apache
    SOAP Enterprise Application (.ear). I'm assuming that you created a META-INF/application.xml
    that looked something like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application
    1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
    <application>
    <display-name>Apache SOAP 2.2</display-name>
    <module>
    <web>
    <web-uri>soap.war</web-uri>
    <context-root>/soap</context-root>
    </web>
    </module>
    <module>
    <ejb>{name of the .jar for your ejb}</ejb>
    </module>
    </application>
    But, you didn't create the <ejb-ref> stuff in #2 above. Again, I don't think it
    makes a lot of sense to put "your EJB" in the "Apache SOAP" Enterprise application
    What's going on here (the Apache SOAP code not being able to find your EJB classes)
    is "expected behavior" as far as the BEA docs go. Everyone I know (including me!)
    that deploys the Apache SOAP web app in WebLogic, creates a .jar that contains
    a copy of all the remote (and home) interface classes that the rpcrouter servlet
    will call, and puts this in the -classpath used to start WebLogic. That way, it
    (the Apache SOAP web app) will be able to find them. I don't put the jar for the
    EJB in the -classpath, though. To be honest, I don't use Apache SOAP because it
    doesn't support WSDL yet ;-)
    Regards,
    Mike Wooten
    "ts" <[email protected]> wrote:
    Hi Mike,
    Cheers for the response. I've read the documentation you've linked to
    and I
    understand how WLS performs class loading.
    However, the documentation implies that I could either;
    A) Package the SOAP war file together with my EJB jar file in an EAR
    file
    and deploy, and the SOAP web app would subsequently be able to reference
    classes/beans. (Ref: "Although you could deploy the .war and .jar files
    separately, deploying them together in an .ear file produces a classloader
    arrangement that allows the servlets and JSPs to find the EJB classes.")
    B) Simply place my EJB jar file in the WEB-INF\lib subdirectory of the
    deployed SOAP web app. (Ref: J2EE specification).
    In fact, neither of these work, and I am forced to include the EJB jar
    in
    the server's classpath.
    Surely theres some kind of problem here?
    Cheers,
    Trev
    "Michael Wooten" <[email protected]> wrote in message
    news:[email protected]...
    Hi Trev,
    Technically, this is not so much an issue with the classloader(s) inWLS,
    as it
    is with J2EE packaging. WLS uses a pretty sophisticated, hierarchicalclass loading
    architecture. The main reason for using this approach, was to supportundeploying/redeploying
    J2EE components (i.e. Servlets, EJBs) without shutting down the JVM.
    What you are encountering is a phenomena where Apache SOAP is deployedas
    a Web
    Application, with it's own ServletContext and classloader.
    See the following links for specifics on class loading and J2EE packagingin WLS:
    http://e-docs.bea.com/wls/docs60/programming/packaging.html#1048725
    After reading this, you will see why the classloader associated withthe
    Apache
    SOAP web app, cannot see the classes (i.e. serializer, EJBs, etc.)you are
    using
    to implement your web service.
    Regards,
    Mike Wooten
    "ts" <[email protected]> wrote:
    Hi,
    Has anyone managed to get Apache SOAP working with Weblogic 6x?
    I can get everything up and running, but for some reason the classloader
    for the web application (ie; the actual Apache SOAP app) doesn't load
    the
    classes in my jar file containing the EJB files, serializers, etc.
    Therefore whenever I make a SOAP request I get a server side error
    reported
    via SOAP that some class or another (one of my own ones) cannot befound.
    I can cure this by sticking my jar file in the server's classpath-
    however
    this isn't great as it means the JVM's classloader is picking everything
    up
    and I lose the ability to redeploy.
    Any ideas? In the absence of any other information it would seem that
    Weblogic's classloaders are buggy...
    Cheers,
    Trev

  • Apache SOAP

    Working with the book Programming Web Services with SOAP and working on chapter 3.
    Creating Web Services in Java with Apache SOAP
    Wondering where do I add the Hello.java to the web server&#8217;s classpath if I am running Tomcat Server.
    package samples;
    public class Hello {
    public String sayHello(String name) {
    return "Hello " + name;
    I&#8217;ve used the deployment descriptor to deploy the application on the server
    <dd:service xmlns:dd="http://xml.apache.org/xml-soap/deployment" id="urn:Example1">
    <dd:provider type="java"
    scope="Application"
    methods="sayHello">
    <dd:java class="samples.Hello"
    static="false" />
    </dd:provider>
    <dd:faultListener>
    org.apache.soap.server.DOMFaultListener
    </dd:faultListener>
    <dd:mappings />
    </dd:service>
    Trying to run the client with the perl example client.
    #!/usr/bin/perl -w
    # hw_jclient.pl - java Hello client
    use SOAP::Lite;
    my $name = shift;
    print "\n\nCalling the SOAP Server to say hello\n\n";
    print "The SOAP Server says: ";
    print SOAP::Lite
    -> uri('urn:Example1')
    -> proxy('http://localhost:8080/soap/servlet/rpcrouter James')
    -> sayHello($name)
    -> result . "\n\n"
    but getting the result of
    Calling the SOAP Server to say hello
    The SOAP Server says: 404 /soap/servlet/rpcrouter%20James at C:\Documents and Se
    ttings\Administrator\Desktop\test.pl line 7
    What am I doing wrong or not doing?
    Thanks,
    John Cox

    are you using axis or apache soap?

Maybe you are looking for

  • .me mail wiped out from iPhone. Restore desktop Mail from Time Machine how?

    Wife using her iPhone (OS 4.0.2) for some reason choose delete all on the mobile me account, which wiped out all of our old email on our iMac. Very important email from many years ! Fortunately, We are running Time Machine on a NAS, so getting the fi

  • Convert Date/Time to Date for viewing?

    Hi there, any property or easy way to truncate Time from Oracle Date data type to show in Grid? Thanks Ali null

  • Fnd_user_pkg.changepassword failing

    I have access to the fnd_user_pkg.changepassword function and I can't seem to get it to commit. I'm using the SQL statement below with no success. It completes but the password does not actually change. I have changed the user name below for this pos

  • Finding out a Trasnaction code

    Hi All, Could you please help me to find out the t code for this? SAP Web Application Server > System administration > Users and Authorizations > Line-oriented Authorizations > Define organizational criteria What is the T code for the above? THanks,

  • FopServlet - XSLTInputHandler

    I am trying to run fop using a servlet using http://127.0.0.1:8080/examples/servlet/FopTestServlet?xml=krusty.xml&xsl=krusty.xsl but it is getting the error and code (this is example from FOP with some minor modifications) below. Code compiles fine..