Axis
  1. Axis
  2. AXIS-2777

Error occurs only in Java 6 but it is fine in Java 1.4: SAAJ0007: Bad endPoint type (endPoint instance of URL)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      OS: Windows XP

      Description

      After we switch from Java 1.4 to Java 6, we got an error from a SOAP call:

      SEVERE: SAAJ0007: Bad endPoint type (endPoint instance of URL)

      Here is the code segment for the SOAP call:

      String body = "some body string"
      MessageFactoryImpl mf = new MessageFactoryImpl();
      MimeHeaders headers = new MimeHeaders();
      headers.addHeader("SOAPAction", "some action string");
      InputStream soapStream = new ByteArrayInputStream(body.getBytes());
      SOAPMessage msg = mf.createMessage(headers, soapStream);

      SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();
      SOAPConnection connection = connectionFactory.createConnection();
      URLEndpoint url = new URLEndpoint("some url string");
      javax.xml.soap.SOAPMessage message = null;
      try

      {message = connection.call(msg, url);}

      catch (Exception e)

      { System.out.println(e.getMessage());}

      Message tempMessage = (Message) message;
      System.out.println(tempMessage.getSOAPPartAsString());

      1. test.zip
        2.30 MB
        William Chau

        Activity

        Hide
        Dobri Kitipov added a comment -

        Hi William,
        can you please provide me with the whole client code and the imports it has? Do you have any further observations over the problem?

        Thank you,
        Dobri

        Show
        Dobri Kitipov added a comment - Hi William, can you please provide me with the whole client code and the imports it has? Do you have any further observations over the problem? Thank you, Dobri
        Hide
        William Chau added a comment -

        Hi Dorbi,

        I am attaching the files for you to replicate the issue. Below are the run with Java 6 (with SAAJ0007 error) and Java 1.4 (with 403 code but it is fine).

        ======================================================

        C:\svn-bisweb\trunk\test>set JAVA_HOME=C:\jdk1.6.0_04

        C:\svn-bisweb\trunk\test>ant clean run
        Buildfile: build.xml

        clean:
        [delete] Deleting 1 files from C:\svn-bisweb\trunk\test

        compile:
        [javac] Compiling 1 source file to C:\svn-bisweb\trunk\test

        run:
        [java] Feb 25, 2009 2:46:11 PM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectio
        n call
        [java] Bad endPoint type http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/movie
        functions.asmx
        [java] SEVERE: SAAJ0007: Bad endPoint type (endPoint instance of URL)
        [java] e.getMessage():null

        BUILD SUCCESSFUL
        Total time: 1 second

        ======================================================

        C:\svn-bisweb\trunk\test>set JAVA_HOME=C:\j2sdk1.4.2_08

        C:\svn-bisweb\trunk\test>ant clean run
        Buildfile: build.xml

        clean:
        [delete] Deleting 1 files from C:\svn-bisweb\trunk\test

        compile:
        [javac] Compiling 1 source file to C:\svn-bisweb\trunk\test

        run:
        [java] (403)Forbidden
        [java] e.getMessage():null

        BUILD SUCCESSFUL
        Total time: 1 second

        Show
        William Chau added a comment - Hi Dorbi, I am attaching the files for you to replicate the issue. Below are the run with Java 6 (with SAAJ0007 error) and Java 1.4 (with 403 code but it is fine). ====================================================== C:\svn-bisweb\trunk\test>set JAVA_HOME=C:\jdk1.6.0_04 C:\svn-bisweb\trunk\test>ant clean run Buildfile: build.xml clean: [delete] Deleting 1 files from C:\svn-bisweb\trunk\test compile: [javac] Compiling 1 source file to C:\svn-bisweb\trunk\test run: [java] Feb 25, 2009 2:46:11 PM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnectio n call [java] Bad endPoint type http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/movie functions.asmx [java] SEVERE: SAAJ0007: Bad endPoint type (endPoint instance of URL) [java] e.getMessage():null BUILD SUCCESSFUL Total time: 1 second ====================================================== C:\svn-bisweb\trunk\test>set JAVA_HOME=C:\j2sdk1.4.2_08 C:\svn-bisweb\trunk\test>ant clean run Buildfile: build.xml clean: [delete] Deleting 1 files from C:\svn-bisweb\trunk\test compile: [javac] Compiling 1 source file to C:\svn-bisweb\trunk\test run: [java] (403)Forbidden [java] e.getMessage():null BUILD SUCCESSFUL Total time: 1 second
        Hide
        Andreas Veithen added a comment -

        Note that Java 6 comes bundled with it's own implementation of SAAJ and the error message has a format that is typical for Sun's SAAJ implementation. I'm more familiar with Axis2 than Axis, but my guess is that instead of Axis, the code actually invokes Sun's SAAJ implementation. To get around this, you will probably have to play around with the endorsed directory or set some system properties to configure Axis as the SAAJ implementation.

        Show
        Andreas Veithen added a comment - Note that Java 6 comes bundled with it's own implementation of SAAJ and the error message has a format that is typical for Sun's SAAJ implementation. I'm more familiar with Axis2 than Axis, but my guess is that instead of Axis, the code actually invokes Sun's SAAJ implementation. To get around this, you will probably have to play around with the endorsed directory or set some system properties to configure Axis as the SAAJ implementation.
        Hide
        William Chau added a comment -

        What system properties should I set to override the Sun implementation with the Axis' one?

        Show
        William Chau added a comment - What system properties should I set to override the Sun implementation with the Axis' one?
        Hide
        Andreas Veithen added a comment -

        javax.xml.soap.SOAPFactory, javax.xml.soap.MessageFactory and javax.xml.soap.SOAPConnectionFactory. They should point to the corresponding implementations in Axis. I guess they are called SOAPFactoryImpl, MessageFactoryImpl and SOAPConnectionFactoryImpl.

        Show
        Andreas Veithen added a comment - javax.xml.soap.SOAPFactory, javax.xml.soap.MessageFactory and javax.xml.soap.SOAPConnectionFactory. They should point to the corresponding implementations in Axis. I guess they are called SOAPFactoryImpl, MessageFactoryImpl and SOAPConnectionFactoryImpl.
        Hide
        William Chau added a comment -

        Thanks a lot! I was able to get my code working by changing:

        SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection connection = connectionFactory.createConnection();

        to:

        SOAPConnection connection = new SOAPConnectionImpl();

        Show
        William Chau added a comment - Thanks a lot! I was able to get my code working by changing: SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance(); SOAPConnection connection = connectionFactory.createConnection(); to: SOAPConnection connection = new SOAPConnectionImpl();

          People

          • Assignee:
            Unassigned
            Reporter:
            William Chau
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development