Modifying SOAP interface

Version 7 (Michael Troß, 02/03/2012 09:46 am)

1 1 Patrick Stählin
h1. Modifying SOAP interface
2 1 Patrick Stählin
3 7 Michael Troß
> *NOTE:* this page is deprecated, as of version 1.4.0 the soap interface files are automatically generated through the build process.
4 7 Michael Troß
5 1 Patrick Stählin
The SOAP interface is defined by @webservices/model_soap.h@. From this header-file several other files are generated (everything except @model_soap.*@). After modifying @model_soap.h@ these files have to be regenerated by issuing:
6 1 Patrick Stählin
7 2 Patrick Stählin
<pre>soapcpp2 -SLx model_soap.h</pre>
8 2 Patrick Stählin
or on Ubuntu:
9 2 Patrick Stählin
<pre>soapcpp2 -I/usr/include/gsoap/ -SLx model_soap.h
10 2 Patrick Stählin
</pre>
11 1 Patrick Stählin
12 5 Patrick Stählin
on Mac OS X:
13 5 Patrick Stählin
<pre>soapcpp2 -I /opt/local/share/gsoap/import/ -SLx model_soap.h</pre>
14 5 Patrick Stählin
15 4 Patrick Stählin
After regenerating those file you need to apply the following patch:
16 4 Patrick Stählin
17 6 Michael Troß
<pre>
18 6 Michael Troß
--- ./webservices/soapdssObject.h.gen	2011-10-13 13:34:06.985806729 +0200
19 6 Michael Troß
+++ ./webservices/soapdssObject.h	2011-10-14 10:13:19.502578656 +0200
20 4 Patrick Stählin
@@ -9,6 +9,9 @@
21 4 Patrick Stählin
 #define soapdssObject_H
22 4 Patrick Stählin
 #include "soapH.h"
23 4 Patrick Stählin
 
24 4 Patrick Stählin
+// soap_accept() timeout in seconds
25 4 Patrick Stählin
+#define SOAP_ACCEPT_TIMEOUT 2
26 1 Patrick Stählin
+
27 1 Patrick Stählin
 /******************************************************************************\
28 4 Patrick Stählin
  *                                                                            *
29 4 Patrick Stählin
  * Service Object                                                             *
30 6 Michael Troß
@@ -27,6 +30,8 @@
31 6 Michael Troß
 	{"dss", "urn:dss:1.0", NULL, NULL},
32 6 Michael Troß
 	{NULL, NULL, NULL, NULL}
33 4 Patrick Stählin
 };
34 6 Michael Troß
+	bind_flags = SO_REUSEADDR;
35 6 Michael Troß
+	accept_timeout = SOAP_ACCEPT_TIMEOUT; // seconds
36 6 Michael Troß
 	if (!this->namespaces) this->namespaces = namespaces; };
37 6 Michael Troß
 	virtual ~dssService() { };
38 6 Michael Troß
 	/// Bind service to port (returns master socket or SOAP_INVALID_SOCKET)
39 6 Michael Troß
40 4 Patrick Stählin
</pre>
41 3 Sergey Bostandzhyan
42 3 Sergey Bostandzhyan
Note, that as of version 0.7.7 the SOAP interface is using SSL, more information regarding the SSL setup is available [[How_to_build_the_dSS#Configuring|here]].