You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Bhaanu Prakash Madhineni (JIRA)" <ax...@ws.apache.org> on 2005/02/06 17:08:29 UTC

[jira] Created: (AXIS-1803) action attrbute with application/soap+xml media type in SOAP 1.2 request

action attrbute with application/soap+xml media type in SOAP 1.2 request
------------------------------------------------------------------------

         Key: AXIS-1803
         URL: http://issues.apache.org/jira/browse/AXIS-1803
     Project: Axis
        Type: Bug
    Versions: 1.2RC2    
 Environment: windows 2000, Java version 1.4.2_04
    Reporter: Bhaanu Prakash Madhineni
 Attachments: Version.java, soap1.2-request.txt

I modified the Version class found in "org.apache.axis" to send a SOAP 1.2 call. The code looks a s below:

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

/*
 * Copyright 2001-2004 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import org.apache.axis.client.Call;
import org.apache.axis.utils.Messages;
import org.apache.axis.soap.SOAPConstants;
/**
 * Little utility to get the version and build date of the axis.jar.
 *
 * The messages referenced here are automatically kept up-to-date by the
 * build.xml.
 *
 * @author Glen Daniels (gdaniels@apache.org)
 */
public class Version {
    /**
     * Get the version of this AXIS.
     *
     * @return the version of this axis
     */
    public static String getVersion()
    {
        return Messages.getMessage("axisVersion") + "\n" +
               Messages.getMessage("builtOn");
    }

    /**
     *  Returns the Axis Version number and build date.
     *  <p>
     *  Example output: 1.1 Jul 08, 2003 (09:00:12 EDT)
     *
     * @return the full version of this axis
     **/
    public static String getVersionText()
    {
        return Messages.getMessage("axisVersionRaw") + " " + Messages.getMessage("axisBuiltOnRaw");
    }

    /**
     * Entry point.
     * <p>
     * Calling this with no arguments returns the version of the client-side
     * axis.jar.  Passing a URL which points to a remote Axis server will
     * attempt to retrieve the version of the server via a SOAP call.
     */
    public static void main(String[] args) {
        if (args.length != 1)
            System.out.println(getVersion());
        else
            try {
                Call call = new Call(args[0]);
                //Sending SOAP 1.2 call
                call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
                String result = (String)call.invoke("Version", "getVersion",
                                                    null);
                System.out.println(result);
            } catch (Exception e) {
                e.printStackTrace();
            }
    }
}

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

The resultant SOAP request generated was as below:

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

POST /axis/servlet/AxisServlet HTTP/1.0

Content-Type: application/soap+xml; charset=UTF-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.2RC2

Host: 127.0.0.1:2020

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 322



<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getVersion soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="Version"/></soapenv:Body></soapenv:Envelope>

-----------------------------
As you can notice that the Action attribute as specified in the http://www.w3.org/TR/soap12-part2/#ietf-action is not set automatically. Instead, the SOAP 1.1 style of SOAPAction: "" header is used. I tried to modify the SOAP request using TCP Monitor and both the below versions gave errors. The relavent errors sent by Axis are also pasted below.

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

Request:
------
POST /axis/servlet/AxisServlet HTTP/1.0

Content-Type: application/soap+xml; charset=UTF-8; action=""
Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.2RC2

Host: 127.0.0.1:2020

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 322


<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getVersion soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="Version"/></soapenv:Body></soapenv:Envelope>


Response:
--------
HTTP/1.1 500 Internal Server Error

Server: Apache-Coyote/1.1

Content-Type: text/xml; action="";charset=utf-8

Date: Sun, 06 Feb 2005 15:53:40 GMT

Connection: close

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

Request:
----
POST /axis/servlet/AxisServlet HTTP/1.0
Content-Type: application/soap+xml; action=""; charset=UTF-8; 
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.2RC2
Host: 127.0.0.1:2020

Cache-Control: no-cache
Pragma: no-cache
Content-Length: 322

Response:
--------
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getVersion soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="Version"/></soapenv:Body></soapenv:Envelope>

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




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (AXIS-1803) action attrbute with application/soap+xml media type in SOAP 1.2 request

Posted by "Bhaanu Prakash Madhineni (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1803?page=history ]

Bhaanu Prakash Madhineni updated AXIS-1803:
-------------------------------------------

    Attachment: Version.java
                soap1.2-request.txt

Version.java contains an extra line of code to send SOAP 1.2 request.
soap1.2-request.txt shows the standard SOAP 1.2 kind of request generated by Axis using the code in above java file.

