Enable Mtom

164 views
Skip to first unread message

jaimini tapas

unread,
Feb 17, 2012, 10:27:33 PM2/17/12
to WS4D-gSOAP Development, elmar...@uni-rostock.de
hi,
i m working on scanner server which replies me with multipart data.
Request is not of Mtom type only respones i need to handle. is this
possible to recieve mtom data without changing my work flow.
Any help is appreciated and thanks in advance.

regards
jaimini

Elmar Zeeb

unread,
Feb 19, 2012, 5:15:56 PM2/19/12
to ws4d-gs...@googlegroups.com
Hi Jaimini,
There are several steps to create a service or client with mtom attachment support.

In general ws4d-gsoap is based on the web service toolkit gsoap. This toolkit supports mtom message attachments. So the following steps describe how to enable this feature in ws4d-gsoap.

1. Enable mtom in gsoap file:
[...]
/******************************************************************************\
 *                                                                            *
 * Import                                                                     *
 *                                                                            *
\******************************************************************************/
  
#import "devprof.gsoap"
#import "xop.h"

[...]
See

2. Define message with xop:Include type:
[...]
struct ats1__AttachmentType
{
  _xop__Include Param 1;        ///< Required element.
};

[...]
See http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/interop/AttachmentService.h#L69 for an example

3. Enable mtom feature of specific soap handle:
[...]
soap_init1 (&attachmentservice, SOAP_ENC_MTOM);
[...]
See http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/interop/iop_device.c#L181 for an example

4. Use attachment in skeleton/stub code:
Skeleton:
http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/interop/AttachmentService.c#L45
Stub:
http://trac.e-technik.uni-rostock.de/projects/ws4d-gsoap/browser/trunk/src/interop/attachment_service_client.c#L111

That's it.

I'm not sure if wsdl2h adds the required steps in gsoap files. So if you have an existing WSDL you have to check if the steps above are done.

I hope this was comprehensive enough.

Regards,
Elmar


Reply all
Reply to author
Forward
0 new messages