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 "Bill Keese (JIRA)" <ax...@ws.apache.org> on 2005/01/27 03:11:18 UTC

[jira] Created: (AXIS-1784) Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode

Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode
-----------------------------------------------------------------------------------------------

         Key: AXIS-1784
         URL: http://issues.apache.org/jira/browse/AXIS-1784
     Project: Axis
        Type: Bug
    Versions: 1.2RC2    
    Reporter: Bill Keese
    Priority: Minor


Axis generates xsi:type=... attribute definitions even in literal mode.  It shouldn't.  The fix should be in SerializationContext:

            sendXSIType = ( msgContext.getOperationUse() == Use.ENCODED );

(or something like that).

Also, ArraySerializer() has the following code which shouldn't be executed except for RPC/Encoded mode:
            if (typeI != -1) {
                attrs.setAttribute(typeI,
                                   schema.getXsiURI(),
                                   "type",
                                   qname,
                                   "CDATA",
                                   context.qName2String(soapArray));
            } else {
                attrs.addAttribute(schema.getXsiURI(),
                                   "type",
                                   qname,
                                   "CDATA",
                                   context.qName2String(soapArray));
            }


Workaround:

In client code, do

     call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);



-- 
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] Commented: (AXIS-1784) Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1784?page=comments#action_58135 ]
     
Davanum Srinivas commented on AXIS-1784:
----------------------------------------

hmmm..so just the fix to call.java is not enough. can you please upload your sample test case / wsdl and client code.

thanks,
dims

> Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode
> -----------------------------------------------------------------------------------------------
>
>          Key: AXIS-1784
>          URL: http://issues.apache.org/jira/browse/AXIS-1784
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC2
>     Reporter: Bill Keese
>     Priority: Minor

>
> Axis generates xsi:type=... attribute definitions even in literal mode.  It shouldn't.  The fix should be in SerializationContext:
>             sendXSIType = ( msgContext.getOperationUse() == Use.ENCODED );
> (or something like that).
> Also, ArraySerializer() has the following code which shouldn't be executed except for RPC/Encoded mode:
>             if (typeI != -1) {
>                 attrs.setAttribute(typeI,
>                                    schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             } else {
>                 attrs.addAttribute(schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             }
> Workaround:
> In client code, do
>      call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);

-- 
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] Commented: (AXIS-1784) Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode

Posted by "Bill Keese (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1784?page=comments#action_58132 ]
     
Bill Keese commented on AXIS-1784:
----------------------------------

I just noticed that Call.setOperation(String opName) does this logic:

        Use use = bEntry.getInputBodyType(bop.getOperation());
        setOperationUse(use);
        if (use == Use.LITERAL) {
            // Turn off encoding
            setEncodingStyle(null);
            // turn off XSI types
            setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        }

Maybe the logic should be inside of setOperationUse() rather than inside setOperation().  Then it would work even when there wasn't a WSDL file.

Also, note that (as stated above) ArraySerializer doesn't strictly obey the SEND_TYPE_ATTR flag.

> Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode
> -----------------------------------------------------------------------------------------------
>
>          Key: AXIS-1784
>          URL: http://issues.apache.org/jira/browse/AXIS-1784
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC2
>     Reporter: Bill Keese
>     Priority: Minor

>
> Axis generates xsi:type=... attribute definitions even in literal mode.  It shouldn't.  The fix should be in SerializationContext:
>             sendXSIType = ( msgContext.getOperationUse() == Use.ENCODED );
> (or something like that).
> Also, ArraySerializer() has the following code which shouldn't be executed except for RPC/Encoded mode:
>             if (typeI != -1) {
>                 attrs.setAttribute(typeI,
>                                    schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             } else {
>                 attrs.addAttribute(schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             }
> Workaround:
> In client code, do
>      call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);

-- 
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] Commented: (AXIS-1784) Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1784?page=comments#action_58136 ]
     
Davanum Srinivas commented on AXIS-1784:
----------------------------------------

Can you please try latest nightly? (http://cvs.apache.org/dist/axis/nightly/)

thanks,
dims

> Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode
> -----------------------------------------------------------------------------------------------
>
>          Key: AXIS-1784
>          URL: http://issues.apache.org/jira/browse/AXIS-1784
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC2
>     Reporter: Bill Keese
>     Priority: Minor

>
> Axis generates xsi:type=... attribute definitions even in literal mode.  It shouldn't.  The fix should be in SerializationContext:
>             sendXSIType = ( msgContext.getOperationUse() == Use.ENCODED );
> (or something like that).
> Also, ArraySerializer() has the following code which shouldn't be executed except for RPC/Encoded mode:
>             if (typeI != -1) {
>                 attrs.setAttribute(typeI,
>                                    schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             } else {
>                 attrs.addAttribute(schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             }
> Workaround:
> In client code, do
>      call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);

-- 
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-1784) Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode

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

Bill Keese updated AXIS-1784:
-----------------------------

    Attachment: array.zip

I tried against the latest version and it still happens (worse yet, printing the wrong type information).  So, I am attaching a testcase I wrote for another bug.  Just run with TCPMON and look at the request XML that the client sends.  Since I am sending basic types there should be no "xsi:type=..." information.

> Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode
> -----------------------------------------------------------------------------------------------
>
>          Key: AXIS-1784
>          URL: http://issues.apache.org/jira/browse/AXIS-1784
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC2
>     Reporter: Bill Keese
>     Priority: Minor
>  Attachments: array.zip
>
> Axis generates xsi:type=... attribute definitions even in literal mode.  It shouldn't.  The fix should be in SerializationContext:
>             sendXSIType = ( msgContext.getOperationUse() == Use.ENCODED );
> (or something like that).
> Also, ArraySerializer() has the following code which shouldn't be executed except for RPC/Encoded mode:
>             if (typeI != -1) {
>                 attrs.setAttribute(typeI,
>                                    schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             } else {
>                 attrs.addAttribute(schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             }
> Workaround:
> In client code, do
>      call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);

-- 
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] Commented: (AXIS-1784) Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode

Posted by "Ias (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-1784?page=comments#action_58212 ]
     
Ias commented on AXIS-1784:
---------------------------

FYI,

xsi:type attribute can be used even in literal encoding when indicating a derived type. Please refer to http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#xsi_type_Attributes as well.

> Axis client should not generate xsi:type attributes in document/literal or wrapped/literal mode
> -----------------------------------------------------------------------------------------------
>
>          Key: AXIS-1784
>          URL: http://issues.apache.org/jira/browse/AXIS-1784
>      Project: Axis
>         Type: Bug
>     Versions: 1.2RC2
>     Reporter: Bill Keese
>     Priority: Minor

>
> Axis generates xsi:type=... attribute definitions even in literal mode.  It shouldn't.  The fix should be in SerializationContext:
>             sendXSIType = ( msgContext.getOperationUse() == Use.ENCODED );
> (or something like that).
> Also, ArraySerializer() has the following code which shouldn't be executed except for RPC/Encoded mode:
>             if (typeI != -1) {
>                 attrs.setAttribute(typeI,
>                                    schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             } else {
>                 attrs.addAttribute(schema.getXsiURI(),
>                                    "type",
>                                    qname,
>                                    "CDATA",
>                                    context.qName2String(soapArray));
>             }
> Workaround:
> In client code, do
>      call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);

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