Limitations to size of request/response

1,459 views
Skip to first unread message

Narayan, Jyothirmai (SCR US EXT)

unread,
Aug 2, 2011, 1:54:15 PM8/2/11
to ws4d-gso...@googlegroups.com
Can you tell me what are the limitations to the size of the request/response using WS4D-gSOAP?  I was able to send a response of 8 megabytes but for 8.5 megabytes the SOAP call returned an error.
 
Regards,
 
Jyothi Narayan
 
Siemens Corporate Research
 
 
 

Elmar Zeeb

unread,
Aug 4, 2011, 7:48:41 AM8/4/11
to ws4d-gso...@googlegroups.com
Hello Jyothi,

WS4D-gSOAP does not limit the message size for hosted services, as messaging is done by gSOAP. I couldn't find any message size limitations in gSOAP in general but there is a SOAP_BUFLEN flag to specify the message buffer size. By default this flag is set to 65536 bytes. This means that for regular HTTP transport encoding, an endpoint can send or receive HTTP messages with maximum size of 65536 bytes. For HTTP chunked transport encoding each chunk should not exceed the size of 65536 bytes.

So you can tune this value to fit your needs. But i would suggest to use HTTP chunked encoding and check that the other side does not generate chunks bigger than 65536 bytes. If I remember correctly the DPWS specification as well as WS-I limits the SOAP message size to 32,767 octets. So in general it is also not best practice to have very but SOAP messages but to use Attachments to transfer big payloads. In this case you are also not bound to XML or the XML default UTF8 based encoding. So there are plenty of ways to transfer big chunks of data with DPWS and WS based protocols.

Looking at your measurements, I would say that this may be a bug or maybe a problem with too large HTTP chunks, or something else. Can you reproduce this 8.5 megabytes limit reliably?

To be really sure that there is no SOAP message size limit in gSOAP, you should ask at the mailing lists of gsoap.

Regards,
Elmar
--
You received this message because you are subscribed to the Google Groups "WS4D-gSOAP Users" group.
To post to this group, send email to ws4d-gso...@googlegroups.com.
To unsubscribe from this group, send email to ws4d-gsoap-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ws4d-gsoap-users?hl=en.

Narayan, Jyothirmai (SCR US EXT)

unread,
Aug 4, 2011, 11:04:54 AM8/4/11
to ws4d-gso...@googlegroups.com

Hello Elmar,

 

Thanks for the information.  I can reproduce the 8.5 MB limit reliably.  I will investigate using MTOM attachments by studying the gSOAP User Guide.  Do you have an example of using attachments with WS4D-gSOAP?  Appreciate any info that you can give me about attachments in the context of WS4D-gSOAP.

 

Regards,

 

Jyothi

Elmar Zeeb

unread,
Aug 8, 2011, 3:18:37 AM8/8/11
to ws4d-gso...@googlegroups.com
Am 04.08.2011 17:04, schrieb Narayan, Jyothirmai (SCR US EXT):

Hello Elmar,

 

Thanks for the information.  I can reproduce the 8.5 MB limit reliably.  I will investigate using MTOM attachments by studying the gSOAP User Guide.  Do you have an example of using attachments with WS4D-gSOAP?  Appreciate any info that you can give me about attachments in the context of WS4D-gSOAP.

There is an example in the interoperability test:
http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/samples/ms-iop/AttachmentService.c
http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/samples/ms-iop/AttachmentService.h

But there are better ways to implement attachments in gSOAP:
http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc16.3
http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc16.5

But I didn't try them yet.

If you can post "improved" examples, i can include them in the samples directory of ws4d-gsoap.

Regards,
Elmar

Narayan, Jyothirmai (SCR US EXT)

unread,
Aug 8, 2011, 11:41:36 AM8/8/11
to ws4d-gso...@googlegroups.com

Hi Elmar,

 

I was able to send a large file as an attachment using WS4D-gSOAP in a fraction of the time required for sending it as in-line (non-attachment).  In order to send it as an MTOM attachment I need to set the following flag in gSOAP’s soap struct context:

 

struct soap *soap = soap_new1(SOAP_ENC_MTOM);

 

Can you tell me how to do this in WS4D-gSOAP without interfering with the normal execution?  I have used the soap struct as given in the examples:

 

struct soap client;

struct soap service;

 

I will try to look into it further myself but  appreciate your input since you are more familiar with the use of this struct.  If I have an improved example over the ones that you sent me, I will try to send you one after discussing with my manager.

Elmar Zeeb

unread,
Aug 8, 2011, 11:50:40 AM8/8/11
to ws4d-gso...@googlegroups.com
Am 08.08.2011 17:41, schrieb Narayan, Jyothirmai (SCR US EXT):

Hi Elmar,

 

I was able to send a large file as an attachment using WS4D-gSOAP in a fraction of the time required for sending it as in-line (non-attachment).  In order to send it as an MTOM attachment I need to set the following flag in gSOAP’s soap struct context:

 

