Hi All
I am using Axis 1.6alpha ( CVS checkout ). I am trying to run a
modified array example (CPP:RPC) which segfaults if
numbers returned are > 209 but works for numbers > 100000. ( I think
this may be some sort of a memory error )
I have attached the modified client and server files of the Array
(CPP:RPC) example with the WSDL. (The rest is the files as generated by
wsdl2ws)
The server does return all the values which is seen in the SOAP-RESPONSE.
The example works fine for all values when run under gdb.
I have also tried passing various values to setServerTimeout() and got
the same results.
Any pointers to why this is happening and how it can be solved?
Cheers
Krishna
Samisa Abeysinghe wrote:
Sorry for the delay in responding.
However, the server may have run into problems due to some memory
errors (these effested client side as well) I fixed some memory
errors. Could please try now and see?
Thanks,
Samisa...
On 7/6/05, krishna <[EMAIL PROTECTED]> wrote:
Hi Fred/All
Thanks for the reply. Do you have any idea as to why the first error is
occurring or/and what I may do to debug it.
Cheers
Krishna
Fred Preston wrote:
Hi Krishna,
Answering your second question, '2. Some text - "ffb" came
into the message'. This is fine. What is happening is when you have
a large message it cannot be sent as a single block, but has to be cut
up into smaller blocks or 'chunks'. What you are seeing is called
'chunking' and the numbers are actually hexadecimal numbers that begin
each chunk and tell the transport how big that chunk is.
Regards,
Fred Preston.
*krishna <[EMAIL PROTECTED]>*
07/06/2005 02:44 AM
Please respond to "Apache AXIS C Developers List"
To: Apache AXIS C Developers List
<[email protected]>
cc:
Subject: Array example fails for large number of numbers
Hi All
I was implementing the Array example on Axis 1.6 alpha. ( echoIntArray -
The client sends an array of numbers and the server echoes the array
back to the client ). This is a RPC based webservice
The example seemed to work fine for < 200 numbers. For numbers > 200 the
I had the following problems
I have attached the source code and stubs along with this email.
Please find parts of the SOAP_RESPONSE below.
1. The server did not echo back all the numbers
<item>1159</item>
<item>1160</item>
<item>1161</item>
<item>1162</item>
<item
The message stopped here it was supposed to return 10000 items.
2. Some text - "ffb" came into the message
<item>208</item>
<item>209</item>
<item
ffb
210</item>
<item>211</item>
<item>212</item>
<item>449</item>
<item>450</item>
ffb
<item>451</item>
<item>452</item>
Is this a known issue? The output above was captured using ethereal.
Cheers
Krishna
#### example_xml_array.tar has been removed from this note on July 06
2005 by Fred Preston
/*
*Sample Code for Array: By Krishna Kumar Rajagopalan
*Uses a RPC Web Service
*
*/
#include "ArrayTestPortType.hpp"
#include <stdio.h>
#include <iostream>
#include <./../src/soap/SoapDeSerializer1.h> //points to SoapSerializer modified file SoapSerializer
#include <arpa/inet.h>
#include <netdb.h>
unsigned int ARRAY_SIZE=1;
int main(int argc,char *argv[])
{
ArrayTestPortType ws("http://localhost/axis/array");
intArrayType arr_in;
arr_in.intItem.m_Size = 1;
int arr[1];
if( argc > 1 )
arr[0]=atoi(argv[1]);
else
arr[0]=0;
arr_in.intItem.m_Array = new int *;
arr_in.intItem.m_Array[0] = &arr[0];
printf("\n Invoking Echo int Array ");
try
{
ws.setTransportTimeout(200);
if (ws.echoIntArray(&arr_in)->intItem.m_Array == NULL )
{
printf("\n Received Null \n");
}
else printf("\n Not null output ");
}
catch(AxisException& e)
{
printf("Exception : %s\n", e.what());
}
catch(exception& e)
{
printf("Unknown exception has occured\n");
}
catch(...)
{
printf("Unknown exception has occured\n");
}
return 0;
}
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains definitions of the web service
*/
#include "ArrayTestPortType.hpp"
ArrayTestPortType::ArrayTestPortType()
{
}
ArrayTestPortType::~ArrayTestPortType()
{
}
/* This function is called by the AxisEngine when something went wrong
with the current web service request processing. Appropriate actions should
be taken here.*/
void ArrayTestPortType::onFault()
{
}
/* This function is called by the AxisEngine when this web service
library is first loaded. So here we can initialize any global/static
data structures of this web service or open database connections */
void ArrayTestPortType::init()
{
}
/* This function is called by the AxisEngine when this web service
library is unloaded. So we can deallocate any global/static data structures
and close database connections etc here. */
void ArrayTestPortType::fini()
{
}
intArrayType* ArrayTestPortType::echoIntArray(intArrayType* Value0)
{
return(Value0);
/* int retSize=0;
retSize = *(Value0->intItem.m_Array[0]);
intArrayType *mp_retVal = new intArrayType;
mp_retVal->intItem.m_Array = new int* [retSize];
mp_retVal->intItem.m_Size = retSize;
for(int i=0;i<retSize;i++)
{
mp_retVal->intItem.m_Array[i] = new int;
*(mp_retVal->intItem.m_Array[i]) = i;
}
return(mp_retVal);
*/
}
<?xml version="1.0"?>
<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
<import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
<element name="intItem" type="int" />
<complexType name="intArrayType">
<sequence>
<element ref="s:intItem" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
</schema>
</types>
<message name="echoIntArrayRequest">
<part name ="inputIntArrayType" type="s:intArrayType"/>
</message>
<message name="echoIntArrayResponse">
<part name ="return" type="s:intArrayType"/>
</message>
<portType name="ArrayTestPortType">
<operation name="echoIntArray" parameterOrder="inputIntArrayType">
<input message="tns:echoIntArrayRequest"/>
<output message="tns:echoIntArrayResponse"/>
</operation>
</portType>
<binding name="ArrayTestSoapBinding" type="tns:ArrayTestPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echoIntArray">
<soap:operation soapAction="array#echoIntArray"/>
<input>
<soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="array">
<port binding="tns:ArrayTestSoapBinding" name="arrayTest">
<soap:address location="http://localhost/axis/array"/>
</port>
</service>
</definitions>