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 Aleksander Slominski <as...@cs.indiana.edu> on 2004/06/08 08:42:27 UTC

can not send array back from service (bug?)

hi,

strangely enough echo works but sending just array using thos code does not work:

xsd__int_Array Benchmark1PortType::sendInts(int length)
{
    xsd__int_Array arr;
    //arr.m_Size = length;
    arr.m_Size = length;
    arr.m_Array = new xsd__int[length];
    for (int i=0; i < length; i++) {
      arr.m_Array[i] = i;
    }
    //arr.m_Array = (int *) malloc(length * sizeof(int));
    // fill in array with values
    return arr;
}

can this code be modified to work somehow?!

i must say i am lost here ...

service code in:
http://www.extreme.indiana.edu/~aslom/bnp/wsperf/axis_cpp/samples_server/soapbench/

alek

ps. here is what o have on the wire:

REQUEST:
<?xml version='1.0' encoding='utf-8'?><S:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
xmlns:S='http://www.w3.org/2003/05/soap-envelope'><S:Body><n1:echoInts xmlns:n1='urn:Benchmark1'><input 
xsi:type='SOAP-ENC:Array' SOAP-ENC:arrayType='xsd:int[10]' xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'><i>20</i><i>21</i><i>22</i><i>23</i><i>24</i><i>25</i><i>26</i><i>27</i><i>28</i><i>29</i></input></n1:echoInts></S:Body></S:Envelope>---



RESPONSE:
<?xml version='1.0' encoding='utf-8' ?><env:Envelope 
xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><env:Body><ns1:echoIntsResponse 
xmlns:ns1=\"http://www.extreme.indiana.edu/wsdl/Benchmark1.wsdl\"><echoIntsReturnArray 
xmlns:enc=\"http://www.w3.org/2001/06/soap-encoding\" 
enc:arrayType=\"xsd:int[10]\"><item>20</item><item>21</item><item>22</item><item>23</item><item>24</item><item>25</item><item>26</item><item>27</item><item>28</item><item>29</item></echoIntsReturnArray></ns1:echoIntsResponse></env:Body></env:Envelope>---


REQUEST:
<?xml version='1.0' encoding='utf-8'?><S:Envelope xmlns:xsd='http://www.w3.org/2001/XMLSchema' 
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
xmlns:S='http://www.w3.org/2003/05/soap-envelope'><S:Body><n1:sendInts 
xmlns:n1='urn:Benchmark1'><size>10</size></n1:sendInts></S:Body></S:Envelope>---


RESPONSE:
<?xml version='1.0' encoding='utf-8' ?><env:Envelope 
xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" 
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><env:Body><ns1:sendIntsResponse 
xmlns:ns1=\"http://www.extreme.indiana.edu/wsdl/Benchmark1.wsdl\"><sendIntsReturnArray 
xmlns:enc=\"http://www.w3.org/2001/06/soap-encoding\" 
enc:arrayType=\"xsd:int[0]\"></sendIntsReturnArray></ns1:sendIntsResponse></env:Body></env:Envelope>---


-- 
The best way to predict the future is to invent it - Alan Kay


RE: can not send array back from service (bug?)

Posted by Samisa Abeysinghe <sa...@yahoo.com>.
Why use memcpy?

Samisa...

