22 November 2010

To align or not to align, that is the question!


All of the gSOAP runtime is compiled with member alignment (and needs to be for various reasons), so if you have code you are integrating with that contains structures that need to be compiled with /nomember_alignment, you will have to be a little careful about how you mix and match; however, aligned and unaligned structures can happily co-exist, if you do things right. What I typically do in this circumstance is to use the following #pragma directives:

#pragma member_alignment save
#pragma nomember_alignment
/* unsligned.h contains structures that need /nomember_alignment (or you could just include the actual structure definitions within
   The #pragma directives */
#include "unaligned.h"    
#pragma member_alignment restore

Please ensure  that generated gSOAP stubs and code that includes gSOAP header files is compiled with member alignment. Note that you can use the #pragma statements to include in your code structures that are not aligned.
The following brief example might help to illustrate how to adjust for aligned and unaligned structures being mixed in the same program module.
___________________________________
#ifndef __UNALIGNED_H__
#define __UNALIGNED_H__

typedef struct
{
   double a;
   double b;
   char str[60];
}
unaligned_i_struct_t;

typedef struct
{
   double result;
   char str[60];
}
unaligned_o_struct_t;

#ifdef __cplusplus
    extern "C" {
#endif

extern int unaligned_cstruct(unaligned_i_struct_t *, unaligned_o_struct_t *);

#ifdef __cplusplus
    }
#endif
#endif

_____________________________________________________
#include       /* toupper() */
#include
#include "unaligned.h"


int unaligned_cstruct(unaligned_i_struct_t *ibuf, unaligned_o_struct_t *obuf)
{
   char *tmp;

   obuf->result = ibuf->a * ibuf->b;
   strcpy(obuf->str, ibuf->str);
   tmp = obuf->str;
   while (*tmp)
   {
      *tmp = toupper(*tmp);
      tmp++;
   }
   return (1);
}
______________________________________

#include "soapH.h"
#include "cstruct.nsmap"

/* Change value of PORT to your assigned port number */
#define PORT 9191

int main(int argc, char **argv)
{
   int m, s;             /* master and slave sockets */
   struct soap soap;

   soap_init(&soap);

   m = soap_bind(&soap, NULL, PORT, 100);
   if (m < 0)
   {
      soap_print_fault(&soap, stderr);
      exit(-1);
   }

   fprintf(stderr, "Connection successful: master socket = %d\n", m);

   while (1)
   {
      s = soap_accept(&soap);
      fprintf(stderr, "Connection successful: slave socket = %d\n", s);
      if (s < 0)
      {
         soap_print_fault(&soap, stderr);
         exit(-1);
      }
      soap_serve(&soap);
      soap_end(&soap);
   }

   return 0;
}

____________________________________________
//gsoap ns service name:        cstruct
//gsoap ns service style:       rpc
//gsoap ns service encoding:    encoded
//gsoap ns service location:    http://www.somewhere.com:9191/cstruct.exe
//gsoap ns schema namespace:    urn:cstruct

struct i_struct
{
   double a;
   double b;
   char *str;
};

struct o_struct
{
   double result;
   char *str;
};

int ns__cstruct(struct i_struct *ibuf, struct o_struct *obuf);
____________________________________
#include "soapH.h"
#include       /* toupper() */

#pragma member_alignment save
#pragma nomember_alignment
#include "unaligned.h"
#pragma member_alignment restore

int ns__cstruct(struct soap *soap, struct i_struct *ibuf,
                                   struct o_struct *obuf)
{

    unaligned_i_struct_t unaligned_ibuf;
    unaligned_o_struct_t unaligned_obuf;

    unaligned_ibuf.a = ibuf->a;
    unaligned_ibuf.b = ibuf->b;
    strcpy(unaligned_ibuf.str, ibuf->str);

    unaligned_cstruct(&unaligned_ibuf, &unaligned_obuf);

    obuf->result = unaligned_obuf.result;
    obuf->str = soap_strdup(soap, unaligned_obuf.str);

       return (SOAP_OK);
}

