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 "Fred Preston (JIRA)" <ax...@ws.apache.org> on 2005/02/16 11:17:46 UTC
[jira] Created: (AXISCPP-442) The methods in the stubs do not initialise the return value
The methods in the stubs do not initialise the return value
-----------------------------------------------------------
Key: AXISCPP-442
URL: http://issues.apache.org/jira/browse/AXISCPP-442
Project: Axis-C++
Type: Bug
Components: WSDL processing
Environment: n/a
Reporter: Fred Preston
The following code sample highlights the problem:-
xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
{
xsd__dateTime Ret;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
...
When the code is compiled, the following error results: "<dir>\Service.cpp(nnnn) : error C4700: local variable 'Ret' used without having been initialized"
The solution to the problem would be to initialise the return value when it is declared. Thus the code would become:-
xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
{
xsd__dateTime Ret = {0,0,0,0,0,0,0,0,0};
try
{
if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
...
--
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: (AXISCPP-442) The methods in the stubs do not initialise the return value
Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-442?page=comments#action_59852 ]
Chinthana Danapala commented on AXISCPP-442:
--------------------------------------------
This changes for wsdl type RPC ClientStubWrit
Index: c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
===================================================================
RCS file: /home/cvspublic/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java,v
retrieving revision 1.72
diff -r1.72 ClientStubWriter.java
354a355
> writer.write("\tmemset(&Ret,0,sizeof(" + outparamTypeName + "));\n");
369c370
< writer.write(outparamTypeName + "* Ret;\n");
---
> writer.write(outparamTypeName + "* Ret=NULL;\n");
376c377
< writer.write(outparamTypeName + "* Ret;\n");
---
> writer.write(outparamTypeName + "* Ret=NULL;\n");
Success, CVS operation completed
> The methods in the stubs do not initialise the return value
> -----------------------------------------------------------
>
> Key: AXISCPP-442
> URL: http://issues.apache.org/jira/browse/AXISCPP-442
> Project: Axis-C++
> Type: Bug
> Components: WSDL processing
> Environment: n/a
> Reporter: Fred Preston
> Assignee: Samisa Abeysinghe
>
> The following code sample highlights the problem:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret;
> try
> { if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
> When the code is compiled, the following error results: "<dir>\Service.cpp(nnnn) : error C4700: local variable 'Ret' used without having been initialized"
> The solution to the problem would be to initialise the return value when it is declared. Thus the code would become:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret = {0,0,0,0,0,0,0,0,0};
> try
> {
> if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
--
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: (AXISCPP-442) The methods in the stubs do not initialise the return value
Posted by "Fred Preston (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-442?page=comments#action_59243 ]
Fred Preston commented on AXISCPP-442:
--------------------------------------
rather than using = 0 or = {0,0,0...}, use the following method to initialise:-
xsd_type Ret;
memset( *Ret, 0, sizeof( xsd_type));
> The methods in the stubs do not initialise the return value
> -----------------------------------------------------------
>
> Key: AXISCPP-442
> URL: http://issues.apache.org/jira/browse/AXISCPP-442
> Project: Axis-C++
> Type: Bug
> Components: WSDL processing
> Environment: n/a
> Reporter: Fred Preston
>
> The following code sample highlights the problem:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret;
> try
> { if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
> When the code is compiled, the following error results: "<dir>\Service.cpp(nnnn) : error C4700: local variable 'Ret' used without having been initialized"
> The solution to the problem would be to initialise the return value when it is declared. Thus the code would become:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret = {0,0,0,0,0,0,0,0,0};
> try
> {
> if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
--
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-442) The methods in the stubs do not initialise the return value
Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-442?page=history ]
Samisa Abeysinghe reassigned AXISCPP-442:
-----------------------------------------
Assign To: Samisa Abeysinghe
> The methods in the stubs do not initialise the return value
> -----------------------------------------------------------
>
> Key: AXISCPP-442
> URL: http://issues.apache.org/jira/browse/AXISCPP-442
> Project: Axis-C++
> Type: Bug
> Components: WSDL processing
> Environment: n/a
> Reporter: Fred Preston
> Assignee: Samisa Abeysinghe
>
> The following code sample highlights the problem:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret;
> try
> { if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
> When the code is compiled, the following error results: "<dir>\Service.cpp(nnnn) : error C4700: local variable 'Ret' used without having been initialized"
> The solution to the problem would be to initialise the return value when it is declared. Thus the code would become:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret = {0,0,0,0,0,0,0,0,0};
> try
> {
> if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
--
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: (AXISCPP-442) The methods in the stubs do not initialise the return value
Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-442?page=comments#action_59845 ]
Chinthana Danapala commented on AXISCPP-442:
--------------------------------------------
Following changes will give the solution.
RCS file: /home/cvspublic/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java,v
retrieving revision 1.73
diff -r1.73 ClientStubWriter.java
416,418c416,428
< {
< writer.write(outparamType + " Ret;\n");
< }
---
> {
> if (outparamType.equals("xsd__dateTime")
> || outparamType.equals("xsd__date")
> || outparamType.equals("xsd__time"))
> {
> writer.write(outparamType + " Ret;\n");
> writer.write("\tmemset(&Ret,0,sizeof(" + outparamType + "));\n");
> }
> else
> {
> writer.write(outparamType + " Ret;\n");
> }
> }
Success, CVS operation completed
> The methods in the stubs do not initialise the return value
> -----------------------------------------------------------
>
> Key: AXISCPP-442
> URL: http://issues.apache.org/jira/browse/AXISCPP-442
> Project: Axis-C++
> Type: Bug
> Components: WSDL processing
> Environment: n/a
> Reporter: Fred Preston
> Assignee: Samisa Abeysinghe
>
> The following code sample highlights the problem:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret;
> try
> { if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
> When the code is compiled, the following error results: "<dir>\Service.cpp(nnnn) : error C4700: local variable 'Ret' used without having been initialized"
> The solution to the problem would be to initialise the return value when it is declared. Thus the code would become:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret = {0,0,0,0,0,0,0,0,0};
> try
> {
> if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
--
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: (AXISCPP-442) The methods in the stubs do not initialise the return value
Posted by "Chinthana Danapala (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-442?page=comments#action_59760 ]
Chinthana Danapala commented on AXISCPP-442:
--------------------------------------------
memset( *Ret, 0, sizeof(xsd-type));
not this but
memset( &Ret, 0, sizeof(xsd-type));
this works.
> The methods in the stubs do not initialise the return value
> -----------------------------------------------------------
>
> Key: AXISCPP-442
> URL: http://issues.apache.org/jira/browse/AXISCPP-442
> Project: Axis-C++
> Type: Bug
> Components: WSDL processing
> Environment: n/a
> Reporter: Fred Preston
> Assignee: Samisa Abeysinghe
>
> The following code sample highlights the problem:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret;
> try
> { if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
> When the code is compiled, the following error results: "<dir>\Service.cpp(nnnn) : error C4700: local variable 'Ret' used without having been initialized"
> The solution to the problem would be to initialise the return value when it is declared. Thus the code would become:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret = {0,0,0,0,0,0,0,0,0};
> try
> {
> if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
--
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] Closed: (AXISCPP-442) The methods in the stubs do not initialise the return value
Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-442?page=history ]
Samisa Abeysinghe closed AXISCPP-442:
-------------------------------------
Resolution: Fixed
Provided patch applied.
Chinthana, thanks for the patch
> The methods in the stubs do not initialise the return value
> -----------------------------------------------------------
>
> Key: AXISCPP-442
> URL: http://issues.apache.org/jira/browse/AXISCPP-442
> Project: Axis-C++
> Type: Bug
> Components: WSDL processing
> Environment: n/a
> Reporter: Fred Preston
> Assignee: Samisa Abeysinghe
>
> The following code sample highlights the problem:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret;
> try
> { if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
> When the code is compiled, the following error results: "<dir>\Service.cpp(nnnn) : error C4700: local variable 'Ret' used without having been initialized"
> The solution to the problem would be to initialise the return value when it is declared. Thus the code would become:-
> xsd__dateTime Service::updateDateTime(xsd__dateTime Value0)
> {
> xsd__dateTime Ret = {0,0,0,0,0,0,0,0,0};
> try
> {
> if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER, NORMAL_CHANNEL)) return Ret;
> ...
--
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