Kannel gSOAP support

Jan Chrillesen <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi Stipe

I am very interested in testing your patch from
http://www.mail-archive.com/[email protected]/msg10447.html
I have access to a SMSC large account on an Aepona CPS system, which is
based on the the OneAPI specification.  The patch applies cleanly to the
latest kannel snapshot, but it seem to be very picky with the gsoap
version. First I tried to compile against 2.7.15, which is the latest in
FreeBSD ports (I build on FreeBSD), and 2.7.15 seems to be missing
wsuid. Then I installed the latest gsoap (2.8.1) and found a number of
variables has changed in the header files. The attached patch shows the
changes I made. With the patch applied everything compiles (ofcourse
configured with --with-gsoap)

My issue is getting the correct header files with wsdl2h and getting
things to compile afterwards

I issue
wsdl2h
"https://cpsapi.tdc.dk/SmsNotificationManagerService/a4017e6404e1ce0395d8479993db1148?wsdl"
"https://cpsapi.tdc.dk/ReceiveSmsService/90c88b8c1c1b1d2057f893538da95436?wsdl"
"https://cpsapi.tdc.dk/SendSmsService/fb2c3b9ac5c3b76dad46a03d2e7f8599?wsdl"
"https://cpsapi.tdc.dk/SendWapPushService/e47fffd5eaed944f534c38937d0abe7e?wsdl"
> parlayx_sms_send_service_2_1.h
to build the header file (the 4 URLS's above represents the XML
endpoints available to my account)


**  The gSOAP WSDL/Schema processor for C and C++, wsdl2h release 2.8.1
**  Copyright (C) 2000-2010 Robert van Engelen, Genivia Inc.
**  All Rights Reserved. This product is provided "as is", without any
warranty.
**  The wsdl2h tool is released under one of the following two licenses:
**  GPL or the commercial license by Genivia Inc. Use option -l for details.

Cannot open file 'typemap.dat'
Problem reading type map file 'typemap.dat'.
Using internal type definitions for C++ instead.


Connecting to
'https://cpsapi.tdc.dk/SmsNotificationManagerService/a4017e6404e1ce0395d8479993db1148?wsdl'
to retrieve WSDL/XSD...
Connected, receiving...

Connecting to
'http://cpsapi.tdc.dk/SmsNotificationManagerService/a4017e6404e1ce0395d8479993db1148?wsdl=SmsNotificationManager.wsdl'
to retrieve WSDL/XSD...
Connected, receiving...
Done reading
'http://cpsapi.tdc.dk/SmsNotificationManagerService/a4017e6404e1ce0395d8479993db1148?wsdl=SmsNotificationManager.wsdl'
Done reading
'https://cpsapi.tdc.dk/SmsNotificationManagerService/a4017e6404e1ce0395d8479993db1148?wsdl'

Connecting to
'https://cpsapi.tdc.dk/ReceiveSmsService/90c88b8c1c1b1d2057f893538da95436?wsdl'
to retrieve WSDL/XSD...
Connected, receiving...

Connecting to
'http://cpsapi.tdc.dk/ReceiveSmsService/90c88b8c1c1b1d2057f893538da95436?wsdl=ReceiveSms.wsdl'
to retrieve WSDL/XSD...
Connected, receiving...
Done reading
'http://cpsapi.tdc.dk/ReceiveSmsService/90c88b8c1c1b1d2057f893538da95436?wsdl=ReceiveSms.wsdl'
Done reading
'https://cpsapi.tdc.dk/ReceiveSmsService/90c88b8c1c1b1d2057f893538da95436?wsdl'

Connecting to
'https://cpsapi.tdc.dk/SendSmsService/fb2c3b9ac5c3b76dad46a03d2e7f8599?wsdl'
to retrieve WSDL/XSD...
Connected, receiving...

Connecting to
'http://cpsapi.tdc.dk/SendSmsService/fb2c3b9ac5c3b76dad46a03d2e7f8599?wsdl=SendSms.wsdl'
to retrieve WSDL/XSD...
Connected, receiving...
Done reading
'http://cpsapi.tdc.dk/SendSmsService/fb2c3b9ac5c3b76dad46a03d2e7f8599?wsdl=SendSms.wsdl'
Done reading
'https://cpsapi.tdc.dk/SendSmsService/fb2c3b9ac5c3b76dad46a03d2e7f8599?wsdl'