_______________________________
$! build.com
$ cc:=cc   ! ensure that CC is really CC and not some symbol
$ lin*k:=  ! ensure the LINK command is just that
$!
$ soapcpp2 :== $gsoap$root:[bin]soapcpp2.exe
$
$ soapcpp2 "-c" cstruct.h
$ cc/names=(as_is,shortened)/prefix=all/float=ieee/ieee=denorm -
/warning=(disable=EMPTYSTRUCT) -
/include=gsoap$root:[include] cstruct.c
$
$ cc/names=(as_is,shortened)/prefix=all/float=ieee/ieee=denorm -
/warning=(disable=EMPTYSTRUCT) -
/extern=common/share_global/nomember_alignment -
/include=gsoap$root:[include] unaligned.c
$
$ cc/names=(as_is,shortened)/prefix=all/float=ieee/ieee=denorm -
/warning=(disable=EMPTYSTRUCT) -
/include=gsoap$root:[include] main.c
$ cc/names=(as_is,shortened)/prefix=all/float=ieee/ieee=denorm -
/warning=(disable=EMPTYSTRUCT) -
/include=gsoap$root:[include] soapc.c
$ cc/names=(as_is,shortened)/prefix=all/float=ieee/ieee=denorm -
/warning=(disable=EMPTYSTRUCT) -
/include=gsoap$root:[include] soapserver.c
$
$ link/exe=cstruct.exe main,cstruct,unaligned,soapc,soapserver,sys$input/opt
gsoap$root:[lib]gsoap.olb/lib
$

19 November 2010

gSOAP on OpenVMS V0.9 Released

BC&JA are happy to announce that V09 of gSOAP on OpenVMS is now available for download.
You may wish to peruse the release notes prior to requesting a kit by sending an email to brett.r.cameron(AT)gmail.com and johndapps(AT)gmail.com stating platform and OpenVMS version.

If you are an ACMS user, you might want to glance through the gSOAP FIDDLE User Guide, an utility which translates STDL into WSDL, thus automating the process of exposing ACMS Tasks as Web Services.

We are always happy to hear from people using the software and do try to listen to what you all have to say and recommend!

NOTE: please ensure that any DCL symbols for compilers and linkers are deleted prior to building gSOAP applications!

7 July 2010

gSOAP on OpenVMS V0.8 Released

BC&JA are happy to announce the latest version of gSOAP on OpenVMS!
The Release Notes contain information on installation and operation of the software.

The major additions in this release follow:

Plug-ins
gSOAP provides a powerful mechanism for extending its capabilities through the use of plug-ins, and a variety of pre-existing plug-in modules are available. These plug-ins are now included with the OpenVMS kit and may be found in the gsoap$root:[plugin] directory. There are plug-ins to support HTTP GET requests, WS-Security, and many more. It should be noted that not all of the supplied plug-ins have been tested on OpenVMS, and the authors would appreciate feedback on any issues that are encountered.

DOM support
The gSOAP DOM implementation is now provided and may be utilised by linking applications with the object  library gsoap$root:[lib]gsoapdom.olb. Please note that this library also includes SSL support, and it is therefore necessary to link applications with the OpenVMS SSL libraries (see Section 4.4). This requirement will be removed in future releases.

WS-Security (WSSE) example
An example program that illustrates the use of the WSSE plug-in is now included with the distribution. This fairly complicated example also uses the gSOAP DOM implementation and SSL. It should be noted that it will be necessary to obtain new certificates in order to use the SSL functions.


Please do let us know how you get on with this latest kit! As always, send an email to brett.r.cameron(AT)gmail.com and johndapps(AT)gmail.com stating whether you require Alpha or Integrity or both kits.

26 May 2010

gSOAP on OpenVMS V0.7 Released

