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 "jeff ling (JIRA)" <ji...@apache.org> on 2006/11/20 03:49:01 UTC

[jira] Created: (AXIS2-1747) Unexpected subelement Name

Unexpected subelement Name
--------------------------

                 Key: AXIS2-1747
                 URL: http://issues.apache.org/jira/browse/AXIS2-1747
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: wsdl
    Affects Versions: 1.1
         Environment: Windows
            Reporter: jeff ling


When the generated stub processes response, it expects the nodes come in a specific order. If the order is different, exception is thrown. 

The code is in parse() methods of different result processing factory. 

For example, the code:
/// process the "first" element "IsPrivacyChanged"
if (reader.isStartElement()
           ...
              "IsPrivacyChanged").equals(reader.getName())) {
read the value
}else
{
   throw exception
} 

///now it processes 2nd element.
if (reader.isStartElement()
           ...
              "Name").equals(reader.getName())) {
read the value
}else
{
   throw exception
} 

If "Name" came in before "IsPrivacyChanged", exception is thrown. 

A loop should be used, and any elements can appear in any order.



-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-1747) Unexpected subelement Name

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-1747.
-------------------------------------------------

    Resolution: Fixed

Now both sequence and all elements in complex type has implemented correctly.

> Unexpected subelement Name
> --------------------------
>
>                 Key: AXIS2-1747
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1747
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.1
>         Environment: Windows
>            Reporter: jeff ling
>         Assigned To: Amila Chinthaka Suriarachchi
>
> When the generated stub processes response, it expects the nodes come in a specific order. If the order is different, exception is thrown. 
> The code is in parse() methods of different result processing factory. 
> For example, the code:
> /// process the "first" element "IsPrivacyChanged"
> if (reader.isStartElement()
>            ...
>               "IsPrivacyChanged").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> ///now it processes 2nd element.
> if (reader.isStartElement()
>            ...
>               "Name").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> If "Name" came in before "IsPrivacyChanged", exception is thrown. 
> A loop should be used, and any elements can appear in any order.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-1747) Unexpected subelement Name

Posted by "Chuck Williams (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-1747?page=comments#action_12451256 ] 
            
Chuck Williams commented on AXIS2-1747:
---------------------------------------

What is your wsdl?  The generated parse() methods respect the wsdl.  For example, a sequence particle requires the elements to be in order, whereas a choice particle does not.  These are the correct semantics.  The parse() methods implement the semantics as specified in the wsdl.


> Unexpected subelement Name
> --------------------------
>
>                 Key: AXIS2-1747
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1747
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.1
>         Environment: Windows
>            Reporter: jeff ling
>
> When the generated stub processes response, it expects the nodes come in a specific order. If the order is different, exception is thrown. 
> The code is in parse() methods of different result processing factory. 
> For example, the code:
> /// process the "first" element "IsPrivacyChanged"
> if (reader.isStartElement()
>            ...
>               "IsPrivacyChanged").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> ///now it processes 2nd element.
> if (reader.isStartElement()
>            ...
>               "Name").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> If "Name" came in before "IsPrivacyChanged", exception is thrown. 
> A loop should be used, and any elements can appear in any order.

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-1747) Unexpected subelement Name

Posted by "jeff ling (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS2-1747?page=comments#action_12451214 ] 
            
jeff ling commented on AXIS2-1747:
----------------------------------

Here is how I would fix this issue:

          int cnt =0;
          while (true)
          {
            if (cnt++ == 5)
              break;
            
          while (!reader.isStartElement() && !reader.isEndElement())
            reader.next();

          if (reader.isStartElement()
            && new javax.xml.namespace.QName(
              "http://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
              "Name").equals(reader.getName())) {

            java.lang.String content = reader.getElementText();

            object.setName(org.apache.axis2.databinding.utils.ConverterUtil
              .convertToString(content));

            reader.next();
            continue;

          } // End of if for expected property start element


          if (reader.isStartElement()
            && new javax.xml.namespace.QName(
              "http://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
              "Privacy").equals(reader.getName())) {

            object.setPrivacy(Privacy.Factory.parse(reader));

            reader.next();
            continue;
          } // End of if for expected property start element


          if (reader.isStartElement()
            && new javax.xml.namespace.QName(
              "http://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
              "Values").equals(reader.getName())) {

            object.setValues(ArrayOfValueData.Factory.parse(reader));

            reader.next();
            continue;

          } // End of if for expected property start element


          if (reader.isStartElement()
            && new javax.xml.namespace.QName(
              "http://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
              "IsPrivacyChanged").equals(reader.getName())) {

            java.lang.String content = reader.getElementText();

            object
              .setIsPrivacyChanged(org.apache.axis2.databinding.utils.ConverterUtil
                .convertToBoolean(content));

            reader.next();
            continue;

          } // End of if for expected property start element



          if (reader.isStartElement()
            && new javax.xml.namespace.QName(
              "http://microsoft.com/webservices/SharePointPortalServer/UserProfileService",
              "IsValueChanged").equals(reader.getName())) {

            java.lang.String content = reader.getElementText();

            object
              .setIsValueChanged(org.apache.axis2.databinding.utils.ConverterUtil
                .convertToBoolean(content));

            reader.next();
              continue;
          } // End of if for expected property start element
          }//end of while


> Unexpected subelement Name
> --------------------------
>
>                 Key: AXIS2-1747
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1747
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.1
>         Environment: Windows
>            Reporter: jeff ling
>
> When the generated stub processes response, it expects the nodes come in a specific order. If the order is different, exception is thrown. 
> The code is in parse() methods of different result processing factory. 
> For example, the code:
> /// process the "first" element "IsPrivacyChanged"
> if (reader.isStartElement()
>            ...
>               "IsPrivacyChanged").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> ///now it processes 2nd element.
> if (reader.isStartElement()
>            ...
>               "Name").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> If "Name" came in before "IsPrivacyChanged", exception is thrown. 
> A loop should be used, and any elements can appear in any order.

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-1747) Unexpected subelement Name

Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-1747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas updated AXIS2-1747:
------------------------------------

    Assignee: Amila Chinthaka Suriarachchi

> Unexpected subelement Name
> --------------------------
>
>                 Key: AXIS2-1747
>                 URL: https://issues.apache.org/jira/browse/AXIS2-1747
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.1
>         Environment: Windows
>            Reporter: jeff ling
>         Assigned To: Amila Chinthaka Suriarachchi
>
> When the generated stub processes response, it expects the nodes come in a specific order. If the order is different, exception is thrown. 
> The code is in parse() methods of different result processing factory. 
> For example, the code:
> /// process the "first" element "IsPrivacyChanged"
> if (reader.isStartElement()
>            ...
>               "IsPrivacyChanged").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> ///now it processes 2nd element.
> if (reader.isStartElement()
>            ...
>               "Name").equals(reader.getName())) {
> read the value
> }else
> {
>    throw exception
> } 
> If "Name" came in before "IsPrivacyChanged", exception is thrown. 
> A loop should be used, and any elements can appear in any order.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org