> action attrbute with application/soap+xml media type in SOAP 1.2 request
> ------------------------------------------------------------------------
>
>          Key: AXIS-1803
>          URL: http://issues.apache.org/jira/browse/AXIS-1803
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC2
>  Environment: windows 2000, Java version 1.4.2_04
>     Reporter: Bhaanu Prakash Madhineni
>  Attachments: Version.java, soap1.2-request.txt
>
> I modified the Version class found in "org.apache.axis" to send a SOAP 1.2 call. The code looks a s below:
> ------------------------
> /*
>  * Copyright 2001-2004 The Apache Software Foundation.
>  *
>  * Licensed under the Apache License, Version 2.0 (the "License");
>  * you may not use this file except in compliance with the License.
>  * You may obtain a copy of the License at
>  *
>  *      http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing, software
>  * distributed under the License is distributed on an "AS IS" BASIS,
>  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  * See the License for the specific language governing permissions and
>  * limitations under the License.
>  */
> import org.apache.axis.client.Call;
> import org.apache.axis.utils.Messages;
> import org.apache.axis.soap.SOAPConstants;
> /**
>  * Little utility to get the version and build date of the axis.jar.
>  *
>  * The messages referenced here are automatically kept up-to-date by the
>  * build.xml.
>  *
>  * @author Glen Daniels (gdaniels@apache.org)
>  */
> public class Version {
>     /**
>      * Get the version of this AXIS.
>      *
>      * @return the version of this axis
>      */
>     public static String getVersion()
>     {
>         return Messages.getMessage("axisVersion") + "\n" +
>                Messages.getMessage("builtOn");
>     }
>     /**
>      *  Returns the Axis Version number and build date.
>      *  <p>
>      *  Example output: 1.1 Jul 08, 2003 (09:00:12 EDT)
>      *
>      * @return the full version of this axis
>      **/
>     public static String getVersionText()
>     {
>         return Messages.getMessage("axisVersionRaw") + " " + Messages.getMessage("axisBuiltOnRaw");
>     }
>     /**
>      * Entry point.
>      * <p>
>      * Calling this with no arguments returns the version of the client-side
>      * axis.jar.  Passing a URL which points to a remote Axis server will
>      * attempt to retrieve the version of the server via a SOAP call.
>      */
>     public static void main(String[] args) {
>         if (args.length != 1)
>             System.out.println(getVersion());
>         else
>             try {
>                 Call call = new Call(args[0]);
>                 //Sending SOAP 1.2 call
>                 call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
>                 String result = (String)call.invoke("Version", "getVersion",
>                                                     null);
>                 System.out.println(result);
>             } catch (Exception e) {
>                 e.printStackTrace();
>             }
>     }
> }
> ---------------------------------------------
> The resultant SOAP request generated was as below:
> -----------------
> POST /axis/servlet/AxisServlet HTTP/1.0
> Content-Type: application/soap+xml; charset=UTF-8
> Accept: application/soap+xml, application/dime, multipart/related, text/*
> User-Agent: Axis/1.2RC2
> Host: 127.0.0.1:2020
> Cache-Control: no-cache
> Pragma: no-cache
> SOAPAction: ""
> Content-Length: 322
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getVersion soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="Version"/></soapenv:Body></soapenv:Envelope>
> -----------------------------
> As you can notice that the Action attribute as specified in the http://www.w3.org/TR/soap12-part2/#ietf-action is not set automatically. Instead, the SOAP 1.1 style of SOAPAction: "" header is used. I tried to modify the SOAP request using TCP Monitor and both the below versions gave errors. The relavent errors sent by Axis are also pasted below.
> --------------------------
> Request:
> ------
> POST /axis/servlet/AxisServlet HTTP/1.0
> Content-Type: application/soap+xml; charset=UTF-8; action=""
> Accept: application/soap+xml, application/dime, multipart/related, text/*
> User-Agent: Axis/1.2RC2
> Host: 127.0.0.1:2020
> Cache-Control: no-cache
> Pragma: no-cache
> SOAPAction: ""
> Content-Length: 322
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getVersion soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="Version"/></soapenv:Body></soapenv:Envelope>
> Response:
> --------
> HTTP/1.1 500 Internal Server Error
> Server: Apache-Coyote/1.1
> Content-Type: text/xml; action="";charset=utf-8
> Date: Sun, 06 Feb 2005 15:53:40 GMT
> Connection: close
> ----------------------------------------------------------------------------------------
> Request:
> ----
> POST /axis/servlet/AxisServlet HTTP/1.0
> Content-Type: application/soap+xml; action=""; charset=UTF-8; 
> Accept: application/soap+xml, application/dime, multipart/related, text/*
> User-Agent: Axis/1.2RC2
> Host: 127.0.0.1:2020
> Cache-Control: no-cache
> Pragma: no-cache
> Content-Length: 322
> Response:
> --------
> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getVersion soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="Version"/></soapenv:Body></soapenv:Envelope>
> -----------------------------------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira