You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Pawel Pustelnik <pp...@future-processing.com> on 2006/05/31 21:38:27 UTC

xsd_Base64

Hello All,

 

What is the maximum size of the xsd_Base64 array?

I am asking because I found something strange. 

I want to send a binary data from the server to the client.

I implemented the client and server using apache axis and it is working but
not perfectly.

I read the image file (for example some JPG file) and send it to the client.
However when data size is more then 36615 bytes then the client can only
read 36615 bytes.

Is it a bug in axis? (I created very similar server in *.asmx file under
Windows and I can send very big images without any problems).

 

Regards,

Pawel

 

 

--

Pawel Pustelnik

Control Engineer

 

-----------------------------------------------

 Future Processing Sp. z o.o.

 Tel: +48 604 084 653

 Tel/Fax: +48 32 2726202

 ppustelnik@future-processing.com

 www.future-processing.com

-----------------------------------------------

 


RE: xsd_Base64

Posted by Pawel Pustelnik <pp...@future-processing.com>.
Hello,

I tested it again and now I know where the problem is. The service part is
fine but the client one is working with problems. My server can send a very
big images to the clients and clients working under Windows (written in C#)
are ok. However when I want to implement the same clients (using AxisC++)
under Linux then I have a problems,
If the data which should be received is bigger than 36615 bytes I can not
receive it. 

Here is the code:

xsd__base64Binary Imager::add(xsd__int Value0)
{
	xsd__base64Binary	Ret;
	const char *	pcCmplxFaultName = NULL;

	try
	{
		if( AXIS_SUCCESS != m_pCall->initialize( CPP_RPC_PROVIDER))
		{
			return Ret;
		}

		if( NULL == m_pCall->getTransportProperty( "SOAPAction",
false))
		{
			m_pCall->setTransportProperty( SOAPACTION_HEADER,
	
"Imager#add");
		}

		m_pCall->setSOAPVersion( SOAP_VER_1_1);
		m_pCall->setOperation( "add",
"http://localhost/axis/Imager");
		applyUserPreferences();
		m_pCall->addParameter( (void *) &Value0, "in0", XSD_INT);

		if( AXIS_SUCCESS == m_pCall->invoke())
		{
			if( AXIS_SUCCESS == m_pCall->checkMessage(
"addResponse",
	
"http://localhost/axis/Imager"))
			{
				//******************************************

				//Here is the place when the code can
hang...
	
//*******************************************
				xsd__base64Binary * pReturn =
m_pCall->getElementAsBase64Binary( "addReturn", 0);

				if( pReturn)
				{
					Ret = *pReturn;
					Axis::AxisDelete( (void *) pReturn,
XSD_BASE64BINARY);
				}
			}
		}

		m_pCall->unInitialize();
		return Ret;
	}
	catch( AxisException& e)
	{
		int iExceptionCode = e.getExceptionCode();

		if( AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
		{
			throw SoapFaultException( e);
		}

		ISoapFault *	pSoapFault = (ISoapFault *)
m_pCall->checkFault( "Fault",
	
"http://localhost/axis/Imager");

		if( pSoapFault)
		{
			m_pCall->unInitialize();

			throw SoapFaultException( e);
		}
		else
		{
			throw;
		}
	}
}

Regards,
Pawel

-----Original Message-----
From: Adrian Dick [mailto:adrian.dick@uk.ibm.com] 
Sent: Thursday, June 01, 2006 11:31 AM
To: Apache AXIS C User List
Subject: Re: xsd_Base64

Hi,

You say the maximum data size you can use is 36,615 -- is this just for a
particular example, or have you experimented with different sizes around
this value?

Taking a quick look through the code, I can see that we may have a problem
with large data objects, as the data length is stored as an int.
According to the ANSI C spec this is a signed 16bit integer, so having a
maximum value of 32,767, although a number of compilers use a 32bit integer
which increase this to a maximum value of 2,147,483,647.

Changing this to an unsigned long long (64bit integer) will give a maximum
of 18,446,744,073,709,551,615, sufficient for most needs.

Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)


"Pawel Pustelnik" <pp...@future-processing.com> wrote on 31/05/2006
20:38:27:

> Hello All,
>
> What is the maximum size of the xsd_Base64 array?
> I am asking because I found something strange.
> I want to send a binary data from the server to the client.
> I implemented the client and server using apache axis and it is 
> working but not perfectly.
> I read the image file (for example some JPG file) and send it to the 
> client. However when data size is more then 36615 bytes then the 
> client can only read 36615 bytes.
> Is it a bug in axis? (I created very similar server in *.asmx file 
> under Windows and I can send very big images without any problems).
>
> Regards,
> Pawel
>
>
> --
> Pawel Pustelnik
> Control Engineer
>
> -----------------------------------------------
>  Future Processing Sp. z o.o.
>  Tel: +48 604 084 653
>  Tel/Fax: +48 32 2726202
>  ppustelnik@future-processing.com
>  www.future-processing.com
> -----------------------------------------------
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: xsd_Base64

Posted by Adrian Dick <ad...@uk.ibm.com>.
Hi,

You say the maximum data size you can use is 36,615 -- is this just for a
particular example, or have you experimented with different sizes around
this value?

Taking a quick look through the code, I can see that we may have a problem
with large data objects, as the data length is stored as an int.
According to the ANSI C spec this is a signed 16bit integer, so having a
maximum value of 32,767, although a number of compilers use a 32bit integer
which increase this to a maximum value of 2,147,483,647.

Changing this to an unsigned long long (64bit integer) will give a maximum
of 18,446,744,073,709,551,615, sufficient for most needs.

Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)


"Pawel Pustelnik" <pp...@future-processing.com> wrote on 31/05/2006
20:38:27:

> Hello All,
>
> What is the maximum size of the xsd_Base64 array?
> I am asking because I found something strange.
> I want to send a binary data from the server to the client.
> I implemented the client and server using apache axis and it is
> working but not perfectly.
> I read the image file (for example some JPG file) and send it to the
> client. However when data size is more then 36615 bytes then the
> client can only read 36615 bytes.
> Is it a bug in axis? (I created very similar server in *.asmx file
> under Windows and I can send very big images without any problems).
>
> Regards,
> Pawel
>
>
> --
> Pawel Pustelnik
> Control Engineer
>
> -----------------------------------------------
>  Future Processing Sp. z o.o.
>  Tel: +48 604 084 653
>  Tel/Fax: +48 32 2726202
>  ppustelnik@future-processing.com
>  www.future-processing.com
> -----------------------------------------------
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org