Hi Chinthana

Thanks for your prompt response. I must apologise for the fact that the files sent last time had a few lines of code commented which should not have been so. I have corrected the files and attached them.

The modified array service (attached) sends an integer to the server ( say 'n' ) and the server responds to the request by sending all numbers < n ( that makes it n numbers )
in the SOAP-RESPONSE.

So if i have the number 1000 (generalized as 'n' above) in the SOAP-REQUEST then i get 1000 numbers back in the SOAP-RESPONSE.

While doing so I am facing errors with the service in the fashion described in my previous email.

Quoting from my previous email

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


So when this parameter 'n' < 209 all works fine. when this parameter n > 100000 it sometimes works fine and sometimes doesnt. But when n > 209 and n < 100000 I always get a segmentation fault on the client side.( The numbers used here are very specific to the example )

The server side does generate the xml for all the numbers which can be verified by capturing the soap response.

It is interesting to note that when this is run through gdb no errors/segmentation faults occur.

Cheers
Krishna

Chinthana C. Dinapala wrote:

Hi Krishna,

I have checked your Array example and got following out put.

Invoking Echo int Array

Not null output

But in your client code you have used following files which is not compile for me.

#include <./../src/soap/SoapDeSerializer1.h> //points to SoapSerializer modified file SoapSerializer

#include <arpa/inet.h>

#include <netdb.h>

Seems to me you have using some modified SoapSerializer and other files I don’t have any idea.

I got following SOAP messages.

*Sending……………………….*

<?xml version='1.0' encoding='utf-8' ?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

<SOAP-ENV:Body>

<ns1:echoIntArray xmlns:ns1="http://soapinterop.org/";>

<intArrayType xsi:type="ns2:intArrayType" xmlns:ns2="http://soapinterop.org/xsd";><intItemArray xmlns:enc="http://www.w3.org/2001/06/soap-encoding"; enc:arrayType="xsd:int[1]">

<item>0</item>

</intItemArray>

</intArrayType></ns1:echoIntArray>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

*Received……………………………………………………….*

<?xml version='1.0' encoding='utf-8' ?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

<SOAP-ENV:Body>

<ns1:echoIntArrayResponse xmlns:ns1="http://soapinterop.org/";>

<intArrayType xsi:type="ns2:intArrayType" xmlns:ns2="http://soapinterop.org/xsd";><intItemArray xmlns:enc="http://www.w3.org/2001/06/soap-encoding"; enc:arrayType="xsd:int[1]">

<item>0</item>

</intItemArray>

</intArrayType></ns1:echoIntArrayResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

I have modified only client code and I have attached it. (I just set the SOAP action and the URL and comment the 3 files I mention above)

Thanks

-----Original Message-----
From: krishna [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 23, 2005 7:03 AM
To: Apache AXIS C Developers List
Subject: Re: Array example fails for large number of numbers

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
 *Uses a RPC Web Service
 */

#include "ArrayTestPortType.hpp"
#include <stdio.h>
#include <iostream>

unsigned int ARRAY_SIZE=1;

/* 
 * The client sends an integer 'n' to the server which responds with
 * all integers < 'n' in the soap response ie. if n=10 then the numbers
 * 1,2,3 .... 7,8,9 are returned. So if n =1000, 0 to 999 is returned.
 */




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)  
{
	/* returns all values < retSize in the soap response */
	
	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>

Reply via email to