Connecting to
'https://cpsapi.tdc.dk/SendWapPushService/e47fffd5eaed944f534c38937d0abe7e?wsdl'
to retrieve WSDL/XSD...
Connected, receiving...

Connecting to
'http://cpsapi.tdc.dk/SendWapPushService/e47fffd5eaed944f534c38937d0abe7e?wsdl=SendWapPush.wsdl'
to retrieve WSDL/XSD...
Connected, receiving...
Done reading
'http://cpsapi.tdc.dk/SendWapPushService/e47fffd5eaed944f534c38937d0abe7e?wsdl=SendWapPush.wsdl'
Done reading
'https://cpsapi.tdc.dk/SendWapPushService/e47fffd5eaed944f534c38937d0abe7e?wsdl'
Warning: no soap:fault message in WSDL definitions '' operation
'startSmsNotification' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'startSmsNotification' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'stopSmsNotification' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'stopSmsNotification' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'getReceivedSms' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'getReceivedSms' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSmsRingtone' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSmsRingtone' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'getSmsDeliveryStatus' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'getSmsDeliveryStatus' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSmsBinary' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSmsBinary' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSmsLogo' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSmsLogo' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSms' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendSms' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendWapPush' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'sendWapPush' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'getWapPushDeliveryStatus' namespace
Warning: no soap:fault message in WSDL definitions '' operation
'getWapPushDeliveryStatus' namespace
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'PolicyException'
Error: no wsdl:definitions/binding/operation/fault/soap:fault
'ServiceException'

I am not sure how serious these errors are, and a header file is created:

$ ls -l parlayx_sms_send_service_2_1.h
-rw-r--r--  1 chrille  chrille  96400 Feb 10 14:11
parlayx_sms_send_service_2_1.h

However, with the new header file in place I am no longer able to build
kannel:

]$ gmake
/usr/local/bin/soapcpp2 -d `dirname soap/service/parlayx/soapH.h` -I
soap/import -cLxw soap/service/parlayx/parlayx_sms_send_service_2_1.h

**  The gSOAP code generator for C and C++, soapcpp2 release 2.8.1
**  Copyright (C) 2000-2010, Robert van Engelen, Genivia Inc.
**  All Rights Reserved. This product is provided "as is", without any
warranty.
**  The soapcpp2 tool is released under one of the following two licenses:
**  GPL or the commercial license by Genivia Inc.

Critical error: #import: Cannot open file "stlvector.h" for reading.
Hint: use option -I<path> (you can define multiple paths separated with ':')
gmake: *** [soap/service/parlayx/soapH.h] Error 1

This can be fixed by copying stlvector.h from the gsoap distribution to
the root of the kannel source tree

This triggers a new error:

gcc -std=gnu99 -D_REENTRANT=1 -I. -Igw -g -O2 -pthread -D_LARGE_FILES=
-I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include
-Wall -I/usr/include/openssl -Isoap/plugin -DWITH_OPENSSL -o
gw/smsc/smsc_soap_parlayx.o -c gw/smsc/smsc_soap_parlayx.c
In file included from ./soap/service/parlayx/soapH.h:10,
                 from gw/smsc/smsc_soap_parlayx.c:81:
./soap/service/parlayx/soapStub.h:10:18: error: vector: No such file or
directory
In file included from ./soap/service/parlayx/soapStub.h:19,
                 from ./soap/service/parlayx/soapH.h:10,
                 from gw/smsc/smsc_soap_parlayx.c:81:
/usr/local/include/stdsoap2.h:305:1: warning: "HAVE_GETTIMEOFDAY" redefined
In file included from ./gwlib/gwlib.h:74,
                 from gw/smsc/smsc_soap_parlayx.c:70:
./gw-config.h:117:1: warning: this is the location of the previous
definition
In file included from ./soap/service/parlayx/soapStub.h:19,
                 from ./soap/service/parlayx/soapH.h:10,
                 from gw/smsc/smsc_soap_parlayx.c:81:
/usr/local/include/stdsoap2.h:307:1: warning: "HAVE_GMTIME_R" redefined
In file included from ./gwlib/gwlib.h:74,
                 from gw/smsc/smsc_soap_parlayx.c:70:
./gw-config.h:129:1: warning: this is the location of the previous
definition
In file included from ./soap/service/parlayx/soapStub.h:19,
                 from ./soap/service/parlayx/soapH.h:10,
                 from gw/smsc/smsc_soap_parlayx.c:81:
