You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org> on 2004/11/09 02:51:33 UTC

[jira] Created: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Errors in handling minOccurs="0" (optional) elemnts in SOAP message 
--------------------------------------------------------------------

         Key: AXISCPP-250
         URL: http://nagoya.apache.org/jira/browse/AXISCPP-250
     Project: Axis-C++
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.3 Final    
 Environment: All platforrms
    Reporter: Samisa Abeysinghe
    Priority: Critical


The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :

> All elements in the response have minOccurs="0", so they can be 
omitted. Is this another issue?

Good point Adrian! I missed that :(.
This must be the reason that is causing the problem.

To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
to this conclusion by
looking at the generated code for the WSDL). It expects all the 
elements to be there, and throws
an error, if at least a single element is missing.
Also, the ordering of the element is very critical for the generated 
code to work.

e.g.
param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
"names",0);
param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
"addrs",0);
param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);

(the '0' parameters in above code indicates that namespace is NULL - it 
must have used NULL
instead of 0)

If "xdirInd" is missing in the response, and "noOfBillRecords" is 
present,
getElementAsString("xdirInd",0) call on the serializer will see that 
next element is
"noOfBillRecords" and will error. 
If we are looking for an optional element, we are doing a serious 
mistake here (and thus this is a
serious bug)
The correct logic would be to 
1. Test if the element is opetional
   if yes
       1.1. Test if the current element is what we are looking for
       if yes
           1.1.1 return Success
       if no
           1.1.2 Back track to point to the start of the elemnt and 
return Success
   if no
       1.2 return Failure

I hope the above algorithm does not violate the pull model we have. 

Additionally, can we expect the SOAP message to have the elements in 
the same order defined by the
WSDL? If yes (I think it is) we are OK. If not we have another bug :(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/AXISCPP-250?page=comments#action_55229 ]
     
Samisa Abeysinghe commented on AXISCPP-250:
-------------------------------------------

Adrian!
   If possible, please attach your WSDL here so that anyone who is going to fix this could use it as a test case.

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://nagoya.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Priority: Critical

>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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] Assigned: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "John Hawkins (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-250?page=history ]

John Hawkins reassigned AXISCPP-250:
------------------------------------

    Assign To: Adrian Dick

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Assignee: Adrian Dick
>     Priority: Critical
>  Attachments: WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

-- 
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: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-250?page=all ]

Chinthana Danapala updated AXISCPP-250:
---------------------------------------

    Attachment: SOAP_message.txt

I have tested and add the new test for the test frame work to check MinOccurs="0". Now code is supporting well MinOccurs="0" cases. Here I have attached the SOAP message of the test I have added.

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Assignee: Chinthana Danapala
>     Priority: Critical
>  Attachments: SOAP_message.txt, WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

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


[jira] Commented: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "John Hawkins (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-250?page=comments#action_64365 ]
     
John Hawkins commented on AXISCPP-250:
--------------------------------------

Adrian - has this been fixed in 1.5 ? We did a lot of work in his area.

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Priority: Critical
>  Attachments: WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

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


[jira] Resolved: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-250?page=all ]
     
Chinthana Danapala resolved AXISCPP-250:
----------------------------------------

    Resolution: Fixed

(Visible to axiscpp-developers)


> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Assignee: Chinthana Danapala
>     Priority: Critical
>  Attachments: SOAP_message.txt, WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

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


[jira] Updated: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Adrian Smith (JIRA)" <ax...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/AXISCPP-250?page=history ]

Adrian Smith updated AXISCPP-250:
---------------------------------

    Attachment: WS021A.wsdl

Sample WSDL as requested

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://nagoya.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Priority: Critical
>  Attachments: WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-250?page=comments#action_12314294 ] 

Chinthana Danapala commented on AXISCPP-250:
--------------------------------------------

MinOccurs="0" can be appear with constructs "all", "choice" and "any" and the other occasions also.
In the constructs "all" and "choice" newly supported by tool and they capable of handling minOccurs="0" situations.
I have to check with the "sequence" and other situations.
If not I have to make the changes like in "all" construct.


> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Assignee: Chinthana Danapala
>     Priority: Critical
>  Attachments: WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

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


