6 Replies Latest reply on Mar 9, 2005 1:25 PM by zeroman

    What's the difference between 'official' Axis 1.1 and Jboss

    zeroman

      I'm trying to use Jboss-4.0.1 Axis 1.1 for accessing sforce.com WS. They are support Axis 1.1 but I can't compile their example using Jboss Axis version.
      I'm getting compile error for the code. Error is in:

      binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);

      it says there is no such method signature like that.

      'sh' is type of
      package com.sforce.soap.enterprise;
      public class _SessionHeader implements java.io.Serializable {...}

      If I trying to work this code around I'm getting 'Session Id is invalid' error. I can invoke 'login command' but then I can't supply gotten SessionId for the next WS calls.

      Sforce.com folks say they don't know the difference between official Axis 1.1 and Jboss Axis 1.1 fork.

      Does somebody encounter this problem. Sorry I supplied not much information about the problem.

      Any help are welcome.
      Thanks.

        • 1. Re: What's the difference between 'official' Axis 1.1 and Jb
          zeroman

           

          "zeroman" wrote:
          I'm trying to use Jboss-4.0.1 Axis 1.1 for accessing sforce.com WS.
          Thanks.


          Just want add a little. When I use Axis 1.2RC2 standalone version the code compiles and runs properly w/o any problems. Jbooss version 4.0.1, JDK 1.4.2. Axis libs are taken from the:
          \jboss-4.0.1\server\default\deploy\jboss-ws4ee.sar\

          What do you suggest in this case?

          Can I attach or email this piece of code somewhere?

          • 2. Re: What's the difference between 'official' Axis 1.1 and Jb
            thomas.diesler

            JBossWS is about portable J2EE compliant web services, which by definitition should not have a dependency on a particular SOAP stack.

            If sforce.com offers an example that uses standard J2EE WS clients, then this is the one you want to use.

            The Axis example is irrelevant.

            • 3. Re: What's the difference between 'official' Axis 1.1 and Jb
              thomas.diesler

               

              The Axis example is irrelevant.


              It is irrelevant for J2EE-1.4 compliant web services, it is good to have if you plan to use an Axis client, which JBossWS is not.

              • 4. Re: What's the difference between 'official' Axis 1.1 and Jb
                zeroman

                 

                "thomas.diesler@jboss.com" wrote:

                It is irrelevant for J2EE-1.4 compliant web services, it is good to have if you plan to use an Axis client, which JBossWS is not.


                Thanks Thomas.

                The main goal is to use JbossWS WITH sforce.com ws and other already running web-services from other 'vendors'. I'd like to do it in the simple manner but I see here is run-time error from the sforce.com service as it doesn't see 'session ID' I've set up to the SAOP header.
                I don't see a reason for that now. Also I see a lot of questions in the JbossWS forum it's not a very good sign.

                I'll try to ask for the 'J2EE-1.4 compliant web services' example.

                Thank you.

                • 5. Re: What's the difference between 'official' Axis 1.1 and Jb
                  zeroman

                   

                  "zeroman" wrote:
                  I'll try to ask for the 'J2EE-1.4 compliant web services' example.


                  Looking at the post:
                  "axis1.2 with tomcat 4 deployed in jboss4.01"
                  http://www.jboss.org/index.html?module=bb&op=viewtopic&t=61200
                  I'd like to ask one more thing.

                  Is it possible to 'mix' usage of Jboss.NET and JbossWS libs by an accident?
                  I mean following...
                  I'm using several libraries for stub generation (WSDL2Java) and for testing ws access from the client console application. I'm using libs in class path:

                  jboss-4.0.1\server\default\deploy\jboss-ws4ee.sar\
                  axis-ws4ee.jar
                  commons-discovery.jar
                  commons-logging.jar
                  jboss-ws4ee.jar
                  - jboss-ws4ee.war - can be ommitted
                  wsdl4j.jar

                  I saw you were talking about: \lib\jboss-jaxrpc.jar, \lib\jboss-saaj.jar
                  bu I don't need them for my test class.

                  But I found I need one more library jboss-net-client.jar as test console client code fails w/o class org.jboss.net.jmx.adaptor.attributeSerFactory.
                  Is it right or am I doing something wrong? Does it mean I've mixed Jboss.NET and JbossWS?


                  • 6. Something strang in the Jboss code.
                    zeroman

                    Hi Thomas.

                    I found something strange in the Jboss code. Can you explain me what happens there? What's the main difference between library versions? Is it possible to 'patch' it?

                    I'm using JbossWS libs from the
                    \jboss-4.0.1\server\default\deploy\jboss-ws4ee.sar\
                    I'm not sure if I use correct libraries... Correct me if I'm wrong.

                    As I told I was exploring sforce.com Axis examples. Their example works with Axis 1.2rc2 but doesn't work with JbossWS.
                    They have a code which sets SessionID into the SAOP header for the subsequent WS calls. Session Id is gotten from the first 'login' command.

                    It is described as

                    public class SoapBindingStub
                    extends org.apache.axis.client.Stub
                    implements com.sforce.soap.enterprise.Soap
                    ........
                    
                    com.sforce.soap.enterprise.SoapBindingStub binding;
                    ....
                    


                    They are using the 'simple java bean Handler class for setting Session ID
                    public class _SessionHeader implements java.io.Serializable {
                     private java.lang.String sessionId;
                     ....
                    }
                    
                    com.sforce.soap.enterprise._SessionHeader sh = new _SessionHeader();
                    ....
                    binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);
                    


                    Class org.apache.axis.client.Stub
                    from the
                    \jboss-src-4.0.1\jaxrpc\src\main\org\apache\axis\client\Stub.java
                    doesn't have method with such signature.

                    org.apache.axis.client.Stub.setHeader(String, String, Object);
                    

                    althought that signature is present in the Axis 1.2RC2

                    So I use changed code assuming it will work
                    binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh.getSessionId());
                    

                    but it doesn't work.

                    When I try to get this Header's value
                    Object sessionHeaderObject = s._getProperty("SessionHeader");
                    

                    sessionHeaderObject is NULL.


                    ----------------------

                    I was trying to get all headers using different libaries (JbossWS 4.0.1, Axis 1.2RC2. I used CODE like that:
                    org.apache.axis.message.SOAPHeaderElement{} array = binding.getHeaders();
                     for (int i = 0; i < array.length; i++) {
                     SOAPHeaderElementImpl soapHeaderElement = array{i};
                     javax.xml.soap.SOAPHeaderElement soapHeaderElement = array{i};
                     System.out.println("SAOP header element = " + soapHeaderElement.toString());
                     System.out.println("SAOP header getNamespaceURI = " + soapHeaderElement.getNamespaceURI());
                     System.out.println("SAOP header getPrefix = " + soapHeaderElement.getPrefix());
                     System.out.println("SAOP header element = " + soapHeaderElement.toString());
                     }
                    


                    I was getting different RESULTS using :
                    class type of javax.xml.soap.SOAPHeaderElement from Axis 1.2RC2
                    SAOP header element = <ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:ns1="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">njRq6Ptg37ohqutyqzZdicUzejphrTZe90b6Yx3XBYtMNeGJRcxMpik7n0_TXAXxHikyGE8ui0DF16GKmkejIzteaH1xyGi1</ns1:SessionHeader>
                    SAOP header getNamespaceURI = urn:enterprise.soap.sforce.com
                    SAOP header getPrefix = null
                    SAOP header element = <ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:ns1="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">njRq6Ptg37ohqutyqzZdicUzejphrTZe90b6Yx3XBYtMNeGJRcxMpik7n0_TXAXxHikyGE8ui0DF16GKmkejIzteaH1xyGi1</ns1:SessionHeader>
                    


                    /b]CODE for class type of org.apache.axis.message.SOAPHeaderElement from Axis 1.2RC2
                    org.apache.axis.message.SOAPHeaderElement soapHeaderElement = array{i};
                    System.out.println("SAOP header element = " + soapHeaderElement.toString());
                    System.out.println("SAOP header getName = " + soapHeaderElement.getName());
                    System.out.println("SAOP header getNamespaceURI = " + soapHeaderElement.getNamespaceURI());
                    System.out.println("SAOP header getObjectValue = " + soapHeaderElement.getObjectValue());
                    System.out.println("SAOP header getPrefix = " + soapHeaderElement.getPrefix());
                    System.out.println("SAOP header element = " + soapHeaderElement.toString());
                    


                    RESULT for class type of org.apache.axis.message.SOAPHeaderElement from Axis 1.2RC2 is:
                    SAOP header element = <ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:ns1="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">X6K9mxCxCwt8VslHrxCERNHOJbcgz5NySWCriQPvp6vnupNeluKZg6fMFpj6VJCNAZMpziQrc6T7Brk1325sIjteaH1xyGi1</ns1:SessionHeader>
                    SAOP header getName = SessionHeader
                    SAOP header getNamespaceURI = urn:enterprise.soap.sforce.com
                    SAOP header getObjectValue = X6K9mxCxCwt8VslHrxCERNHOJbcgz5NySWCriQPvp6vnupNeluKZg6fMFpj6VJCNAZMpziQrc6T7Brk1325sIjteaH1xyGi1
                    SAOP header getPrefix = null
                    SAOP header element = <ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:ns1="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">X6K9mxCxCwt8VslHrxCERNHOJbcgz5NySWCriQPvp6vnupNeluKZg6fMFpj6VJCNAZMpziQrc6T7Brk1325sIjteaH1xyGi1</ns1:SessionHeader>
                    


                    CODE using JbossWS is
                    org.apache.axis.message.SOAPHeaderElementImpl{} array = binding.getHeaders();
                     for (int i = 0; i < array.length; i++) {
                     org.apache.axis.message.SOAPHeaderElementImpl soapHeaderElement = array{i}
                     System.out.println("SAOP header element = " + soapHeaderElement.toString());
                     System.out.println("SAOP header getAsString = " + soapHeaderElement.getAsString());
                     System.out.println("SAOP header getName = " + soapHeaderElement.getName());
                     System.out.println("SAOP header getNamespaceURI = " + soapHeaderElement.getNamespaceURI());
                     System.out.println("SAOP header getObjectValue = " + soapHeaderElement.getObjectValue());
                     System.out.println("SAOP header getPrefix = " + soapHeaderElement.getPrefix());
                     System.out.println("SAOP header element = " + soapHeaderElement.toString());
                     }
                    


                    The RESULT using JBossWS class type of
                    org.apache.axis.message.SOAPHeaderElementImpl
                    SAOP header element = org.apache.axis.message.SOAPHeaderElementAxisImpl@3727c5[[SessionHeader: null]]
                    SAOP header getAsString = <ns1:SessionHeader xmlns:ns1="urn:enterprise.soap.sforce.com">HCY0lblqY8J7iTWfZvb5VALuJklpiwyZHBUlvW_pzick2FdSniwTfhLxCr4jqCGRmwjD7ZX3V5tecUgw5Q7gPDteaH1xyGi1</ns1:SessionHeader>
                    SAOP header getName = SessionHeader
                    SAOP header getNamespaceURI = urn:enterprise.soap.sforce.com
                    SAOP header getObjectValue = HCY0lblqY8J7iTWfZvb5VALuJklpiwyZHBUlvW_pzick2FdSniwTfhLxCr4jqCGRmwjD7ZX3V5tecUgw5Q7gPDteaH1xyGi1
                    SAOP header getPrefix = null
                    SAOP header element = org.apache.axis.message.SOAPHeaderElementAxisImpl@3727c5[[SessionHeader: null]]