1

I'm trying to use gSoap to connect to a web service secured with https. However, when I run wsdl2h with an https url, it throws the following error:

Cannot connect to https site: no SSL support, please rebuild wsdl2h with SSL or download the files and rerun wsdl2h

I'm building on Fedora Core 14. I have installed openssl-devel and zlib-devel using yum. What have I missed?

IslandCow
  • 3,412
  • 3
  • 19
  • 24

3 Answers3

2

By default wsdl2h is built without support for SSL. The README.txt file in the wsdl code folder of the gsoap distribution contains the following:

USING SSL FOR HTTPS TRANSFER OF WSDL FILES

You must build the WSDL parser with 'make secure' to build an SSL-enabled version of wsdl2h that can access HTTPS secure sites.

If you don't have OpenSSL installed, you cannot build an SSL-secure version of wsdl2h. In that case we recommend downloading the WSDL and schema files for processing with the non-SSL-enabled wsdl2h tool.

So you need to either download the .wsdl file manually and run you existing wsdl2h on it or rebuild wsdl2h with make secure so that it knows to include the SSL libraries and support for https.

Jackson
  • 5,627
  • 2
  • 29
  • 48
1

Well, at least with 2.8 "make secure" just does not work. The trick is to define BOTH CFLAGS and CPPFLAGS to be -DWITH_OPENSSL, and LDFLAGS to be -lssl like:

    CFLAGS='$(CFLAGS) -DWITH_OPENSSL' CXXFLAGS='$(CXXFLAGS) -DWITH_OPENSSL' \
    CPPFLAGS='$(CPPFLAGS) -DWITH_OPENSSL' LDFLAGS='$(LDFLAGS) -lssl' ./configure \
            --prefix=/usr \
            --exec-prefix='$${prefix}' \
            --mandir='$${datadir}/man' \
            --infodir='$${datadir}/info' \
            --enable-ipv6 \
            --enable-samples
Árpád Magosányi
  • 1,394
  • 2
  • 19
  • 35
0

I solved the problem by building wsdl2h.exe using Visual Studio 2005 and run the script with the new wsdl2h.exe I compiled.

The project location in gsoap (2.8.17) is "gsoap-2.8.17\gsoap\VisualStudio2005\wsdl2h"

I had to add 'WITH_OPENSSL' in preprocessor of project properties. Also, I had to add some include and lib directories and some .c files in the project to resolve compile errors.

The point is to build wsdl2h.exe using 'WITH_OPENSSL' option. That will resolve the issue.

LEAD2M
  • 186
  • 1
  • 5