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 "Michael Xiong (JIRA)" <ax...@ws.apache.org> on 2007/01/25 06:43:49 UTC
[jira] Created: (AXISCPP-1017) WSDL2Ws tool has serious problem
when processing the schema: unbounded choice inside sequence
WSDL2Ws tool has serious problem when processing the schema: unbounded choice inside sequence
---------------------------------------------------------------------------------------------
Key: AXISCPP-1017
URL: https://issues.apache.org/jira/browse/AXISCPP-1017
Project: Axis-C++
Issue Type: Bug
Components: WSDL processing - Doc
Affects Versions: 1.6 Beta
Environment: OS: Linux fedora 3.0
Axiscpp version: Server-side Axis C++ 1.6Beta
XML Parser Lib: xersesc 2.6
WSDL2ws tool by using axis java 1.4
Http Server Version: Apache 2.0.53
Reporter: Michael Xiong
Priority: Critical
When I was developing some web service based on axiscpp1.6b/apache2.0, I found that axiscpp1.6b's WSDL2Ws tool has serious problem to generate code for one kind of complex composite schema type: unbounded choice inside sequence.
I'd like to give a piece of sample schema to replay this problem like the below:
[FooMan.wsdl/FooMan.xsd]:
...
<xsd:element name="AddFoo" type="usr:AddFoo" />
<xsd:complexType name="AddFoo">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded"
name="Foo" type="usr:FooAddRequest" />
</xs:sequence>
</xsd:complexType>
<xsd:element name="AddFooResponse"
type="usr:AddFooResponse" />
<xsd:complexType name="AddFooResponse">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Foo" type="usr:Foo" />
<xs:element name="Fault" type="mgt:Fault" />
</xs:choice>
</xs:sequence>
</xsd:complexType>
...
The generated code(interface): FooMan.hpp looks like the below:
...
void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
...
Though the generated code can be compiled without problem, and even it can be executed and communicate with some corresponding soap client(only simple & special case) without problem, but it's not correct according to the syntax definition from it's schema definition.
For example, the generated code can only support the below case(simple & special case):
[Request-1]:
...
<AddFoo xmlns="http://www.foo.bar.com/foo">
<Foo>
<FooID>Foo1</FooID>
<Password>FooPaa1</Password>
</Foo>
<Foo>
<FooID>Foo2</FooID>
<Password>FooPaa2</Password>
</Foo>
</AddFoo>
...
[Response-1]:
...
<AddFooResponse xmlns="http://www.foo.bar.com/foo">
<Foo>
<FooID>Foo1</FooID>
<Index>FooDee1</Index>
</Foo>
<Fault>
<FooID>Foo2</FooID>
<Reason>WrongPassword</Reason>
</Fault>
</AddFooResponse>
...
But the generated code can not support more general & complex case like the below:
[Request-2]:
...
<AddFoo xmlns="http://www.foo.bar.com/foo">
<Foo>
<FooID>Foo1</FooID>
<Password>FooPaa1</Password>
</Foo>
<Foo>
<FooID>Foo2</FooID>
<Password>FooPaa2</Password>
</Foo>
<Foo>
<FooID>Foo3</FooID>
<Password>FooPaa3</Password>
</Foo>
<Foo>
<FooID>Foo4</FooID>
<Password>FooPaa4</Password>
</Foo>
</AddFoo>
...
[Response-2]:
...
<AddFooResponse xmlns="http://www.foo.bar.com/foo">
<Foo>
<FooID>Foo1</FooID>
<Index>FooDee1</Index>
</Foo>
<Foo>
<FooID>Foo2</FooID>
<Index>FooDee2</Index>
</Foo>
<Fault>
<FooID>Foo3</FooID>
<Reason>WrongPassword</Reason>
</Fault>
<Fault>
<FooID>Foo4</FooID>
<Reason>UnknowError</Reason>
</Fault>
</AddFooResponse>
...
The key-point for this problem is that, in C++ implementation, the "AddFooResponse" should be regarded as two complex arrays, not two simple objects.
In order to let my web service work strictly like what the wsdl and schema defined, I have to correct the generated FooMan.hpp(and of course the corresponding FooMan.cpp) like the below:
[FooMan.hpp]:
...
//<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
// void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo_Array & OutValue0, AXIS_OUT_PARAM Fault_Array & OutValue1);
//>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
...
To let the above modification to work correctly, the FooManWrapper.cpp also need to be modified like the below:
[FooManWrapper.cpp]:
...
int FooManWrapper::AddFoo(void* pMsg)
{
IMessageData* mc = (IMessageData*)pMsg;
int nStatus;
IWrapperSoapSerializer* pIWSSZ = NULL;
mc->getSoapSerializer(&pIWSSZ);
if (!pIWSSZ)
{
return AXIS_FAIL;
}
IWrapperSoapDeSerializer* pIWSDZ = NULL;
mc->getSoapDeSerializer(&pIWSDZ);
if (!pIWSDZ)
{
return AXIS_FAIL;
}
/* check whether we have got correct message */
if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("AddFoo", "http://www.fujixerox.co.jp/2003/12/ssm/management/user"))
{
return AXIS_FAIL;
}
pIWSSZ->createSoapMethod("AddFooResponse", "http://www.fujixerox.co.jp/2003/12/ssm/management/user");
FooAddRequest_Array * v0 = new FooAddRequest_Array();
pIWSDZ->getCmplxArray(v0, (void*)Axis_DeSerialize_FooAddRequest,
(void*)Axis_Create_FooAddRequest, (void*)Axis_Delete_FooAddRequest,
(void*)Axis_GetSize_FooAddRequest, "Foo", Axis_URI_FooAddRequest);
if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus()))
{
return nStatus;
}
//<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
// Foo* out0;
// Fault* out1;
// try
// {
// pWs->AddFoo(v0,&out0,&out1);
// pIWSSZ->addOutputCmplxParam(out0, (void*)Axis_Serialize_Foo, (void*)Axis_Delete_Foo, "Foo", Axis_URI_Foo);
// pIWSSZ->addOutputCmplxParam(out1, (void*)Axis_Serialize_Fault, (void*)Axis_Delete_Fault, "Fault", Axis_URI_Fault);
// return AXIS_SUCCESS;
// }
// catch(...)
// {
// return AXIS_FAIL;
// }
Foo_Array out0;
Fault_Array out1;
try
{
pWs->AddFoo(v0,out0,out1);
pIWSSZ->addOutputCmplxArrayParam(&out0,(void*) Axis_Serialize_Foo, (void*) Axis_Delete_Foo, (void*) Axis_GetSize_Foo, "Foo", Axis_URI_Foo);
pIWSSZ->addOutputCmplxArrayParam(&out1,(void*) Axis_Serialize_Fault, (void*) Axis_Delete_Fault, (void*) Axis_GetSize_Fault, "Fault", Axis_URI_Fault);
return AXIS_SUCCESS;
}
catch(...)
{
return AXIS_FAIL;
}
//>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
}
...
P.S. Because the necessary class Fault_Array.hpp/.cpp was not generated by WSDL2Ws tool, I also have to write the necessary class manually.
After modifying FooMan.hpp/.cpp and FooManWrapper.cpp, adding necessary class, my web service can work strictly like the wsdl & schema defined.
Though I have modified the generated code manually to let my web service to strictly follow the wsdl and schema definition, the more general solution should be to modify the WSDL2Ws tool to processing the related wsdl and schema definition correctly.
Could some one to take an eye on this problem and take necessary modification to WSDL2Ws tool?
--
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-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXISCPP-1017) WSDL2Ws tool has serious problem
when processing the schema: unbounded choice inside sequence
Posted by "Michael Xiong (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXISCPP-1017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12473303 ]
Michael Xiong commented on AXISCPP-1017:
----------------------------------------
Dear all,
I found a temporary solution to "AVOID" the above problem:
I just modify my schema definition like the below:
...
<xsd:complexType name="AddFooResponse">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element minOccurs="0" maxOccurs="unbounded" name="Foo" type="usr:Foo" />
<xs:element minOccurs="0" maxOccurs="unbounded" name="Fault" type="mgt:Fault" />
</xs:choice>
</xs:sequence>
</xsd:complexType>
..
The the generated code will be OK.
I wish the information will be useful for related people.
//Michael
> WSDL2Ws tool has serious problem when processing the schema: unbounded choice inside sequence
> ---------------------------------------------------------------------------------------------
>
> Key: AXISCPP-1017
> URL: https://issues.apache.org/jira/browse/AXISCPP-1017
> Project: Axis-C++
> Issue Type: Bug
> Components: WSDL processing - Doc
> Affects Versions: 1.6 Beta
> Environment: OS: Linux fedora 3.0
> Axiscpp version: Server-side Axis C++ 1.6Beta
> XML Parser Lib: xersesc 2.6
> WSDL2ws tool by using axis java 1.4
> Http Server Version: Apache 2.0.53
> Reporter: Michael Xiong
> Priority: Critical
>
> When I was developing some web service based on axiscpp1.6b/apache2.0, I found that axiscpp1.6b's WSDL2Ws tool has serious problem to generate code for one kind of complex composite schema type: unbounded choice inside sequence.
> I'd like to give a piece of sample schema to replay this problem like the below:
> [FooMan.wsdl/FooMan.xsd]:
> ...
> <xsd:element name="AddFoo" type="usr:AddFoo" />
> <xsd:complexType name="AddFoo">
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="unbounded"
> name="Foo" type="usr:FooAddRequest" />
> </xs:sequence>
> </xsd:complexType>
> <xsd:element name="AddFooResponse"
> type="usr:AddFooResponse" />
> <xsd:complexType name="AddFooResponse">
> <xs:sequence>
> <xs:choice minOccurs="0" maxOccurs="unbounded">
> <xs:element name="Foo" type="usr:Foo" />
> <xs:element name="Fault" type="mgt:Fault" />
> </xs:choice>
> </xs:sequence>
> </xsd:complexType>
> ...
> The generated code(interface): FooMan.hpp looks like the below:
> ...
> void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
> ...
> Though the generated code can be compiled without problem, and even it can be executed and communicate with some corresponding soap client(only simple & special case) without problem, but it's not correct according to the syntax definition from it's schema definition.
> For example, the generated code can only support the below case(simple & special case):
> [Request-1]:
> ...
> <AddFoo xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Password>FooPaa1</Password>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Password>FooPaa2</Password>
> </Foo>
> </AddFoo>
> ...
> [Response-1]:
> ...
> <AddFooResponse xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Index>FooDee1</Index>
> </Foo>
> <Fault>
> <FooID>Foo2</FooID>
> <Reason>WrongPassword</Reason>
> </Fault>
> </AddFooResponse>
> ...
> But the generated code can not support more general & complex case like the below:
> [Request-2]:
> ...
> <AddFoo xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Password>FooPaa1</Password>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Password>FooPaa2</Password>
> </Foo>
> <Foo>
> <FooID>Foo3</FooID>
> <Password>FooPaa3</Password>
> </Foo>
> <Foo>
> <FooID>Foo4</FooID>
> <Password>FooPaa4</Password>
> </Foo>
> </AddFoo>
> ...
> [Response-2]:
> ...
> <AddFooResponse xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Index>FooDee1</Index>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Index>FooDee2</Index>
> </Foo>
> <Fault>
> <FooID>Foo3</FooID>
> <Reason>WrongPassword</Reason>
> </Fault>
> <Fault>
> <FooID>Foo4</FooID>
> <Reason>UnknowError</Reason>
> </Fault>
> </AddFooResponse>
> ...
> The key-point for this problem is that, in C++ implementation, the "AddFooResponse" should be regarded as two complex arrays, not two simple objects.
> In order to let my web service work strictly like what the wsdl and schema defined, I have to correct the generated FooMan.hpp(and of course the corresponding FooMan.cpp) like the below:
> [FooMan.hpp]:
> ...
> //<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> // void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
> void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo_Array & OutValue0, AXIS_OUT_PARAM Fault_Array & OutValue1);
> //>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> ...
> To let the above modification to work correctly, the FooManWrapper.cpp also need to be modified like the below:
> [FooManWrapper.cpp]:
> ...
> int FooManWrapper::AddFoo(void* pMsg)
> {
> IMessageData* mc = (IMessageData*)pMsg;
> int nStatus;
> IWrapperSoapSerializer* pIWSSZ = NULL;
> mc->getSoapSerializer(&pIWSSZ);
> if (!pIWSSZ)
> {
> return AXIS_FAIL;
> }
> IWrapperSoapDeSerializer* pIWSDZ = NULL;
> mc->getSoapDeSerializer(&pIWSDZ);
> if (!pIWSDZ)
> {
> return AXIS_FAIL;
> }
> /* check whether we have got correct message */
> if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("AddFoo", "http://www.fujixerox.co.jp/2003/12/ssm/management/user"))
> {
> return AXIS_FAIL;
> }
> pIWSSZ->createSoapMethod("AddFooResponse", "http://www.fujixerox.co.jp/2003/12/ssm/management/user");
> FooAddRequest_Array * v0 = new FooAddRequest_Array();
> pIWSDZ->getCmplxArray(v0, (void*)Axis_DeSerialize_FooAddRequest,
> (void*)Axis_Create_FooAddRequest, (void*)Axis_Delete_FooAddRequest,
> (void*)Axis_GetSize_FooAddRequest, "Foo", Axis_URI_FooAddRequest);
> if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus()))
> {
> return nStatus;
> }
> //<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> // Foo* out0;
> // Fault* out1;
> // try
> // {
> // pWs->AddFoo(v0,&out0,&out1);
> // pIWSSZ->addOutputCmplxParam(out0, (void*)Axis_Serialize_Foo, (void*)Axis_Delete_Foo, "Foo", Axis_URI_Foo);
> // pIWSSZ->addOutputCmplxParam(out1, (void*)Axis_Serialize_Fault, (void*)Axis_Delete_Fault, "Fault", Axis_URI_Fault);
> // return AXIS_SUCCESS;
> // }
> // catch(...)
> // {
> // return AXIS_FAIL;
> // }
> Foo_Array out0;
> Fault_Array out1;
> try
> {
> pWs->AddFoo(v0,out0,out1);
> pIWSSZ->addOutputCmplxArrayParam(&out0,(void*) Axis_Serialize_Foo, (void*) Axis_Delete_Foo, (void*) Axis_GetSize_Foo, "Foo", Axis_URI_Foo);
> pIWSSZ->addOutputCmplxArrayParam(&out1,(void*) Axis_Serialize_Fault, (void*) Axis_Delete_Fault, (void*) Axis_GetSize_Fault, "Fault", Axis_URI_Fault);
> return AXIS_SUCCESS;
> }
> catch(...)
> {
> return AXIS_FAIL;
> }
> //>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> }
> ...
> P.S. Because the necessary class Fault_Array.hpp/.cpp was not generated by WSDL2Ws tool, I also have to write the necessary class manually.
> After modifying FooMan.hpp/.cpp and FooManWrapper.cpp, adding necessary class, my web service can work strictly like the wsdl & schema defined.
> Though I have modified the generated code manually to let my web service to strictly follow the wsdl and schema definition, the more general solution should be to modify the WSDL2Ws tool to processing the related wsdl and schema definition correctly.
> Could some one to take an eye on this problem and take necessary modification to WSDL2Ws tool?
--
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-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXISCPP-1017) WSDL2Ws tool has serious problem
when processing the schema: unbounded choice inside sequence
Posted by "Michael Xiong (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXISCPP-1017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467277 ]
Michael Xiong commented on AXISCPP-1017:
----------------------------------------
more comment:
The skeltons for 'unbounded choice inside sequence' are not generated correctly. When generating code, it should be regarded as several complex arrays(which contain repeatable objects), but AxisCPP's WSDL2Ws tool regards it only as several non-repeatable simple objects.
> WSDL2Ws tool has serious problem when processing the schema: unbounded choice inside sequence
> ---------------------------------------------------------------------------------------------
>
> Key: AXISCPP-1017
> URL: https://issues.apache.org/jira/browse/AXISCPP-1017
> Project: Axis-C++
> Issue Type: Bug
> Components: WSDL processing - Doc
> Affects Versions: 1.6 Beta
> Environment: OS: Linux fedora 3.0
> Axiscpp version: Server-side Axis C++ 1.6Beta
> XML Parser Lib: xersesc 2.6
> WSDL2ws tool by using axis java 1.4
> Http Server Version: Apache 2.0.53
> Reporter: Michael Xiong
> Priority: Critical
>
> When I was developing some web service based on axiscpp1.6b/apache2.0, I found that axiscpp1.6b's WSDL2Ws tool has serious problem to generate code for one kind of complex composite schema type: unbounded choice inside sequence.
> I'd like to give a piece of sample schema to replay this problem like the below:
> [FooMan.wsdl/FooMan.xsd]:
> ...
> <xsd:element name="AddFoo" type="usr:AddFoo" />
> <xsd:complexType name="AddFoo">
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="unbounded"
> name="Foo" type="usr:FooAddRequest" />
> </xs:sequence>
> </xsd:complexType>
> <xsd:element name="AddFooResponse"
> type="usr:AddFooResponse" />
> <xsd:complexType name="AddFooResponse">
> <xs:sequence>
> <xs:choice minOccurs="0" maxOccurs="unbounded">
> <xs:element name="Foo" type="usr:Foo" />
> <xs:element name="Fault" type="mgt:Fault" />
> </xs:choice>
> </xs:sequence>
> </xsd:complexType>
> ...
> The generated code(interface): FooMan.hpp looks like the below:
> ...
> void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
> ...
> Though the generated code can be compiled without problem, and even it can be executed and communicate with some corresponding soap client(only simple & special case) without problem, but it's not correct according to the syntax definition from it's schema definition.
> For example, the generated code can only support the below case(simple & special case):
> [Request-1]:
> ...
> <AddFoo xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Password>FooPaa1</Password>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Password>FooPaa2</Password>
> </Foo>
> </AddFoo>
> ...
> [Response-1]:
> ...
> <AddFooResponse xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Index>FooDee1</Index>
> </Foo>
> <Fault>
> <FooID>Foo2</FooID>
> <Reason>WrongPassword</Reason>
> </Fault>
> </AddFooResponse>
> ...
> But the generated code can not support more general & complex case like the below:
> [Request-2]:
> ...
> <AddFoo xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Password>FooPaa1</Password>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Password>FooPaa2</Password>
> </Foo>
> <Foo>
> <FooID>Foo3</FooID>
> <Password>FooPaa3</Password>
> </Foo>
> <Foo>
> <FooID>Foo4</FooID>
> <Password>FooPaa4</Password>
> </Foo>
> </AddFoo>
> ...
> [Response-2]:
> ...
> <AddFooResponse xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Index>FooDee1</Index>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Index>FooDee2</Index>
> </Foo>
> <Fault>
> <FooID>Foo3</FooID>
> <Reason>WrongPassword</Reason>
> </Fault>
> <Fault>
> <FooID>Foo4</FooID>
> <Reason>UnknowError</Reason>
> </Fault>
> </AddFooResponse>
> ...
> The key-point for this problem is that, in C++ implementation, the "AddFooResponse" should be regarded as two complex arrays, not two simple objects.
> In order to let my web service work strictly like what the wsdl and schema defined, I have to correct the generated FooMan.hpp(and of course the corresponding FooMan.cpp) like the below:
> [FooMan.hpp]:
> ...
> //<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> // void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
> void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo_Array & OutValue0, AXIS_OUT_PARAM Fault_Array & OutValue1);
> //>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> ...
> To let the above modification to work correctly, the FooManWrapper.cpp also need to be modified like the below:
> [FooManWrapper.cpp]:
> ...
> int FooManWrapper::AddFoo(void* pMsg)
> {
> IMessageData* mc = (IMessageData*)pMsg;
> int nStatus;
> IWrapperSoapSerializer* pIWSSZ = NULL;
> mc->getSoapSerializer(&pIWSSZ);
> if (!pIWSSZ)
> {
> return AXIS_FAIL;
> }
> IWrapperSoapDeSerializer* pIWSDZ = NULL;
> mc->getSoapDeSerializer(&pIWSDZ);
> if (!pIWSDZ)
> {
> return AXIS_FAIL;
> }
> /* check whether we have got correct message */
> if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("AddFoo", "http://www.fujixerox.co.jp/2003/12/ssm/management/user"))
> {
> return AXIS_FAIL;
> }
> pIWSSZ->createSoapMethod("AddFooResponse", "http://www.fujixerox.co.jp/2003/12/ssm/management/user");
> FooAddRequest_Array * v0 = new FooAddRequest_Array();
> pIWSDZ->getCmplxArray(v0, (void*)Axis_DeSerialize_FooAddRequest,
> (void*)Axis_Create_FooAddRequest, (void*)Axis_Delete_FooAddRequest,
> (void*)Axis_GetSize_FooAddRequest, "Foo", Axis_URI_FooAddRequest);
> if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus()))
> {
> return nStatus;
> }
> //<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> // Foo* out0;
> // Fault* out1;
> // try
> // {
> // pWs->AddFoo(v0,&out0,&out1);
> // pIWSSZ->addOutputCmplxParam(out0, (void*)Axis_Serialize_Foo, (void*)Axis_Delete_Foo, "Foo", Axis_URI_Foo);
> // pIWSSZ->addOutputCmplxParam(out1, (void*)Axis_Serialize_Fault, (void*)Axis_Delete_Fault, "Fault", Axis_URI_Fault);
> // return AXIS_SUCCESS;
> // }
> // catch(...)
> // {
> // return AXIS_FAIL;
> // }
> Foo_Array out0;
> Fault_Array out1;
> try
> {
> pWs->AddFoo(v0,out0,out1);
> pIWSSZ->addOutputCmplxArrayParam(&out0,(void*) Axis_Serialize_Foo, (void*) Axis_Delete_Foo, (void*) Axis_GetSize_Foo, "Foo", Axis_URI_Foo);
> pIWSSZ->addOutputCmplxArrayParam(&out1,(void*) Axis_Serialize_Fault, (void*) Axis_Delete_Fault, (void*) Axis_GetSize_Fault, "Fault", Axis_URI_Fault);
> return AXIS_SUCCESS;
> }
> catch(...)
> {
> return AXIS_FAIL;
> }
> //>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> }
> ...
> P.S. Because the necessary class Fault_Array.hpp/.cpp was not generated by WSDL2Ws tool, I also have to write the necessary class manually.
> After modifying FooMan.hpp/.cpp and FooManWrapper.cpp, adding necessary class, my web service can work strictly like the wsdl & schema defined.
> Though I have modified the generated code manually to let my web service to strictly follow the wsdl and schema definition, the more general solution should be to modify the WSDL2Ws tool to processing the related wsdl and schema definition correctly.
> Could some one to take an eye on this problem and take necessary modification to WSDL2Ws tool?
--
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-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
Re: Axis C++: Looking for some guidance - what to do on parser errors?
Posted by Adrian Dick <ad...@uk.ibm.com>.
Nadir,
I would agree that receiving an exception would make more sense than simply
NULL, when a genuine parsing error has occured.
Obviously, need to be careful that this isn't triggered by optional
elements being omitted, and the like.
Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)
Nadir Amra <am...@us.ibm.com> wrote on 25/01/2007 06:59:39:
> I have been frustrated somewhat in debugging problems relating to SOAP
> deserialization/parsing. It seems that the deserializer ignores parsing
> errors by simply returning AXIS_FAIL or NULL or empty array. To me this
> hides the underlying problem, be it in the AXIS C/C++ code or in the SOAP
> response itself.
>
> In anycase, I was wondering whether there would be anything wrong with
> throwing exceptions when:
>
> -- the parser is in error status
> -- there is no more data to parse and deserializer asks for more data
> -- skipping an end element when it is not an end element
>
> I think that will help in debugging problems and is more reasonable that
> for a client application to wonder why an array is not filled with the
> SOAP response or why a field is set to NULL.
>
> Any comments would be helpful. I am inclined to go ahead and throw
> exceptions on these conditions, unless there is some sort of logical
> reason why we should not. At the very least if the parser is in error
> status, no reason to continue.
>
>
>
> Nadir K. Amra
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
Axis C++: Looking for some guidance - what to do on parser errors?
Posted by Nadir Amra <am...@us.ibm.com>.
I have been frustrated somewhat in debugging problems relating to SOAP
deserialization/parsing. It seems that the deserializer ignores parsing
errors by simply returning AXIS_FAIL or NULL or empty array. To me this
hides the underlying problem, be it in the AXIS C/C++ code or in the SOAP
response itself.
In anycase, I was wondering whether there would be anything wrong with
throwing exceptions when:
-- the parser is in error status
-- there is no more data to parse and deserializer asks for more data
-- skipping an end element when it is not an end element
I think that will help in debugging problems and is more reasonable that
for a client application to wonder why an array is not filled with the
SOAP response or why a field is set to NULL.
Any comments would be helpful. I am inclined to go ahead and throw
exceptions on these conditions, unless there is some sort of logical
reason why we should not. At the very least if the parser is in error
status, no reason to continue.
Nadir K. Amra
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXISCPP-1017) WSDL2Ws tool has serious problem
when processing the schema: unbounded choice inside sequence
Posted by "Michael Xiong (JIRA)" <ax...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/AXISCPP-1017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467300 ]
Michael Xiong commented on AXISCPP-1017:
----------------------------------------
I'd like to add more comment on 'unbounded choice inside sequence' , so that make it much easy to understand.
>From the same example which I put on the above description,
the 'unbounded choice inside sequence' means the below schema("AddFooResponse"):
...
<xsd:element name="AddFooResponse"
type="usr:AddFooResponse" />
<xsd:complexType name="AddFooResponse">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Foo" type="usr:Foo" />
<xs:element name="Fault" type="mgt:Fault" />
</xs:choice>
</xs:sequence>
</xsd:complexType>
...
>From the above schema, inside the sequence "AddFooResponse", there are two kind of repeatable element: "Foo" and "Fault. Please notice that It means two kind of repeatable objects, not two objects.
"AddFooResponse" is a sequence which contains two kind of repeatable objects, in detail it contains repeatable "Foo" objects and repeatable "Fault" objects.
So that "AddFooResponse" should contain a Foo_Array and a Fault_Array in skeleton.
In response soap message, it should contain multi Foo objects and multi Fault objects.
> WSDL2Ws tool has serious problem when processing the schema: unbounded choice inside sequence
> ---------------------------------------------------------------------------------------------
>
> Key: AXISCPP-1017
> URL: https://issues.apache.org/jira/browse/AXISCPP-1017
> Project: Axis-C++
> Issue Type: Bug
> Components: WSDL processing - Doc
> Affects Versions: 1.6 Beta
> Environment: OS: Linux fedora 3.0
> Axiscpp version: Server-side Axis C++ 1.6Beta
> XML Parser Lib: xersesc 2.6
> WSDL2ws tool by using axis java 1.4
> Http Server Version: Apache 2.0.53
> Reporter: Michael Xiong
> Priority: Critical
>
> When I was developing some web service based on axiscpp1.6b/apache2.0, I found that axiscpp1.6b's WSDL2Ws tool has serious problem to generate code for one kind of complex composite schema type: unbounded choice inside sequence.
> I'd like to give a piece of sample schema to replay this problem like the below:
> [FooMan.wsdl/FooMan.xsd]:
> ...
> <xsd:element name="AddFoo" type="usr:AddFoo" />
> <xsd:complexType name="AddFoo">
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="unbounded"
> name="Foo" type="usr:FooAddRequest" />
> </xs:sequence>
> </xsd:complexType>
> <xsd:element name="AddFooResponse"
> type="usr:AddFooResponse" />
> <xsd:complexType name="AddFooResponse">
> <xs:sequence>
> <xs:choice minOccurs="0" maxOccurs="unbounded">
> <xs:element name="Foo" type="usr:Foo" />
> <xs:element name="Fault" type="mgt:Fault" />
> </xs:choice>
> </xs:sequence>
> </xsd:complexType>
> ...
> The generated code(interface): FooMan.hpp looks like the below:
> ...
> void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
> ...
> Though the generated code can be compiled without problem, and even it can be executed and communicate with some corresponding soap client(only simple & special case) without problem, but it's not correct according to the syntax definition from it's schema definition.
> For example, the generated code can only support the below case(simple & special case):
> [Request-1]:
> ...
> <AddFoo xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Password>FooPaa1</Password>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Password>FooPaa2</Password>
> </Foo>
> </AddFoo>
> ...
> [Response-1]:
> ...
> <AddFooResponse xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Index>FooDee1</Index>
> </Foo>
> <Fault>
> <FooID>Foo2</FooID>
> <Reason>WrongPassword</Reason>
> </Fault>
> </AddFooResponse>
> ...
> But the generated code can not support more general & complex case like the below:
> [Request-2]:
> ...
> <AddFoo xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Password>FooPaa1</Password>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Password>FooPaa2</Password>
> </Foo>
> <Foo>
> <FooID>Foo3</FooID>
> <Password>FooPaa3</Password>
> </Foo>
> <Foo>
> <FooID>Foo4</FooID>
> <Password>FooPaa4</Password>
> </Foo>
> </AddFoo>
> ...
> [Response-2]:
> ...
> <AddFooResponse xmlns="http://www.foo.bar.com/foo">
> <Foo>
> <FooID>Foo1</FooID>
> <Index>FooDee1</Index>
> </Foo>
> <Foo>
> <FooID>Foo2</FooID>
> <Index>FooDee2</Index>
> </Foo>
> <Fault>
> <FooID>Foo3</FooID>
> <Reason>WrongPassword</Reason>
> </Fault>
> <Fault>
> <FooID>Foo4</FooID>
> <Reason>UnknowError</Reason>
> </Fault>
> </AddFooResponse>
> ...
> The key-point for this problem is that, in C++ implementation, the "AddFooResponse" should be regarded as two complex arrays, not two simple objects.
> In order to let my web service work strictly like what the wsdl and schema defined, I have to correct the generated FooMan.hpp(and of course the corresponding FooMan.cpp) like the below:
> [FooMan.hpp]:
> ...
> //<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> // void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo* * OutValue0, AXIS_OUT_PARAM Fault* * OutValue1);
> void AddFoo(FooAddRequest_Array * Value0, AXIS_OUT_PARAM Foo_Array & OutValue0, AXIS_OUT_PARAM Fault_Array & OutValue1);
> //>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> ...
> To let the above modification to work correctly, the FooManWrapper.cpp also need to be modified like the below:
> [FooManWrapper.cpp]:
> ...
> int FooManWrapper::AddFoo(void* pMsg)
> {
> IMessageData* mc = (IMessageData*)pMsg;
> int nStatus;
> IWrapperSoapSerializer* pIWSSZ = NULL;
> mc->getSoapSerializer(&pIWSSZ);
> if (!pIWSSZ)
> {
> return AXIS_FAIL;
> }
> IWrapperSoapDeSerializer* pIWSDZ = NULL;
> mc->getSoapDeSerializer(&pIWSDZ);
> if (!pIWSDZ)
> {
> return AXIS_FAIL;
> }
> /* check whether we have got correct message */
> if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("AddFoo", "http://www.fujixerox.co.jp/2003/12/ssm/management/user"))
> {
> return AXIS_FAIL;
> }
> pIWSSZ->createSoapMethod("AddFooResponse", "http://www.fujixerox.co.jp/2003/12/ssm/management/user");
> FooAddRequest_Array * v0 = new FooAddRequest_Array();
> pIWSDZ->getCmplxArray(v0, (void*)Axis_DeSerialize_FooAddRequest,
> (void*)Axis_Create_FooAddRequest, (void*)Axis_Delete_FooAddRequest,
> (void*)Axis_GetSize_FooAddRequest, "Foo", Axis_URI_FooAddRequest);
> if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus()))
> {
> return nStatus;
> }
> //<-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> // Foo* out0;
> // Fault* out1;
> // try
> // {
> // pWs->AddFoo(v0,&out0,&out1);
> // pIWSSZ->addOutputCmplxParam(out0, (void*)Axis_Serialize_Foo, (void*)Axis_Delete_Foo, "Foo", Axis_URI_Foo);
> // pIWSSZ->addOutputCmplxParam(out1, (void*)Axis_Serialize_Fault, (void*)Axis_Delete_Fault, "Fault", Axis_URI_Fault);
> // return AXIS_SUCCESS;
> // }
> // catch(...)
> // {
> // return AXIS_FAIL;
> // }
> Foo_Array out0;
> Fault_Array out1;
> try
> {
> pWs->AddFoo(v0,out0,out1);
> pIWSSZ->addOutputCmplxArrayParam(&out0,(void*) Axis_Serialize_Foo, (void*) Axis_Delete_Foo, (void*) Axis_GetSize_Foo, "Foo", Axis_URI_Foo);
> pIWSSZ->addOutputCmplxArrayParam(&out1,(void*) Axis_Serialize_Fault, (void*) Axis_Delete_Fault, (void*) Axis_GetSize_Fault, "Fault", Axis_URI_Fault);
> return AXIS_SUCCESS;
> }
> catch(...)
> {
> return AXIS_FAIL;
> }
> //>-+ mxiong 2007/1/24 Modify "AddFoo" to fix schema problem
> }
> ...
> P.S. Because the necessary class Fault_Array.hpp/.cpp was not generated by WSDL2Ws tool, I also have to write the necessary class manually.
> After modifying FooMan.hpp/.cpp and FooManWrapper.cpp, adding necessary class, my web service can work strictly like the wsdl & schema defined.
> Though I have modified the generated code manually to let my web service to strictly follow the wsdl and schema definition, the more general solution should be to modify the WSDL2Ws tool to processing the related wsdl and schema definition correctly.
> Could some one to take an eye on this problem and take necessary modification to WSDL2Ws tool?
--
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-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org