--- Susantha Kumara <su...@opensource.lk> wrote:
> I had a look at the code. I wonder why this doesnot work.
> Try modifying the line 
> 	xsd__int_Array ret = pWs->sendInts(v0);
> to 
> 	xsd__int_Array ret;
> 	memcpy(&ret, &(pWs->sendInts(v0)), sizeof(Axis_Array));
> 
> ---
> Susantha Kumara
> Virtusa (pvt) Ltd.
> Office : +94112714385
> Mobile : +94777420453
> 
> > -----Original Message-----
> > From: Aleksander Slominski [mailto:aslom@cs.indiana.edu]
> > Sent: Tuesday, June 08, 2004 12:42 PM
> > To: Apache AXIS C Developers List
> > Subject: can not send array back from service (bug?)
> > 
> > hi,
> > 
> > strangely enough echo works but sending just array using thos code
> does
> > not work:
> > 
> > xsd__int_Array Benchmark1PortType::sendInts(int length)
> > {
> >     xsd__int_Array arr;
> >     //arr.m_Size = length;
> >     arr.m_Size = length;
> >     arr.m_Array = new xsd__int[length];
> >     for (int i=0; i < length; i++) {
> >       arr.m_Array[i] = i;
> >     }
> >     //arr.m_Array = (int *) malloc(length * sizeof(int));
> >     // fill in array with values
> >     return arr;
> > }
> > 
> > can this code be modified to work somehow?!
> > 
> > i must say i am lost here ...
> > 
> > service code in:
> >
> http://www.extreme.indiana.edu/~aslom/bnp/wsperf/axis_cpp/samples_server
> /s
> > oapbench/
> > 
> > alek
> > 
> > ps. here is what o have on the wire:
> > 
> > REQUEST:
> > <?xml version='1.0' encoding='utf-8'?><S:Envelope
> > xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> > xmlns:S='http://www.w3.org/2003/05/soap-envelope'><S:Body><n1:echoInts
> > xmlns:n1='urn:Benchmark1'><input
> > xsi:type='SOAP-ENC:Array' SOAP-ENC:arrayType='xsd:int[10]'
> > xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> > xmlns:SOAP-
> >
> ENC='http://schemas.xmlsoap.org/soap/encoding/'><i>20</i><i>21</i><i>22<
> /i
> >
> ><i>23</i><i>24</i><i>25</i><i>26</i><i>27</i><i>28</i><i>29</i></input>
> </
> > n1:echoInts></S:Body></S:Envelope>---
> > 
> > 
> > 
> > RESPONSE:
> > <?xml version='1.0' encoding='utf-8' ?><env:Envelope
> > xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\"
> > xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
> > xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-
> > instance\"><env:Body><ns1:echoIntsResponse
> >
> xmlns:ns1=\"http://www.extreme.indiana.edu/wsdl/Benchmark1.wsdl\"><echoI
> nt
> > sReturnArray
> > xmlns:enc=\"http://www.w3.org/2001/06/soap-encoding\"
> >
> enc:arrayType=\"xsd:int[10]\"><item>20</item><item>21</item><item>22</it
> em
> >
> ><item>23</item><item>24</item><item>25</item><item>26</item><item>27</i
> te
> >
> m><item>28</item><item>29</item></echoIntsReturnArray></ns1:echoIntsResp
> on
> > se></env:Body></env:Envelope>---
> > 
> > 
> > REQUEST:
> > <?xml version='1.0' encoding='utf-8'?><S:Envelope
> > xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> > xmlns:S='http://www.w3.org/2003/05/soap-envelope'><S:Body><n1:sendInts
> >
> xmlns:n1='urn:Benchmark1'><size>10</size></n1:sendInts></S:Body></S:Enve
> lo
> > pe>---
> > 
> > 
> > RESPONSE:
> > <?xml version='1.0' encoding='utf-8' ?><env:Envelope
> > xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\"
> > xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
> > xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-
> > instance\"><env:Body><ns1:sendIntsResponse
> >
> xmlns:ns1=\"http://www.extreme.indiana.edu/wsdl/Benchmark1.wsdl\"><sendI
> nt
> > sReturnArray
> > xmlns:enc=\"http://www.w3.org/2001/06/soap-encoding\"
> >
> enc:arrayType=\"xsd:int[0]\"></sendIntsReturnArray></ns1:sendIntsRespons
> e>
> > </env:Body></env:Envelope>---
> > 
> > 
> > --
> > The best way to predict the future is to invent it - Alan Kay
> 
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

RE: can not send array back from service (bug?)

Posted by Susantha Kumara <su...@opensource.lk>.
I had a look at the code. I wonder why this doesnot work.
Try modifying the line 
	xsd__int_Array ret = pWs->sendInts(v0);
