NW - SAAJ u0096 Implementation

Hi,
I’m trying to implement a simple application using SAAJ API to send a SOAP message to a web service in which I want to place a document in the SOAP Message Body.
I’ve gone over the sun tutorial http://java.sun.com/j2ee/1.4/docs/tutorial-update2/doc/SAAJ2.html and while trying to implement a simple application I have encountered the following problems:
1.     jars in NW 6.4 didn’t support the implementation. At first I had an exception when tried to create connection with the SOAPConnectionFactory of :
Unable to create SOAP connection factory: Provider com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory not found
which later was solved by adding saaj-impl.jar downloaded from sun jws developer pack 1.6
2.     Later, I had another exception of UnsupportedOperationException when trying to create a message with the MessageFactory which was also solved by replacing the saaj-api.jar provided with the NW with the saaj-api.jar that was also downloaded with the developer pack.
3.     later on another exception when using the method getSOAPPart in SOAPMessage object:
java.lang.NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:63)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.<init>(SOAPPart1_1Impl.java:29)
at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:52)
at com.sap.saaj.maintest.SaajTest.main(SaajTest.java:48)
Please help me with the following questions:
1. How to use saaj inside the NWDS env?
2. Is there other recommended solution to attach xml document to a SOAP message body?
3. A direction to any useful documentation on the subject in SAP env will be appreciated

Hi,
maybe the tool on http://service.sap.com/scl ( > start application) is usefull to you. There you can select business process and get a list of systems you need to install for this.
For FI, SD, MM and PP, you need to install an SAP ECC (6.0) system. For CRM an SAP CRM system. HCM you can technically run in the same ECC system as FI and the others. But a lot of customers do install a separate ECC system for HCM due to security reasons.
In ECC 6.0 a lot of industry solutions are already intergrated. But I think you have to install another ECC system for this wholesale industry thing.
But better check out the link from above.
Regards,
Sascha