struct soap *soap = soap_new1(SOAP_ENC_MTOM);

 

Can you tell me how to do this in WS4D-gSOAP without interfering with the normal execution?  I have used the soap struct as given in the examples:

You can do this for example in the airconditioner example in line http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/samples/tutorial/files/src/simple_airconditioner.c#L129

WS4D-gSOAP should not interfere with the "service" handle as it uses separate internal handles for discovery etc.

Theres a small example in the interoperability test device:
http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/samples/ms-iop/iop_device.c#L181
http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/samples/ms-iop/AttachmentService.c

Regards,
Elmar

Narayan, Jyothirmai (SCR US EXT)

unread,
Aug 8, 2011, 4:47:17 PM8/8/11
to ws4d-gso...@googlegroups.com

Elmar,

 

Thanks for your prompt response!  In order to use the MTOM attachments in my service, I need to import the following files:

 

#import ïmport/soap12.h"
/* alternatively, without the import above, use:
//gsoap SOAP-ENV schema namespace: http://www.w3.org/2003/05/soap-envelope
//gsoap SOAP-ENC schema namespace: http://www.w3.org/2003/05/soap-encoding
*/
#import ïmport/xop.h"
#import ïmport/xmime5.h"

(taken from gSOAP user guide)

 

I was able to import xop.h but not soap12.h and xmime5.h

 

If I use the SOAP-ENV and SOAP-ENC instead I get the following errors:

 

**WARNING**: option -1 or -2 overrides SOAP-ENV namespace (detected at line 46 in /home/jnarayan/ws4d-gsoap-projects/pd_mtom/src/pd.gsoap)

 

 

**WARNING**: option -1 or -2 overrides SOAP-ENC namespace (detected at line 47 in /home/jnarayan/ws4d-gsoap-projects/pd_mtom/src/pd.gsoap)

 

Without these imports I am able to build the application, but when I set the SOAP_ENC_MTOM flag the attachment is not sent properly.  Can you suggest a solution?

 

By the way, can I set the SOAP_ENC_MTOM flag by “soap_set_omode(&service,SOAP_ENC_MTOM)”   following the call to soap_init,  or should I use soap_init1(&service, SOAP_ENC_MTOM) instead?

 

Thanks in advance for your help!

 

Jyothi

 

 

 

From: ws4d-gso...@googlegroups.com [mailto:ws4d-gso...@googlegroups.com] On Behalf Of Elmar Zeeb
Sent: Monday, August 08, 2011 11:51 AM
To: ws4d-gso...@googlegroups.com
Subject: Re: Limitations to size of request/response

 

Am 08.08.2011 17:41, schrieb Narayan, Jyothirmai (SCR US EXT):

--

Elmar Zeeb

unread,
Aug 10, 2011, 2:38:45 AM8/10/11
to ws4d-gso...@googlegroups.com
Am 08.08.2011 22:47, schrieb Narayan, Jyothirmai (SCR US EXT):

Elmar,

 

Thanks for your prompt response!  In order to use the MTOM attachments in my service, I need to import the following files:

 

#import ïmport/soap12.h"
/* alternatively, without the import above, use:
//gsoap SOAP-ENV schema namespace: http://www.w3.org/2003/05/soap-envelope
//gsoap SOAP-ENC schema namespace: http://www.w3.org/2003/05/soap-encoding
*/
#import ïmport/xop.h"
#import ïmport/xmime5.h"

(taken from gSOAP user guide)

 

I was able to import xop.h but not soap12.h and xmime5.h

 

If I use the SOAP-ENV and SOAP-ENC instead I get the following errors:

 

**WARNING**: option -1 or -2 overrides SOAP-ENV namespace (detected at line 46 in /home/jnarayan/ws4d-gsoap-projects/pd_mtom/src/pd.gsoap)

 

 

**WARNING**: option -1 or -2 overrides SOAP-ENC namespace (detected at line 47 in /home/jnarayan/ws4d-gsoap-projects/pd_mtom/src/pd.gsoap)

 

Without these imports I am able to build the application, but when I set the SOAP_ENC_MTOM flag the attachment is not sent properly.  Can you suggest a solution?

Yes, ws4d-gsoap ships a xop.h in: http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/WS/xop.h .
You don't need the soap12.h, because the same is already done by the #import "devprof.gsoap".
And I think you don't need the xmime5.h.

You should declare the mtom attachment as in http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/samples/ms-iop/AttachmentService.h

Of course there may be missing something as i never used the mtom attachment streaming api of gsoap but the non streaming api.


 

By the way, can I set the SOAP_ENC_MTOM flag by “soap_set_omode(&service,SOAP_ENC_MTOM)”   following the call to soap_init,  or should I use soap_init1(&service, SOAP_ENC_MTOM) instead?

Doesn't matter, it is the same
Reply all
Reply to author
Forward
0 new messages