BC&JA have released version 0.7 of gSOAP on OpenVMS for Alpha and Integrity.  The release notes and installation guide contain notes on changes specific to the OpenVMS version.
This releases encompasses all changes and additions made to the gSOAP Version 2.7.9 and its revisions. See the following list and http://www.cs.fsu.edu/~engelen/soap.html for further information.
  • Version 2.7.9 revisions a/b/c/d/e/f/g/h/i/j/k/l (10/24/2006-09/26/2007)
    • Added wsdl2h option -j to omit the generation of SOAP Header and Faults for customization of these.
    • Added wsdl2h option -q to generate C++ namespace qualified header files.
    • Added SOAP_SSLv3, SOAP_TLSv1, SOAP_SSL_SKIP_HOST_CHECK flags.
    • Added file input and output specifications (with < and >) to wsdl2h's typemap.dat to specify input and output for wsdl2h.
    • Added WS-Addressing 2005/03 support.
    • Added function soap_free() = soap_done() + free() and renamed previous soap_free() to soap_temp_free().
    • Added wsdl2h option -_ to translate _USCORE.
    • Added xsd:anyAttribute (using DOM parser) with wsdl2h option -d.
    • Added multi-WSDL types section schema component merging.
    • Added TCP keep-alive settings.
    • Added QName list normalization.
    • Changed soapcpp2 default rule for generating attribute form qualified to unqualified.
    • Improved wsdl2h SOAP Fault coding.
    • Improved performance and stability.
    • Improved portability.
    • Improved wsdl2h empty namespace handling ("" namespace).
    • Improved wsdl2h and schema conversion to C and C++.
    • Improved SSL timeouts and error handling.
    • Improved soapcpp2 option -i (generate proxy and service classes).
    • Improved class instance initialization.
    • Improved use of IPv6.
    • Improved proxy and server code output for soapcpp2 option -i.
    • Improved soapcpp2 code output with additional exception checks.
    • Fixed MIME/MTOM start id handling (SOAP message no longer required to be first attachment).
    • Fixed WS-Security wsse plugin canonicalization format issue.
    • Fixed ZIP content remainder parsing (CRC check).
    • Fixed WSA API handling of messages with MIME/DIME attachments.
    • Fixed wsdl2h relative path includes.
    • Fixed _XML literal string parsing of root attributes. 
    Please do let us know whether you would like a kit and state if for Alpha or Integrity. This release is only available for OpenVMS 8.3 and higher. If you require a kit or need a release for OpenVMS 7.3-2, then please drop us an email at brett.r.cameron (AT) gmail.com and johndapps (AT) gmail.com.

  • Regards, BC&JA

    18 January 2010

    gSOAP on OpenVMS Kit Announcements

    BC&JA are proud to formally announce that Version 06 for gSOAP on OpenVMS is available!

    Version 06 includes updated documentation and a completely rewritten user guide for (Fast Interface Dynamic Definition Language for lusty Enterprises) FIDDLE, a tool for developing gSOAP interfaces for HP ACMS.

    Version 06 includes support for FastCGI and multi-national character sets such as Hebrew. The release have been updated to include documentation on using gSOAP with Apache FastCGI and with WASD. We have created a new Web page for FastCGI on OpenVMS and encourage you to take a look.

    Please see the first comment to this entry for details on additional Web Services you might wish to try. We hope to provide examples of these with the next kit release. Meanwhile, if you manage to implement one or two, we would be very happy to include them in the kit!


    Please send a brief note requesting a kit to:

    • brett.r.cameron@gmail.com and
    • johndapps@gmail.com

    Please specify in your mail:
    • OpenVMS version (can be 7.3.-2 on Alpha)
    • Hardware platform (Alpha or Integrity)
    You may review the installation guide and release notes prior to requesting a kit. C++ is not required unless you wish to develop code using that language, of course. If you using ACMS, you might also wish to peruse the FIDDLE
    Please do leave a comment, it can be anonymous if you prefer, when you download a kit!
    We very much wish to keep track of who is using the software. Why? 
    • So that we can influence management to turn the gSOAP on OpenVMS software into a supported Open Source product, for instance
    • So that we can write SPAM mails to you :-)
    • So that we can see how much interest there really is...
    Regards, BC&JA

    No Widget