Similar Messages

  • IBM JRE and Webservice (JWSD 1.3)

    Initally, I can run this program in SUN JRE and JBoss. However, I have received some add change requests, therefore, we need to use IBM JRE and existing JBOSS 3.2.3.In addition, I have got a problem using IBM JRE and JBoss 3.2.3.
    Actually, I use Sun JRE to compile those coding and then ftp to the JBOSS 3.2.3. Then, I use IBM JRE to run java application and sent web services request to JBOSS 3.2.3(using IBM JRE).
    The following is a log file in JBOSS 3.2.3 which provides web service.
    2007-07-16 09:17:32,083 ERROR [STDERR] Jul 16, 2007 9:17:32 AM com.sun.xml.rpc.server.http.JAXRPCServletDelegate doPost
    SEVERE: caught throwable
    java.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/ver1_1/Message1_1Impl
    The following is a log file which is created by Java application
    ERROR - Error in invokeBatchJobAction: com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
    ERROR - Error in run: com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
    ERROR -
    e.getCause().getMessage(): com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
    Does anyone can tell me what problem?

    It seems you're using Sun implementation (JAXRPC) and this one is looking for Sun SAAJ implementation.
    You could get the same kind of error when using JAX-WS SAAJ (Sun implementation) who in turn require the Sun Xerces impl

  • Weblogic SAAJ implementation and version problem

    I have a problem with Weblogic 9.0 using its own implementation over the one i provide.
              I have tried putting the saaj-api.jar and saaj-impl.jar in my domains lib/ catalog as well as the domains config/lib/ catalog.
              I also tried PRE_CLASSPATH in setDomainEnv.cmd but it seems the weblogic implementation is being used anyway!
              Any ideas how to solve this?
              Here are a couple of exceptions i get after a context lookup and getConnection of the resource adapter:
              Caused by: javax.xml.soap.SOAPException: Unable to create SOAP connection factory: com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory
                   at javax.xml.soap.SOAPConnectionFactory.newInstance(Unknown Source)
                                  I also tried adding a property value:
                        System.setProperty("javax.xml.soap.SOAPConnectionFactory", "com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnectionFactory");
                        in the web app before doing the context lookup, and then i get this exception:
                        java.lang.UnsupportedOperationException: This class does not support SAAJ 1.1
              at weblogic.webservice.core.soap.SOAPElementImpl.getElementsByTagNameNS(SOAPElementImpl.java:527)
              

    Was this problem solved in the latest version of Bea Weblogic 9.2?
              I have an issue on soap 1.2 support activation (through Binding.Type.SOAP12):
              java.lang.RuntimeException: weblogic.testclient.WsdlParseFailedException: SOAP 1.2 is not supported by the Test Client
              at weblogic.testclient.ConnectionState.createWsdl(ConnectionState.java:63)
              at Controller.refreshWsdl(Controller.java:437)
              at Controller.begin(Controller.java:285)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:878)
              at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:808)
              at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:477)
              at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:305)
              at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:335)
              at org.apache.beehive.netui.pageflow.internal.FlowControllerAction.execute(FlowControllerAction.java:51)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
              at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:95)
              at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2042)
              at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:90)
              at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2114)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
              at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:554)
              at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:851)
              at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:630)
              at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:157)
              at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
              at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
              at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
              at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
              at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3241)
              at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
              at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
              at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2010)
              at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1916)
              at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
              at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
              at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
              Caused by: weblogic.testclient.WsdlParseFailedException: SOAP 1.2 is not supported by the Test Client
              at weblogic.testclient.WsdlOperationParser.createOperation(WsdlOperationParser.java:38)
              at weblogic.testclient.WebService.createOperation(WebService.java:251)
              at weblogic.testclient.WebService.<init>(WebService.java:88)
              at weblogic.testclient.Wsdl.parseWsdl(Wsdl.java:135)
              at weblogic.testclient.Wsdl.<init>(Wsdl.java:60)
              at weblogic.testclient.ConnectionState.createWsdlFromHttpUrl(ConnectionState.java:120)
              at weblogic.testclient.ConnectionState.createWsdl(ConnectionState.java:54)
              ... 37 more

  • Oracle/SAAJ Implementation on iAS9.0.3.0.0 - Error

    Hi,
    Maybe someone has been working with this stuff. In that case, you might be able to help me.
    I'm getting the following error in a Servlet APP, where an incoming InputStream is being molded into a SOAP W/ Attachments construct via factory.createMessage(headers, is);. This is the stacktrace:
    javax.xml.soap.SOAPException: Unable to internalize message
         at oracle.j2ee.ws.saaj.soap.MessageImpl.(MessageImpl.java:109)
         at oracle.j2ee.ws.saaj.soap.soap11.Message11.(Message11.java:30)
         at oracle.j2ee.ws.saaj.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:67)
         at com.cumquatit.cia.services.ehf.support.EventHandlerSoapHelperImpl.prepareSoapStorage(EventHandlerSoapHelperImpl.java:64)
         at com.cumquatit.cia.services.ehf.support.EventHandlerSoapHelperImpl.(EventHandlerSoapHelperImpl.java:42)
         at com.cumquatit.cia.services.BaseSoapEventController.createHelper(BaseSoapEventController.java:49)
         at com.cumquatit.cia.services.BaseHttpEventController.doAction(BaseHttpEventController.java:183)
         at com.cumquatit.cia.services.BaseHttpEventController.doPost(BaseHttpEventController.java:221)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:560)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.Error: DataContentHandlerFactory already defined
         at javax.activation.DataHandler.setDataContentHandlerFactory(DataHandler.java:628)
         at oracle.j2ee.ws.saaj.soap.AttachmentPartImpl.(AttachmentPartImpl.java:29)
         at oracle.j2ee.ws.saaj.soap.MessageImpl.parseMultipart(MessageImpl.java:145)
         at oracle.j2ee.ws.saaj.soap.MessageImpl.(MessageImpl.java:102)
         ... 18 moreI've seen elsewhere that this is probably due to the existence of multipe mail.jar and/or activation.jar libraries on the classpath. Anyone has some other (bright) ideas?
    Thx,
    Jan.

    What the ...,
    Every consecutive call to this web service fails with, the following error:
         at oracle.j2ee.ws.saaj.soap.MessageImpl.&lt;init&gt;(MessageImpl.java:109)
         at oracle.j2ee.ws.saaj.soap.soap11.Message11.&lt;init&gt;(Message11.java:30)
         at oracle.j2ee.ws.saaj.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:67)
         at com.cumquatit.cia.services.ehf.support.EventHandlerSoapHelperImpl.prepareSoapStorage(EventHandlerSoapHelperImpl.java:62)
         at com.cumquatit.cia.services.ehf.support.EventHandlerSoapHelperImpl.&lt;init&gt;(EventHandlerSoapHelperImpl.java:42)
         at com.cumquatit.cia.services.BaseSoapEventController.createHelper(BaseSoapEventController.java:49)
         at com.cumquatit.cia.services.BaseHttpEventController.doAction(BaseHttpEventController.java:183)
         at com.cumquatit.cia.services.BaseHttpEventController.doPost(BaseHttpEventController.java:221)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:560)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:148)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:72)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.NoClassDefFoundError
         at oracle.j2ee.ws.saaj.soap.MessageImpl.parseMultipart(MessageImpl.java:145)
         at oracle.j2ee.ws.saaj.soap.MessageImpl.&lt;init&gt;(MessageImpl.java:102)
         ... 18 morePlz... is it me, or is Oracle's SAAJ Impl just not usable?

  • URGENT u0096 MM Purchase Order (Implementation Query)

    **URGENT HELP REQUIRED**
    Dear All,
    I need some Information/help URGENTLY for a presentation/meeting I will be attending later this week.
    If a service based company, wants to start implementing Purchase Order Processing (ME21N), however they only want to implement the actual MM Module to a (Very Minimum) what/how would they make this happen??
    Currently this company has an Invoice Management System Called “Ebydos/Readsoft and all Vendors Invoices are managed & paid via this transaction”. They do not want to scrap this system (So we will NOT be using T-Code - MIRO). In addition, this Company does NOT want to Goods Receipt so basically “No” MIGO or ML81N – We have 2 Way as opposed the the usual 3 Way matching.
    This company wants to Implement a VERY MINIMAL – MM System, where its users Can Raise Purchase Orders, without maintaining the Item lines. So basically they want Purchase orders with the Header Information Only (EKKO), and they don’t want to maintain anything in the Item information (EKPO) – I assume this is because they don’t want to maintain material etc...
    Also if this company absolutely has to use the Item Level in ME21N (Creating Purchase Orders), then they would ideally like to code the item Direct to a GL Account Code (Table – BSEG), rather than a particular item & purchase groups / material group – (Table EKPO).
    I hope the above makes sense, basically the Information I need is the following:
    (1) Is it possible to Create purchase orders WITHOUT implementing MM (EG – Can some form of Purchase Ordering System, be created/configured in FI/CO) – Which we currently have, which would give us control on what we procure??
    (2) If we must implement MM what is the Minimum Implementation/Configuration we need?
    (3) Can you Create Header Only (EKKO) Purchase Orders, without maintaining Materials or Doing Item Lines. If we MUST do Item lines, can they be coded DIRECT to a GL Code (BSEG) rather than a particular Item & Material / Purchasing Group (EKPO)??
    (4) Finally Can SAP handle the demands we require (as detailed above). Or are we talking about some form of a Be-Spoke system, linked or within SAP??
    Thanks for your help in advance. Please email or post DOCUMENTATION / LINK to support /back-up your information/theories…
    Kind Regards
    RICK

    1) Is it possible to Create purchase orders WITHOUT implementing MM (EG – Can some form of Purchase Ordering System, be created/configured in FI/CO) – Which we currently have, which would give us control on what we procure??
    What is the use of purchasing system when you don;t even have the mateiral created or any other org structure for purchaisng
    rather then use just existing system in this case
    (2) If we must implement MM what is the Minimum Implementation/Configuration we need?
    The minimum config you need is org structure of MM like purcahse org
    purchase group, plant, storage location etc. to start purchasing process
    (3) Can you Create Header Only (EKKO) Purchase Orders, without maintaining Materials or Doing Item Lines. If we MUST do Item lines, can they be coded DIRECT to a GL Code (BSEG) rather than a particular Item & Material / Purchasing Group (EKPO)??
    No it is not possible wihtou item line but in item line you can enter just text of mateirl but in this case you need cost center or any cost object
    you can create cost center and attcahe GL to that
    (4) Finally Can SAP handle the demands we require (as detailed above). Or are we talking about some form of a Be-Spoke system, linked or within SAP??
    SAP can handle but it is useless in my point of view
    that's the reason first time i didn;t reply but i see your request agian..so i replied.

  • Help Needed - FINAL PROJECT - SAAJ MESSAGING

    Hi there!
    currently im doing my final project and it involves sending and receiving soap messages.
    im working with sun java studio creator for the first time.
    i have done this example (excuse me for possible dumb errors im just a noobie):
    * Page1.java
    * Created on 6 de Novembro de 2006, 12:40
    package webapplication1;
    import com.sun.rave.web.ui.appbase.AbstractPageBean;
    import com.sun.rave.web.ui.component.Body;
    import com.sun.rave.web.ui.component.Form;
    import com.sun.rave.web.ui.component.Head;
    import com.sun.rave.web.ui.component.Html;
    import com.sun.rave.web.ui.component.Link;
    import com.sun.rave.web.ui.component.Page;
    import javax.faces.FacesException;
    import com.sun.rave.web.ui.component.Button;
    import com.sun.rave.web.ui.component.TextArea;
    //soap saaj
    import javax.xml.*;
    import javax.xml.soap.*;
    import java.net.URL;
    import java.net.*;
    import java.util.*;
    import javax.xml.soap.SOAPConnectionFactory;
    import javax.xml.soap.SOAPConnection;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPElement;
    // add this import if you need soapaction
    import javax.xml.soap.MimeHeaders;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamResult;
    import com.sun.xml.messaging.saaj.*;
    import java.net.URL;
    import javax.xml.soap.*;
    import java.util.Iterator;
    import javax.xml.soap.Name;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPBody;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPBodyElement;
    import javax.xml.messaging.ReqRespListener;
    import java.text.NumberFormat;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamResult;
    import com.sun.xml.messaging.saaj.*;
    * <p>Page bean that corresponds to a similarly named JSP page. This
    * class contains component definitions (and initialization code) for
    * all components that you have defined on this page, as well as
    * lifecycle methods and event handlers where you may add behavior
    * to respond to incoming events.</p>
    import javax.xml.messaging.JAXMServlet;
    //extends JAXMServlet
    public class Page1 extends AbstractPageBean implements ReqRespListener{
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
    * <p>Automatically managed component initialization. <strong>WARNING:</strong>
    * This method is automatically generated, so any user-specified code inserted
    * here is subject to being replaced.</p>
    private void _init() throws Exception {
    private Page page1 = new Page();
    public Page getPage1() {
    return page1;
    public void setPage1(Page p) {
    this.page1 = p;
    private Html html1 = new Html();
    public Html getHtml1() {
    return html1;
    public void setHtml1(Html h) {
    this.html1 = h;
    private Head head1 = new Head();
    public Head getHead1() {
    return head1;
    public void setHead1(Head h) {
    this.head1 = h;
    private Link link1 = new Link();
    public Link getLink1() {
    return link1;
    public void setLink1(Link l) {
    this.link1 = l;
    private Body body1 = new Body();
    public Body getBody1() {
    return body1;
    public void setBody1(Body b) {
    this.body1 = b;
    private Form form1 = new Form();
    public Form getForm1() {
    return form1;
    public void setForm1(Form f) {
    this.form1 = f;
    private Button button1 = new Button();
    public Button getButton1() {
    return button1;
    public void setButton1(Button b) {
    this.button1 = b;
    private TextArea textArea1 = new TextArea();
    public TextArea getTextArea1() {
    return textArea1;
    public void setTextArea1(TextArea ta) {
    this.textArea1 = ta;
    private TextArea textArea2 = new TextArea();
    public TextArea getTextArea2() {
    return textArea2;
    public void setTextArea2(TextArea ta) {
    this.textArea2 = ta;
    // </editor-fold>/*
    public MessageFactory messageFactSent= null;
    public MessageFactory messageFactReply=null;
    public MessageFactory messageFactReceiv= null;
    public SOAPConnectionFactory soapConnectionFact;
    public URL URLendpoint;
    public SOAPConnection connection ;
    public SOAPMessage messageSent;
    public SOAPPart soapPartSent;
    public SOAPEnvelope soapEnvelopeSent;
    public SOAPBody SoapBodySent;
    public SOAPMessage messageReceiv;
    public SOAPPart soapPartReceiv;
    public SOAPEnvelope soapEnvelopeReceiv;
    public SOAPBody SoapBodyReceiv;
    public SOAPMessage messageReply;
    public SOAPPart soapPartReply;
    public SOAPEnvelope soapEnvelopeReply;
    public SOAPBody SoapBodyReply;
    public SOAPMessage reply;
    public String StringAux="";
    public final String theURI = "http://172.16.5.223:8080/WebApplication1/";
    //public final String theURI = "http://172.16.5.223:8080/WebApplication1/";
    //public final String theURI = "http://172.16.5.193:8080/WebApplication1/";
    //http://localhost:8080/WebApplication1/faces/Page1.jsp
    public SOAPMessage onMessage(SOAPMessage message) {
    StringAux=StringAux+"On message called in receiving servlet\n";
    this.textArea1.setValue(StringAux);
    try {
    soapPartReceiv = message.getSOAPPart( );
    soapEnvelopeReceiv = soapPartReceiv.getEnvelope();
    SoapBodyReceiv = soapEnvelopeReceiv.getBody();
    //analise...if needed
    // Create the reply message
    messageReply = messageFactReply.createMessage();
    soapEnvelopeReply = messageReply.getSOAPPart().getEnvelope();
    SoapBodyReply= soapEnvelopeReply.getBody();
    // Remove empty header from the Envelope
    soapEnvelopeReply.getHeader().detachNode();
    Name bodyName = soapEnvelopeReply.createName("GetLastTradePrice",
    "m", "http://wombat.ztrade.com");
    SOAPBodyElement gltp = SoapBodyReply.addBodyElement(bodyName);
    Name name = soapEnvelopeReply.createName("symbol");
    SOAPElement symbol = gltp.addChildElement(name);
    symbol.addTextNode("SUNW");
    // Return a reply message back to the JAXM client
    StringAux=StringAux+"devolveu menssagem\n";
    this.textArea1.setValue(StringAux);
    return messageReply ;
    } catch(Exception e) {
    StringAux=StringAux+"Error in processi ng or replying to a message - e: " + e+"\n";
    this.textArea1.setValue(StringAux);
    return null;
    //this.getBean(name)
    public Page1() {
    // Service serve=new Service();
    // Client cli=new Client();
    // this.textArea1.setValue(serve.GetAux());
    // this.textArea2.setValue(cli.GetAux());
    // Create a MessageFactory
    try {
    URLendpoint=new URL(theURI);
    StringAux=StringAux+"depois de criar o endpoint \n";
    //Create SOAP connection
    soapConnectionFact = SOAPConnectionFactory.newInstance();
    connection = soapConnectionFact.createConnection();
    // Create a message from the message factory.
    messageFactSent = MessageFactory.newInstance();
    messageFactReply = MessageFactory.newInstance();
    messageFactReceiv = MessageFactory.newInstance();
    StringAux=StringAux+"depois de criar as message factory \n";
    this.textArea1.setValue(StringAux);
    } catch(Throwable e) {
    StringAux="erro2!\n"+StringAux+e.toString()+"\n";
    this.textArea1.setValue(StringAux);
    * <p>Return a reference to the scoped data bean.</p>
    protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1)getBean("ApplicationBean1");
    * <p>Return a reference to the scoped data bean.</p>
    protected RequestBean1 getRequestBean1() {
    return (RequestBean1)getBean("RequestBean1");
    * <p>Return a reference to the scoped data bean.</p>
    protected SessionBean1 getSessionBean1() {
    return (SessionBean1)getBean("SessionBean1");
    * <p>Callback method that is called whenever a page is navigated to,
    * either directly via a URL, or indirectly via page navigation.
    * Customize this method to acquire resources that will be needed
    * for event handlers and lifecycle methods, whether or not this
    * page is performing post back processing.</p>
    * <p>Note that, if the current request is a postback, the property
    * values of the components do <strong>not</strong> represent any
    * values submitted with this request. Instead, they represent the
    * property values that were saved for this view when it was rendered.</p>
    public void init() {
    // Perform initializations inherited from our superclass
    super.init();
    // Perform application initialization that must complete
    // before managed components are initialized
    // TODO - add your own initialiation code here
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
    // Initialize automatically managed components
    // Note - this logic should NOT be modified
    try {
    _init();
    } catch (Exception e) {
    log("Page1 Initialization Failure", e);
    throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
    // </editor-fold>
    // Perform application initialization that must complete
    // after managed components are initialized
    // TODO - add your own initialization code here
    * <p>Callback method that is called after the component tree has been
    * restored, but before any event processing takes place. This method
    * will <strong>only</strong> be called on a postback request that
    * is processing a form submit. Customize this method to allocate
    * resources that will be required in your event handlers.</p>
    public void preprocess() {
    * <p>Callback method that is called just before rendering takes place.
    * This method will <strong>only</strong> be called for the page that
    * will actually be rendered (and not, for example, on a page that
    * handled a postback and then navigated to a different page). Customize
    * this method to allocate resources that will be required for rendering
    * this page.</p>
    public void prerender() {
    * <p>Callback method that is called after rendering is completed for
    * this request, if <code>init()</code> was called (regardless of whether
    * or not this was the page that was actually rendered). Customize this
    * method to release resources acquired in the <code>init()</code>,
    * <code>preprocess()</code>, or <code>prerender()</code> methods (or
    * acquired during execution of an event handler).</p>
    public void destroy() {
    public String button1_action() {
    try {
    StringAux=StringAux+"antes de criar a messagem para enviar\n";
    messageSent = messageFactSent.createMessage();
    soapEnvelopeSent = messageSent.getSOAPPart().getEnvelope();
    //SoapBodySent = messageSent.getSOAPPart().getEnvelope().getBody();
    SoapBodySent = soapEnvelopeSent.getBody();
    Name bodyName = soapEnvelopeSent .createName("GetLastTradePrice",
    "m", "http://wombat.ztrade.com");
    SOAPBodyElement gltp = SoapBodySent.addBodyElement(bodyName);
    Name name = soapEnvelopeSent.createName("symbol");
    SOAPElement symbol = gltp.addChildElement(name);
    symbol.addTextNode("SUNW");
    StringAux=StringAux+"\nContent of the message: \n"+messageSent.toString()+"\n";
    // Send the SOAP message and get reply
    StringAux=StringAux+"Sending message to URL: \n"+ URLendpoint+"\n"+this.URLendpoint.getPath()+"\n";
    reply = connection.call(messageSent,URLendpoint);
    StringAux=StringAux+"\n\n Content of the reply message: \n"+reply.toString()+"\n";
    this.textArea1.setValue(StringAux);
    //tratamento da resposta
    connection.close();
    } catch(Throwable e) {
    StringAux="erro!\n"+StringAux+e.toString()+"\n";
    this.textArea1.setValue(StringAux);
    return null;
    Very simple , on a click of the button a message was supost to be sent. and receive on the other machine. i have launched the same war file on both pcs
    but now nothing happens just a exception message
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP
    ....could someone help me out here ,even share a wprking project with this goal
    thank you in advance
    DMS
    Message was edited by:
    DaniDaOne

    One time, after quitting IM and re-launching it later, my project disappeared from the project list.
    Apple Support told me to do this.
    1) quit IM
    2) with the finder, move the project out of the project directory
    3) launch IM
    4) quit IM
    5) with the finder, put the project back into the project directory
    6) launch IM
    My project re-appeared. He said these steps forces a project index to be rebuilt.
    Your symptoms are different but maybe the cure is the same --- good luck.

  • Help - Premature end of file Exception while using saaj

    Hi Everyone,
    I have written a sample saaj client, with a string as an attachment and trying to send it to a servlet as shown in the example below:
    * SaajClient.java
    * Created on June 23, 2004, 5:49 PM
    * @author Krishna Menon
    import javax.xml.soap.*;
    import javax.xml.messaging.URLEndpoint;
    public class SaajClient {
    public SaajClient() throws Exception
    try{
    SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
    SOAPPart soapPart = soapMessage.getSOAPPart();
    SOAPEnvelope envelope = soapPart.getEnvelope();
    SOAPHeader header = envelope.getHeader();
    SOAPBody body = envelope.getBody();
    header.detachNode();
    String str = "Something a;alskdjf;laksjdfl;akjsdf;lk ;alskdjfl;asjdfl;ajk ;kdls a;kl";
    if(soapMessage != null)
    AttachmentPart attachment = soapMessage.createAttachmentPart();
    attachment.setContentType("text/plain");
    attachment.setContent(str,"text/plain");
    attachment.setContentId("Sample_String");
    soapMessage.addAttachmentPart(attachment);
    soapMessage.saveChanges();
    SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
    URLEndpoint endpoint = new URLEndpoint("http://10.2.1.132:8080/WebServices/servlet/AttachmentReceiver");
    SOAPMessage response = connection.call(soapMessage,endpoint);
    response.writeTo(System.out);
    }catch(Exception e)
    System.out.println("Caught in constructor");
    e.printStackTrace();
    public static void main(String args[])
    try
    SaajClient client = new SaajClient();
    }catch(Exception e)
    e.printStackTrace();
    When I run the above program, it is giving the following exception:
    Caught in constructor
    javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:110)
    at SaajClient.<init>(SaajClient.java:58)
    at SaajClient.main(SaajClient.java:74)
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:543)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
    at org.apache.axis.client.Call.invoke(Call.java:2553)
    at org.apache.axis.client.Call.invoke(Call.java:1753)
    at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:105)
    ... 2 more
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1139)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
    ... 7 more
    If anybody has a solution for it, please post it here.
    Thanks in advance,
    With Regards,
    Krishna Menon. B.

    Hi
    Actually the problem is not with the client but with the servlet I think. In the servlet, I am able to retrieve the attachment and print its content. After receiving the Message, I am creating a new message and populating its body with a new child element and returning the message back to the client. Just Before returning the message, I am getting the Axis Fault error in the log file. I am giving the code for the Servlet I have used below:
    * AttachmentReceiver.java
    * Created on June 23, 2004, 7:11 PM
    * @author Krishna Menon
    import java.util.Iterator;
    import javax.servlet.ServletException;
    import javax.xml.messaging.JAXMServlet;
    import javax.xml.messaging.ReqRespListener;
    import javax.xml.soap.AttachmentPart;
    import javax.xml.soap.MessageFactory;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPMessage;
    import javax.xml.soap.SOAPPart;
    import javax.xml.soap.SOAPFactory;
    * Servlet that accepts a SOAP message and looks through
    * its attachments before sending the SOAP part of the message
    * to the console and sending back a response
    * @author Krishna Menon
    public class AttachmentReceiver extends JAXMServlet implements ReqRespListener {
    private MessageFactory fac;
    public void init() throws ServletException {
    try {
    fac = MessageFactory.newInstance();
    catch( Exception ex ) {
    System.out.println("In AttachmentReceiver init");
    ex.printStackTrace();
    throw new ServletException( ex );
    // This is the application code for handling the message.. Once the
    // message is received the application can retrieve the soap part, the
    // attachment part if there are any, or any other information from the
    // message.
    public SOAPMessage onMessage( SOAPMessage message ) {
    System.out.println( "On message called in receiving servlet" );
    try {
    System.out.println( "\nMessage Received: " );
    System.out.println( "\n============ start ============\n" );
    // dump out attachments
    System.out.println( "Number of Attachments: " + message.countAttachments() );
    int i = 1;
    for( Iterator it = message.getAttachments(); it.hasNext(); i++ ) {
    AttachmentPart ap = (AttachmentPart) it.next();
    System.out.println( "Attachment #" + i + " content type : " +
    ap.getContentType() );
    System.out.println("Attachment Content ::"+ap.getContent());
    // dump out the SOAP part of the message
    SOAPPart soapPart = message.getSOAPPart();
    System.out.println( "SOAP Part of Message:\n\n" + soapPart );
    System.out.println( "\n============ end ===========\n" );
    SOAPMessage msg = fac.createMessage();
    SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
    SOAPFactory soapFactory = SOAPFactory.newInstance();
    System.out.println("Before getBody");
    env.getBody().addChildElement(soapFactory.createName("MessageResponse")).addTextNode("From Attachment Servlet"+"\nYour Attachment Received");
    System.out.println("After getBody");
    //addChildElement("MessageResponse").addTextNode("From Attachment Servlet"+"\nYour Attachment Received");
    msg.saveChanges();
    System.out.println("After Msg Save Changes");
    return msg;
    catch( Exception e ) {
    System.out.println("From OnMessage() of AttachmentReceiver");
    e.printStackTrace();
    return null;
    This is generating the following series of errors in the catalina.out (Tomcat4.1 error log ) file:
    On message called in receiving servlet
    Message Received:
    ============ start ============
    Number of Attachments: 1
    Attachment #1 content type : text/plain
    SOAP Part of Message:
    org.apache.axis.SOAPPart@16fdac
    ============ end ===========
    - java.io.IOException:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.lang.ClassCastException
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace: java.lang.ClassCastException
         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:173)
         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509)
         at org.apache.axis.message.MessageElement.output(MessageElement.java:783)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
         at org.apache.axis.Message.writeTo(Message.java:440)
         at javax.xml.messaging.JAXMServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
         at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
         at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:534)
    java.lang.ClassCastException
         at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:272)
         at org.apache.axis.Message.writeTo(Message.java:440)
         at javax.xml.messaging.JAXMServlet.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
         at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
         at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
         at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.ClassCastException
         at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:173)
         at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509)
         at org.apache.axis.message.MessageElement.output(MessageElement.java:783)
         at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
         ... 33 more

  • Problem may be with saaj.jar and AXIS,WAS,WSAD

    Hi,
    I have successfully developed and deployed an EJB using WSAD 5.1.2's WebSphere 5.0 Test Environment. I have even able to access the EJB using UTC(Universal Test Client) in WSAD and by launching the j2ee client module using
    WebSphere lauchClient program.
    Basically I have below directory structure:
    a.ear
    --|-----axis.war
    -----------|------ lib
    --------------------|--- all axis related jars are here
    --|-----demoEjb.jar (has java jar dependencies set to axis.war\lib jars
    I have now exposed this ejb as web service using AXIS 1.2 RC2 deployed as web module inside WSAD. This web service is properly exposed as web service as I can see it and access its wsdl when I access axis web services.
    Now I have written a standalone-outside-wsad web service client that uses AXIS stubs and when I try to consume to this ejb web service I am getting below error.
    AxisFault
    faultCode: {http://xml.apache.org/axis/}HTTP
    faultSubcode:
    faultString: (500)Internal Server Error
    faultActor:
    faultNode:
    faultDetail:
    {}:return code: 500
    Error 500: class org.apache.axis.SOAPPart does not implement interface org.w3c.dom.Document
    {http://xml.apache.org/axis/}HttpErrorCode:500
    (500)Internal Server Error
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:663)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:94)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:147)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2719)
    at org.apache.axis.client.Call.invoke(Call.java:2702)
    at org.apache.axis.client.Call.invoke(Call.java:2378)
    at org.apache.axis.client.Call.invoke(Call.java:2301)
    at org.apache.axis.client.Call.invoke(Call.java:1758)
    at com.sosnoski.test.DemoBindingStub.getAccountHistory(DemoBindingStub.java:194)
    at com.sosnoski.test.Client.query(Client.java:63)
    at com.sosnoski.test.Client.main(Client.java:100)
    I read somewhere with axis mailing lists that it is problem related to axis's saaj.jar and wsad's websphere 5.0
    test environment's webservices.jar so I even replaced my wsad installation's D:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.2\runtimes\base_v5\lib\webservices.jar with
    saaj.jar but this did not help and even I have added an references to saaj.jar usign wsad's websphere 5.0 test environment
    environment tab->ws.ext.dirs property and even this did not help.
    Can anyone please tell me why is error occurring and how to solve it ?
    Thanks & Regards,
    Kumar.

    Yes :-)
    At the ear level, set the Classloader mode to PARENT_FIRST and WAR classloader policy to APPLICATION. At the axis web module level, set the Classloader mode to PARENT_LAST
    We can colloborate to our future efforts if you can please give your active personal id from which you can respond faster for queries ....

  • How to get SAAJ impl. working on 9.0.4 (Lehmann?)

    Hi,
    I'm currently working on an assignment which needs to leverage functionality as described by the SAAJ spec. Since I had/have trouble getting the SAAJ (10.0.3) impl from Oracle working on either 9.0.3/9.0.4 OC4J, I'm currently developing against the developer's preview of OC4J J2EE 1.4. However, since it looks like J2EE 1.4 support (by OC4J) will not be available by the end of summer 2004, I need to get SAAJ working for OC4J 9.0.4. Can someone provide me with the details how this can be achieved. I know Michael has made some notes on how AXIS can be deployed on OC4J 9.0.3 and since that package (can) also uses SAAJ, I was hoping there is some kind of step-by-step configuration note.
    Regards,
    Jan.

    As I'm progressing my assignment to create an application using SAAJ (on OC4J) I ran into a problem. As I mentioned earlier whenever I redeploy the application, I have to cycle the OC4J engine, in order to circumvente the error "DataContentHandlerFactory already defined". Each subsequent call will result in NoClassDefFoundError. Anyways....
    To simulate a peer service, I also deployed the application with different settings (web.xml/application.xml) on the same engine. Silly me, because this obviously leads to the problems stated above. Digging a bit further I came across the following bugtrack about SAAJ/JAXM (on Sun):
    # 4825743: Description: Web Service with attachment and its client cannot be deployed separately to the same web container.
    Due to a known JAXM bug (#4763995), deploying a web service with attachment to a web container and then deploying its test client separately to the same web container will result the following exception:
    java.lang.Error: DataContentHandlerFactory already defined at
      javax.activation.DataHandler.setDataContentHandlerFactory(DataHandler.java:628) at
      com.sun.xml.messaging.saaj.soap.AttachmentPartImpl.<clinit>(AttachmentPartImpl.java:35) at
      com.sun.xml.messaging.saaj.soap.MessageImpl.createAttachmentPart(MessageImpl.java:305)Workaround: Always deploy a web service with an attachment with its default test client.
    (Ref: http://developer.java.sun.com/developer/bugParade/bugs/4825743.html)
    If I understand correctly sun has managed to fix this JAXM bug. The trace I get with the Oracle implementation of SAAJ is very, very similar, so I believe the same mistake has been made. Can you confirm this and are there plans to fix this?

  • SOAP Implementation missing methods

    Hello,
    I am developing a document based SOAP web service and I wish to add a
    DOM Document to the SOAP Body. Looking at the Java 2 Platform
    Enterprise Edition 1.4 specification on the Sun web site I have found
    the following method "public SOAPBodyElement addDocument(Document
    document)", which does exactly what I require. Although when I attempt
    to call this method I get the following exception:
    java.lang.AbstractMethodError:
    weblogic.webservice.core.soap.SOAPBodyImpl.addDocument(Lorg/w3c/dom/Document;)Ljavax/xml/soap/SOAPBodyElement;
    Has this method not been implemented in Weblogic 8.1? Any suggestions
    would be very much appreciated.
    Thanks, Stuart

    Hi Stuart,
    The addDocument(org.w3c.dom.Document) method was introduced in SAAJ 1.2. The SAAJ
    implementation in WLS 8.1 is version 1.1. SAAJ 1.2 will be supported in a future
    service pack or release.
    For now, you can still achieve what it sounds like you want to do (i.e. send the
    XML contained in an org.w3c.dom.Document to a "document-style" web service, as
    the immediate child element of the <SOAP-ENV:Body> element, in the SOAP request
    message), using the javax.xml.rpc.Call object. You just need to call the setProperty(Call.OPERATION_STYLE,
    "document") method, on the Call object you create in your web service consumer
    code. You don't have to do this with a Stub model web service consumer, because
    the WSDL will (or should) have a style="document" attribute, on the <soap:binding>
    element :-)
    Regards,
    Mike Wooten
    Stuart Williamson <[email protected]> wrote:
    Hello,
    I am developing a document based SOAP web service and I wish to add a
    DOM Document to the SOAP Body. Looking at the Java 2 Platform
    Enterprise Edition 1.4 specification on the Sun web site I have found
    the following method "public SOAPBodyElement addDocument(Document
    document)", which does exactly what I require. Although when I attempt
    to call this method I get the following exception:
    java.lang.AbstractMethodError:
    weblogic.webservice.core.soap.SOAPBodyImpl.addDocument(Lorg/w3c/dom/Document;)Ljavax/xml/soap/SOAPBodyElement;
    Has this method not been implemented in Weblogic 8.1? Any suggestions
    would be very much appreciated.
    Thanks, Stuart

  • What is the most up to date implementation of web services in Java?

    I'm completely new to web services and just got confused. I installed Sun App Server 9 Update 1 Patch 1 and successfully deployed some simple web services with it. Later I found sth that is called Web Services Developer Pack 2.0 but it can't use Sun App Server 9 as a container ... and requires the older version (8.1 as far as I can remember). Does it mean that JWSDP 2.0 is out of date ... and Sun App Serv 9 has bult-in web services implementation?
    Please can anyone highlight me this subject?
    Thanks!
    Artur

    ok ... just answering my own question ;)
    that's what I found on sun's website:
    the Java Web Services Developer Pack will no longer be developed as a discrete release vehicle for the Web services and XML technologies that the Java WSDP shares with Project GlassFish.
    The current release of Java Web Services Developer Pack, Version 2.0, contains the new JAX-WS 2.0 EA, JAXB 2.0 EA, and SAAJ 1.3 EA implementations, the "integrated stack" for Web services. These components are now available as FCS-quality releases in Project GlassFish.
    as far as I know ... correct me if I'm wrong ... Sun App Server 9 is based on Proj Glassfish.

  • Changing SOAP-ENV prefix in SAAJ?

    I'm using the latest webservices pack from Sun and have hit a roadblock.
    We have some external clients that are relying on the SOAP messages we send them to have the prefix namespace <SOAP>. The SAAJ implementation seems to be hardcoding <SOAP-ENV>.
    Is there anyway to specify/override the default SOAP namespace prefix?
    i.e.
    <SOAP-ENV:Envelope> --> <SOAP:Envelope>
    Thanks,
    - Tim

    I managed to change my SOAP-ENV but the problem then is that unless you declare the namespace in every tag it add a xmlns="" to the first non specified tag.
    how I changed the SOAP-ENV is as follows
    SOAPPart part = msg.getSOAPPart();
    //get the envelope
    SOAPEnvelope envelope = part.getEnvelope();
    //add the soap declaration
    envelope.addNamespaceDeclaration("soap","http://schemas.xmlsoap.org/soap/envelope/");
    //remove the default SOAP-ENV
    envelope.removeNamespaceDeclaration("SOAP-ENV");
    //Set the prefix to soap instead of SOAP-ENV
    envelope.setPrefix("soap");
    Mike

  • SAAJ with sessions

    Hi all,
    Is it possible to implement SAAJ service with sessions? If so, can some one guide me to implement it?
    Thanks
    varma

    Hi,
    Could you please explain this a little bit more?
    I need to do the exact same thing, but I have no clue how...
    Thanks,
    Kristof.

  • SAAJ  vs JAX-RPC

    Hi Team,
    Whats the differences implementing web service clients  using SAAJ and JAX-RPC ?
    Do we have any performance related differences between these two ?
    If I am not worng, SAAJ dynamic way of calling web services which means that it will create SOAP message on fly for every request.
    So SAAJ  may take more time comapred to implementing the clients using JAX-RPC.
    Please correct me if my assumption is wrong.
    Thanks,Anil
    Edited by: Anilkumar Vippagunta on Jan 29, 2008 1:50 AM
    Edited by: Anilkumar Vippagunta on Jan 29, 2008 1:50 AM

    Hi Anil
    For more details have  alook on these links
    http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0bbd890-0201-0010-51bd-97029689f44b
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f98c731d-0e01-0010-dfa5-dfb8f49dac6e
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ede71ec7-0701-0010-c08c-e284d530f384
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3b28e590-0201-0010-968f-e10ed5328191
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90a5266f-f721-2a10-7fb1-cefceb106ecf
    Regds
    Abhishek

  • WSDL in SAAJ

    I have a conceptual problem as follows:
    In the Coffee Break example, I can get the WSDL of the JAX-RPC Web services, i.e. at:
    http://localhost:8080/jaxrpc-coffee-supplier/jaxrpc?WSDL
    But for the SAAJ Web Services, since it is a servlet application, is there WSDL there? If there is no, is the SAAJ still can be called "Web Services"? Or it just use the SOAP but not WSDL?
    Thanks.

    Well, there must exist a WSDL in order to get it. In the Coffee Break example, there are no WSDL files for the web services that are implemented with SAAJ. In the case of the JAX-RPC web services, the WSDL is generated via wsdeploy tool. There is no tool to generate a WSDL for a SAAJ web service, and there is really no need for such. Can you please share the reason why you need to have a WSDL for the SAAJ web services?
    Regards

Maybe you are looking for