to 
	xsd__int_Array ret;
	memcpy(&ret, &(pWs->sendInts(v0)), sizeof(Axis_Array));

---
Susantha Kumara
Virtusa (pvt) Ltd.
Office : +94112714385
Mobile : +94777420453

> -----Original Message-----
> From: Aleksander Slominski [mailto:aslom@cs.indiana.edu]
> Sent: Tuesday, June 08, 2004 12:42 PM
> To: Apache AXIS C Developers List
> Subject: can not send array back from service (bug?)
> 
> hi,
> 
> strangely enough echo works but sending just array using thos code
does
> not work:
> 
> xsd__int_Array Benchmark1PortType::sendInts(int length)
> {
>     xsd__int_Array arr;
>     //arr.m_Size = length;
>     arr.m_Size = length;
>     arr.m_Array = new xsd__int[length];
>     for (int i=0; i < length; i++) {
>       arr.m_Array[i] = i;
>     }
>     //arr.m_Array = (int *) malloc(length * sizeof(int));
>     // fill in array with values
>     return arr;
> }
> 
> can this code be modified to work somehow?!
> 
> i must say i am lost here ...
> 
> service code in:
>
http://www.extreme.indiana.edu/~aslom/bnp/wsperf/axis_cpp/samples_server
/s
> oapbench/
> 
> alek
> 
> ps. here is what o have on the wire:
> 
> REQUEST:
> <?xml version='1.0' encoding='utf-8'?><S:Envelope
> xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> xmlns:S='http://www.w3.org/2003/05/soap-envelope'><S:Body><n1:echoInts
> xmlns:n1='urn:Benchmark1'><input
> xsi:type='SOAP-ENC:Array' SOAP-ENC:arrayType='xsd:int[10]'
> xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> xmlns:SOAP-
>
ENC='http://schemas.xmlsoap.org/soap/encoding/'><i>20</i><i>21</i><i>22<
/i
>
><i>23</i><i>24</i><i>25</i><i>26</i><i>27</i><i>28</i><i>29</i></input>
</
> n1:echoInts></S:Body></S:Envelope>---
> 
> 
> 
> RESPONSE:
> <?xml version='1.0' encoding='utf-8' ?><env:Envelope
> xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\"
> xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-
> instance\"><env:Body><ns1:echoIntsResponse
>
xmlns:ns1=\"http://www.extreme.indiana.edu/wsdl/Benchmark1.wsdl\"><echoI
nt
> sReturnArray
> xmlns:enc=\"http://www.w3.org/2001/06/soap-encoding\"
>
enc:arrayType=\"xsd:int[10]\"><item>20</item><item>21</item><item>22</it
em
>
><item>23</item><item>24</item><item>25</item><item>26</item><item>27</i
te
>
m><item>28</item><item>29</item></echoIntsReturnArray></ns1:echoIntsResp
on
> se></env:Body></env:Envelope>---
> 
> 
> REQUEST:
> <?xml version='1.0' encoding='utf-8'?><S:Envelope
> xmlns:xsd='http://www.w3.org/2001/XMLSchema'
> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> xmlns:S='http://www.w3.org/2003/05/soap-envelope'><S:Body><n1:sendInts
>
xmlns:n1='urn:Benchmark1'><size>10</size></n1:sendInts></S:Body></S:Enve
lo
> pe>---
> 
> 
> RESPONSE:
> <?xml version='1.0' encoding='utf-8' ?><env:Envelope
> xmlns:env=\"http://www.w3.org/2003/05/soap-envelope\"
> xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-
> instance\"><env:Body><ns1:sendIntsResponse
>
xmlns:ns1=\"http://www.extreme.indiana.edu/wsdl/Benchmark1.wsdl\"><sendI
nt
> sReturnArray
> xmlns:enc=\"http://www.w3.org/2001/06/soap-encoding\"
>
enc:arrayType=\"xsd:int[0]\"></sendIntsReturnArray></ns1:sendIntsRespons
e>
> </env:Body></env:Envelope>---
> 
> 
> --
> The best way to predict the future is to invent it - Alan Kay