/usr/local/include/stdsoap2.h:308:1: warning: "HAVE_LOCALTIME_R" redefined
In file included from ./gwlib/gwlib.h:74,
                 from gw/smsc/smsc_soap_parlayx.c:70:
./gw-config.h:126:1: warning: this is the location of the previous
definition
In file included from ./soap/service/parlayx/soapH.h:10,
                 from gw/smsc/smsc_soap_parlayx.c:81:

Here I am stuck: I am a network engineer, and not a developer, and my C
skills are pretty limited.  Any hints on where to move on from here is
highly appreciated

Finally, a working example on a smsc definition is also highly
appreciated. I created this entry based on the post from november and by
looking a bit at the source:

group = smsc
smsc = parlayx
system-type = gsma-oneapi
smsc-id = CPSAPI
smsc-username = XXXX
smsc-password = XXXX
port = 10000
send-url =
http://cpsapi.tdc.dk/SendSmsService/fb2c3b9ac5c3b76dad46a03d2e7f8599
dlr-url =
http://cpsapi.tdc.dk/SmsNotificationManagerService/a4017e6404e1ce0395d8479993db1148

Regards
Jan
wsseapi-gsoap-2.8.1.patch (text/plain, 2.1 KB)
--- soap/service/parlayx/wsseapi.c.BAK	2011-02-09 12:24:09.000000000 +0100
+++ soap/service/parlayx/wsseapi.c	2011-02-09 12:27:12.000000000 +0100
@@ -2704,7 +2704,7 @@
 { int err;
   DBGFUN1("soap_wsse_sign_body", "alg=%d", alg);
   soap_wsse_add_Security(soap);
-  soap->omode |= SOAP_XML_SEC;
+  soap->omode |= SOAP_SEC_WSUID;
   err = soap_wsse_sign(soap, alg, key, keylen);
   return err;
 }
@@ -2772,7 +2772,7 @@
   if (!data)
     return soap_set_receiver_error(soap, "soap_wsse_verify_done", "Plugin not registered", SOAP_PLUGIN_ERROR);
   soap->imode &= ~SOAP_XML_DOM;
-  soap->omode &= ~SOAP_XML_SEC;
+  soap->omode &= ~SOAP_SEC_WSUID;
   if (soap->fpreparefinalrecv == soap_wsse_preparefinalrecv)
     soap->fpreparefinalrecv = data->fpreparefinalrecv;
   return SOAP_OK;
@@ -2939,9 +2939,9 @@
   if (!data)
     return SOAP_PLUGIN_ERROR;
   /* the gSOAP engine signals the start of a wsu:Id element */
-  if (soap->part == SOAP_BEGIN_SECURITY)
+  if (soap->part == SOAP_SEC_BEGIN)
   { /* found element with wsu:Id so change engine state to start digest */
-    soap->part = SOAP_IN_SECURITY;
+    soap->part = SOAP_SEC_SIGN;
     /* already computing digest? */
     /* the state cannot change to BEGIN when currently in IN state any longer */
     if (data->digest && data->digest->level)
@@ -2963,12 +2963,12 @@
         goto end;
     }
   }
-  if (soap->part == SOAP_IN_SECURITY)
+  if (soap->part == SOAP_SEC_SIGN)
   { /* update smdevp engine */
     if (data->digest)
     { soap_smd_update(soap, &data->digest->smd, buf, len);
       if (soap->level < data->digest->level)
-      { soap->part = SOAP_END_SECURITY;
+      { soap->part = 12;
         soap_smd_final(soap, &data->digest->smd, (char*)data->digest->hash, NULL);
         data->digest->level = 0;
       }
@@ -3085,7 +3085,7 @@
 soap_wsse_preparefinalrecv(struct soap *soap)
 { struct soap_wsse_data *data = (struct soap_wsse_data*)soap_lookup_plugin(soap, soap_wsse_id);
   ds__SignedInfoType *signedInfo = soap_wsse_SignedInfo(soap);
-  soap->omode &= ~SOAP_XML_SEC;
+  soap->omode &= ~SOAP_SEC_WSUID;
   DBGFUN("soap_wsse_preparefinalrecv");
   if (!data)
     return SOAP_PLUGIN_ERROR;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.