Bugs, Patches, and Updates
Please report bugs, patches, and feature requests at
the SourceForge gSOAP
project tracker. This allows you and us to monitor the status of a request.
For support requests, please visit the support
page.
Latest official stable release: gSOAP 2.7.11
download from SourceForge
gSOAP 2.7.11: wsseapi.c line 2721 initialization of 'count = 0' is missing:
static size_t
soap_wsse_verify_nested(struct soap *soap, struct soap_dom_element *dom, const char *URI, const char *tag)
{ size_t count = 0;
Fix for known problems with strtof() on some platforms (e.g. SUSE 11).
Replace stdsoap2.c/.cpp line 9724:
#if defined(HAVE_STRTOF_L)
char *r;
*p = strtof_l((char*)s, &r, soap->c_locale);
if (*r)
#elif defined(HAVE_STRTOD_L)
char *r;
*p = (float)strtod_l(s, &r, soap->c_locale);
if (*r)
#elif defined(HAVE_STRTOF)
char *r;
*p = strtof((char*)s, &r);
if (*r)
#elif defined(HAVE_STRTOD)
char *r;
*p = (float)strtod(s, &r);
if (*r)
#endif
with:
#if defined(HAVE_STRTOD_L)
char *r;
*p = (float)strtod_l(s, &r, soap->c_locale);
if (*r)
#elif defined(HAVE_STRTOD)
char *r;
*p = (float)strtod(s, &r);
if (*r)
#endif
Fix for router:
Replace stdsoap2.c/.cpp line 6268:
soap_free_temp(soap);
with:
soap_free_ns(soap);
and download the router.c patch.
gSOAP 2.7.10: stdsoap2 fixes floating point
conversion with GLIBC using C locale, fixed xsd:dateTime timezone offset
handling (+/-HH.MM), and fixed SOAPAction output.
gSOAP 2.7.9l and k: updated dom.h.zip with missing
xsd__anyAttribute definitions
gSOAP 2.7.9l: last updated 12/17/07 stdsoap2.h/.c/.cpp [zip] with improved HTTP chunking and improved socket timeout support.
gSOAP 2.7.9l: last updated 11/02/07 soapcpp2-src [zip] soapcpp2 compiler with fix for option -i one-way send/recv operations.
gSOAP 2.7.9j and earier: WSA API wsaapi.c (last updated
September 10, 07) plugin.
The XMethods services frequently experience load problems which may cause
failed GetQuote queries (the samples/quote example) and failures to obtain
XMethods Query service WSDL and listings. We provide example client code to
connect to these services, but we do not provide these services. Therefore,
if these examples don't work the intermittent failures cannot be fixed by us.
gSOAP 2.7.9h: to run the soapcpp2.exe and wsdl2h.exe binaries, you need to
install the DLLs that ship with MS VS 2005 (or install MS VS 2005). For future
releases I plan to generate binaries that do not require these DLLs.
gSOAP 2.7.9g minor correction needed for samples/components/cpp/main.cpp:
rename calc::Service to calc::ServiceService.
gSOAP 2.7.9a: to prevent HTTP chunked transfer responses from server to show 202 ACCEPTED, change stdsoap2.cpp:13381 into (mode should be omode):
if (count || ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK))
gSOAP 2.7.9 has an elementFormDefault="unqualified" bug for C++ class members
that represent complexTypes. The wsdl2h importer may ignore option -o.
Download gSOAP 2.7.9a with a fix.
Updated gSOAP 2.7.8c OpenSSL extension support:
download stdsoap2.h 2.7.8c updated source code
download stdsoap2.c 2.7.8c updated source code
download stdsoap2.cpp 2.7.8c updated source code
Fix for wsse plugin API HMAC SHA1 signature verification:
download plugin/wsseapi.h source code
download plugin/wsseapi.c source code
gSOAP with OpenSSL portability note: stdsoap2.c/.cpp OpenSSL meth->d2i()
compilation error occurs on certain platforms.
Suggested fix for GCC 4.x and MSVC:
3758c3758
< val = meth->i2v(meth, meth->d2i(NULL, &ext->value->data, ext->value->length), NULL);
---
> val = meth->i2v(meth, meth->d2i(NULL, (unsigned const char**)&ext->value->data, ext->value->length), NULL);
Fix for HTTPS proxy CONNECT (gSOAP 2.7.8b and earlier).
The stdsoap2.cpp tcp_connect() function contains the following code:
{
#ifdef WITH_OPENSSL
...
userid = soap->userid; /* preserve */
passwd = soap->passwd; /* preserve */
if (soap_begin_recv(soap))
{ soap->fclosesocket(soap, (SOAP_SOCKET)fd);
return SOAP_INVALID_SOCKET;
}
soap->userid = userid; /* restore */
soap->passwd = passwd; /* restore */
...
To resolve the problem, change this into:
userid = soap->userid; /* preserve */
passwd = soap->passwd; /* preserve */
if ((soap->error = soap->fparse(soap)))
{ soap->fclosesocket(soap, (SOAP_SOCKET)fd);
return SOAP_INVALID_SOCKET;
}
soap->userid = userid; /* restore */
soap->passwd = passwd; /* restore */
Fix for gSOAP 2.7.8(a/b) GCC 4.1 with -DWITH_OPENSSL, stdsoap2.cpp:3737:
const char *ext_str = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext)));
if (!strcmp(ext_str, "subjectAltName"))
{ int j;
- unsigned char *data;
+ unsigned const char *data;
STACK_OF(CONF_VALUE) *val;
Fix for gSOAP 2.7.8a: on some systems the use of soap_isnan() may fail with a FP exception. The culprit is in stdsoap2.h:847:
#define soap_isnan(n) ((double)(n) == DBL_NAN)
Either enable isnan checking with -DHAVE_ISNAN or change stdsoap2.h:847 by:
#define soap_isnan(n) (0)
Fix for XML-RPC array handling in 2.7.6c and earlier: xml-rpc.zip (install in samples directory to replace xml-rpc).
Known issue with 2.7.4/.5: soapcpp2 WSDL output may include additional
</message> tags that must be removed. For some RPC encoded
Response messages in the WSDL the name attribute is missing in the
<message> element.
Patches for the gSOAP 2.7.3 release:
- Fix for hexBinary- and base64Binary-typed XML attribute parsing:
stdsoap2.c 2.7.3a, MD5 checksum=9ddacf7aac4349c04904b06962f6a234
stdsoap2.cpp 2.7.3a, MD5 checksum=9ddacf7aac4349c04904b06962f6a234
Patches for the gSOAP 2.7.0f release:
- Server-side fix for transmitting fault message responses to clients,
which might get lost over socket that is still open but has an error state:
stdsoap2-2.7.0f.c
stdsoap2-2.7.0f.cpp
Patches for previous gSOAP 2.7.0d release:
- Patch for the DOM parser's soap_dom_element soap struct initialization:
dom.h
dom.c
dom.cpp
- Download router update with fix for HTTP and DIME issues:
router.c
- The gSOAP 2.7 releases provide explicit support for schema
elementFormDefault and attributeFormDefault. This enables the
mixing of schemas with default qualified element/attribute tags together with
schemas with unqualified element/attribute tags in the same WSDL document.
As a result of these changes, when you define a document/literal service, you
should add the following directive to your header file to set the element and
attribute form defaults to "qualified":
//gsoap ns schema form: qualified
or:
//gsoap ns schema elementForm: qualified
//gsoap ns schema attributeForm: unqualified
to declare form defaults for elements and attributes
(i.e. schema elementFormDefault="qualified" and attributeFormDefault="unqualified").
Repeat this for all your schemas, e.g. ns1, ns2, and so on.
The difference is profound. Validating parsers require full element/attribute
qualification when the schema form default is "qualified". With the directives
above, the gSOAP messages
conform to this requirement by producing qualified elements and attributes.
The directive is automatically generated by the wsdl2h importer, so you don't need
to do this again by hand. However, if you are using an older version of the
wsdl2h importer (prior to 1.1.4) you should either try the new importer OR add
these directives to the .h file by hand.
Patch for gSOAP 2.6.2 fixes code generation bug for char*[] serializer.
Download src/symbol2.c
Download soapcpp2.exe
A bug in stdsoap2.c/pp 2.6.2 prevents the deserialization of xsd:short:
soap_s2short(struct soap *soap, const char *s, short *p)
{ if (s)
{ long n;
char *r;
n = soap_strtol(s, &r, 10);
if (*r || n < -32768 || n > 32767)
return soap->error = SOAP_TYPE;
*p = (char)n;
^^^^^^^^^^^
Should be *p = (short)n
Patches for gSOAP 2.6 (the patches below are integrated in gSOAP 2.6.1 and
higher).
The Patch for gSOAP 2.6 fixes a problem with dropped STL vector elements under
multi-ref (id-ref) encoding, which can occur under certain circumstances with pointer-based STL vector
items. A robust id-ref resolution algorithm for STL container elements was
added. In addition, an improvement was made to the WSDL output for
document/literal services.
Patches for gSOAP 2.5.1 (the patches below are integrated in gSOAP 2.5.2 and
higher).
The patch reduces the number of soapcpp2 warnings for SOAP RPC/lit encoded messages:
Patches for gSOAP 2.5 (the patches below are integrated in gSOAP 2.5.1):
The patch implements a small change to the server-side SOAP Fault output
to improve interoperability and a correction to the VxWorks ioctl() calls.
Patch for dimeclient.cpp and dimeserver.cpp correcting a streaming DIME
attachment reordering problem:
Download dimeclient.cpp
Download dimeserver.cpp
Patches for gSOAP 2.4.1 (the patches below are integrated in gSOAP 2.5):
- stdsoap2.c/pp change line 5230 to fix exception when tag==NULL:
SOAP_FMAC1
int
SOAP_FMAC2
soap_element_begin_in(struct soap *soap, const char *tag)
{ if (tag && *tag == '-')
return SOAP_OK;
if (!soap_peek_element(soap))
{ if (soap->other)
return soap->error = SOAP_TAG_MISMATCH;
if (!(soap->error = soap_match_tag(soap, soap->tag, tag)))
{ if (tag && !soap->encodingStyle) /* ADDED check tag!=NULL */
{ const char *s = strchr(tag, ':');
if (s)
soap_push_default_namespace(soap, tag, s - tag);
}
These are patches for gSOAP 2.3.8:
Download stdsoap2.h 2.3.8h
Download stdsoap2.c 2.3.8h
Download stdsoap2.cpp 2.3.8h
Download webserver.c memory leak fix with gSOAP
2.3.8
for the combination of Zlib
compression with the httpget plugin (the fix is to remove all soap_begin_send calls
before the soap_response calls).
The old Java-based WSDL importer may output the wrong XML namespace binding for 'tns' in the
generated header file. Please check the XML namespaces definitions in the WSDL
and the header file. Otherwise, your client may not be able to connect. A new
WSDL importer (written in C++ and produced by gSOAP itself!) will be available soon.
Patches:
- Fixed soap_ssl_accept() timeout.
- Improved client-side thread support for OpenSSL:
use the new soap_ssl_server_context() and soap_ssl_client_context() functions
(see updated online documentation).
- stdsoap2.c / stdsoap2.cpp 2.3.8 line 8704 patch for base64 and HTTP authentication:
t[0] = '\0'; /* INSERTED */
if (n > 0)
{ m = 0;
for (i = 0; i < n; i++)
m = (m << 8) | *s++;
for (; i < 3; i++)
m <<= 8;
for (i++; i > 0; m >>= 6)
t[--i] = soap_base64o[m & 0x3F];
for (i = 3; i > n; i--)
t[i] = '=';
t[4] = '\0'; /* MOVED UP */
}
return SOAP_OK;
}
stdsoap2.c / stdsoap2.cpp 2.3.8 change both lines 1155 and 8699 as follows:
{ m = ((unsigned long)((unsigned char*)s)[0] << 16) | ((unsigned long)((unsigned char*)s)[1] << 8) | (unsigned long)((unsigned char*)s)[2];
- stdsoap2.c / stdsoap2.cpp 2.3.8 line 9130 server-side patch for short recv/send timeout settings with HTTP keep-alive enabled:
if ((status != SOAP_EOF || (!soap->recv_timeout && !soap->send_timeout)) && soap_poll(soap) == SOAP_OK) /* REPLACED */
- stdsoap2.c / stdsoap2.cpp 2.3.8 line 3905 patch for server-side SOAP_IO_STORE setting (affects httpget plugin):
else if (soap->status != SOAP_STOP) /* REPLACED */
- stdsoap2.c / stdsoap2.cpp 2.3.8 line 4490 patch for SOAP-ENC:position[]
placement:
soap->null = 0;
soap->position = 0; /* INSERTED */
return SOAP_OK;
} /* END OF soap_element() */
- stdsoap2.c / stdsoap2.cpp 2.3.8 lines 5107 and 5116 patch for rejecting
invalid SOAP XML attribute content:
if (t && tp->value) /* ADDED tp->value check */
{ if (soap_push_namespace(soap, t, tp->value))
and:
for (tp = soap->attributes; tp; tp = tp->next)
{ if (tp->visible && tp->value) /* ADDED tp->value check */
The patches listed below are integrated into gSOAP 2.3.8.
-
Patch for the gSOAP 2.3 rev 1 to 6 client-side SSL + HTTP keep-alive problem:
stdsoap2.c / stdsoap2.cpp line 2660:
{ if ((soap->socket >= 0) && FD_ISSET(soap->socket, &sfd))
replace with:
{ if ((soap->socket >= 0) && FD_ISSET(soap->socket, &rfd))
-
Patch for gSOAP 2.3 rev 6 DOM parser with gSOAP deserializers (with SOAP_XML_GRAPH set to deserialize data):
symbol2.c line 38:
int typeNO = 0; /* unique no. assigned to all types */
replace with:
int typeNO = 1; /* unique no. assigned to all types */
-
Patch for gSOAP 2.3 streaming DIME with fdimereadclose callback:
stdsoap2.c / stdsoap2.cpp line 7250:
soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime_size&3);
return soap->error;
insert two lines:
soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime_size&3);
if (soap->fdimereadclose)
soap->fdimereadclose(soap, h);
return soap->error;
-
Patch for gSOAP 2.3 client-side SSL leak in soap_done():
stdsoap2.c / stdsoap2.cpp line 2167:
if (!soap->copy && soap_valid_socket(soap->master))
{ closesocket((SOAP_SOCKET)soap->master);
soap->master = SOAP_INVALID_SOCKET;
#ifdef WITH_OPENSSL
if (soap->ctx)
{ SSL_CTX_free(soap->ctx);
soap->ctx = NULL;
}
#endif
replace with:
if (!soap->copy)
{ if (soap_valid_socket(soap->master))
{ closesocket((SOAP_SOCKET)soap->master);
soap->master = SOAP_INVALID_SOCKET;
}
#ifdef WITH_OPENSSL
if (soap->ctx)
{ SSL_CTX_free(soap->ctx);
soap->ctx = NULL;
}
#endif
Below is a list of fixes and patches for some issues with gSOAP 2.2.3 (these patches are integrated in the gSOAP 2.3 beta release):
- A gSOAP client application may experience problems receiving subsequent messages
from a
server after a SOAP
Fault occurred with the server. To flush the SOAP Fault, replace the line
if (soap_poll(soap))
with:
if (!soap->keep_alive || soap_poll(soap))
in stdsoap2.cpp function soap_connect() (around line 7500 depending on your
release version).
-
Double floating point numbers may be truncated due to a mistaken cast in function soap_s2double()
in stdsoap2.cpp. Please remove the cast:
soap_s2double(struct soap *soap, const char *s, double *p)
{ ...
{ char *r;
*p = (float)strtod(s, &r); /* REMOVE THE (float) CAST */
if (*r && sscanf(s, soap->double_format, p) != 1)
return soap->error = SOAP_TYPE_MISMATCH;
}
...
-
DIME transfers may fail with .NET when the following HTTP header is used:
Content-Type: application/dime; charset=us-ascii
To fix this, modify function soap_puthttphdr() in stdsoap2.cpp by replacing
"application/dime; charset=us-ascii" with the string "application/dime".
-
Sun solaris: time_t deserialization doesn't work when daylight saving time is
in effect (problems with Sun's non-standard implementations of ftime() and
gettimeofday()).
-
GNU gcc compiler v3 for MAC OS X has a bug with option -O2 which can cause gSOAP to
crash. Use option -O1 or add option -fstack-check.
-
gSOAP 2.2.3b on Windows: please change SOAP_SOCKET into 'int' in stdsoap2.h,
stdsoap2.c, and stdsoap2.cpp. Updated files are now available from SourceForge.
Older gSOAP 2.1.11 release (gSOAP 2.2 is based on 2.1.11, but just in case you need 2.1.11):
Suggestions
Avoid using typedefs for enums and structs. When you use a typedef for enums or structs in the header file
input to the compiler, gSOAP will create (de)serializers
for both (struct and typedefed struct). Besides the extra code overhead, it can lead to SOAP/XML parsing and element matching problems.
So avoid the use of typedefs for enums and structs (e.g. do not use typedef struct X { ... } Y).
Some examples provided in the distribution connect to third-party Web Services.
We cannot guarantee that the examples can connect to these third-party Web services
when these services are down or have been removed.
The who-is example provided in the gSOAP distribution cannot talk to the
Delphi-based whois service because the Delphi service responds with an
illegally formatted SOAP message. There is no point in trying to fix the
gSOAP client unless the Delphi whois service will be fixed to send messages correctly.