[jira] Assigned: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Adrian Dick (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-250?page=history ]

Adrian Dick reassigned AXISCPP-250:
-----------------------------------

    Assign To:     (was: Adrian Dick)

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Priority: Critical
>  Attachments: WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

-- 
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] Assigned: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-250?page=all ]

Chinthana Danapala reassigned AXISCPP-250:
------------------------------------------

    Assign To: Chinthana Danapala

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Assignee: Chinthana Danapala
>     Priority: Critical
>  Attachments: WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

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


[jira] Commented: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Steve Hardy (JIRA)" <ax...@ws.apache.org>.
     [ http://nagoya.apache.org/jira/browse/AXISCPP-250?page=comments#action_56891 ]
     
Steve Hardy commented on AXISCPP-250:
-------------------------------------

The same thing happens when you have a

<xs:choice>
  <xs:element name="a" type="xsd:int">
  <xs:element name="b" tpye="xsd:int">
</xs:choice>

because you have minOccurs = 0 for all the fields.

Also, there is no way of creating the struct (class) in c++ to show that a simple type is 'missing'. ie you can't set 'a' to NULL because it is not a pointer. 

The best option would be to have a union-like structure like

struct choice {
  enum type { a,b };
  union {
    int a;
    int b;
  } value;
}

and have the serialiser / deserialiser only send/receive the one field that we want transmitting / receiving. I currently send a union struct with about 20 fields, of which only ever 1 is used. This is currently transmitted as zero's in all the unused fields, which is rather wasteful.

> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://nagoya.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Priority: Critical
>  Attachments: WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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] Closed: (AXISCPP-250) Errors in handling minOccurs="0" (optional) elemnts in SOAP message

Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-250?page=all ]
     
Chinthana Danapala closed AXISCPP-250:
--------------------------------------


(Visible to axiscpp-developers)


> Errors in handling minOccurs="0" (optional) elemnts in SOAP message
> -------------------------------------------------------------------
>
>          Key: AXISCPP-250
>          URL: http://issues.apache.org/jira/browse/AXISCPP-250
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization
>     Versions: 1.3 Final
>  Environment: All platforrms
>     Reporter: Samisa Abeysinghe
>     Assignee: Chinthana Danapala
>     Priority: Critical
>  Attachments: SOAP_message.txt, WS021A.wsdl
>
> The following is from the mailing list. See http://marc.theaimsgroup.com/?t=109902729200001&r=1&w=2 for more information :
> > All elements in the response have minOccurs="0", so they can be 
> omitted. Is this another issue?
> Good point Adrian! I missed that :(.
> This must be the reason that is causing the problem.
> To my knowledge, WSDL2Ws tool does not deal with this correctly (I came 
> to this conclusion by
> looking at the generated code for the WSDL). It expects all the 
> elements to be there, and throws
> an error, if at least a single element is missing.
> Also, the ordering of the element is very critical for the generated 
> code to work.
> e.g.
> param->names = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "names",0);
> param->addrs = (xsd__string_Array&)pIWSDZ->getBasicArray(XSD_STRING, 
> "addrs",0);
> param->xdirInd = pIWSDZ->getElementAsString("xdirInd",0);
> param->noOfBillRecords = pIWSDZ->getElementAsInt("noOfBillRecords",0);
> (the '0' parameters in above code indicates that namespace is NULL - it 
> must have used NULL
> instead of 0)
> If "xdirInd" is missing in the response, and "noOfBillRecords" is 
> present,
> getElementAsString("xdirInd",0) call on the serializer will see that 
> next element is
> "noOfBillRecords" and will error. 
> If we are looking for an optional element, we are doing a serious 
> mistake here (and thus this is a
> serious bug)
> The correct logic would be to 
> 1. Test if the element is opetional
>    if yes
>        1.1. Test if the current element is what we are looking for
>        if yes
>            1.1.1 return Success
>        if no
>            1.1.2 Back track to point to the start of the elemnt and 
> return Success
>    if no
>        1.2 return Failure
> I hope the above algorithm does not violate the pull model we have. 
> Additionally, can we expect the SOAP message to have the elements in 
> the same order defined by the
> WSDL? If yes (I think it is) we are OK. If not we have another bug :(

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