I'm in the process of moving from gSOAP 2.7 to 2.8.
soapcpp2 is returning the error "#import: Cannot open file “soap12.h” for reading."
I've found a similar post called "#import: Cannot open file “soap12.h” for reading gSoap in VS 2010" but my situation does not seem to be the same. In that case the application was including the .h file generated by wsdl2h and causing an error that caused the developer to change his wsdl2h options and that caused the error. The solution was to not include that .h file
This is what I did that worked in gSOAP 2.7
wsdl2h -s -t TypeMap.dat -o SOAP.h <multiple WSDL file names>
soapcpp2 -C SOAP.h
The wsdl2h execution gives some warnings that are new to 2.8. They are about multiple bindings being found and being collected as one service. I don't think they are important here
What is this SOAP12.h file it thinks it needs to import. TypeMap.dat does not contain an import like that
The answer is this. gSOAP 2.8 requires the specification of a path to the import library in the gSOAP files in the execution of soapcpp2
This is done with the -I option
Related
I have followed this page to generate client proxy of Web Service: https://www.genivia.com/doc/soapdoc2.html#tth_sEc1.2
The problem is that what occurs is different from what the document says it should occur.
For instance, this file was generated by "wsdl2h -o WSLipigas.h http_of_wsdl": WSLipigas.h
On the other hand, these files were generated by "soapcpp2 -i -C -Iimport WSLipigas.h": ns1.nsmap, SoapC.cpp, soapH.h, soapStub.h.
soapcpp2 output is different from what documentation says, even when i am using version 2.8.
When I examined the generated files, I didn't find any class that I can use conveniently.
The only methods i found were of the type "soap_METHOD_VERB_send__ns1__ACTUALFUNCTION" and "soap_METHOD_VERB_send__ns1__ACTUALFUNCTIONResponse"
With that, i don't now how to proceed later on.
Any help will be appreciated.
I am trying to compile an existing C++ project but get this error:
fatal error C1083: Cannot open include file: 'occi.h': No such file or directory
What I did is I went to this link:
http://www.oracle.com/technetwork/topics/winsoft-085727.html
and downloaded the first (basic) package.
Then unzipped the folder and modified PATH variable like this:
C:\Program Files\Atmel\sam-ba_2.12\drv\;C:\Program Files\Atmel\sam-ba_2.12;C:\Program Files\ATMEL Corporation\AT91-ISP v1.4\Library;C:\MSYS\1.0\bin;C:\MSYS\1.0\local\bin;C:\cygnus\cygwin-b20\H-i586-cygwin32\bin;D:\instantclient_12_1
last being path to oracle.
But I still get the error, can someone help?
PS I noticed in my project there are lines like:
#include "occi.h"
Maybe it is because of this?
The basic package isn't enough. Its description says "All files required to run OCI, OCCI, and JDBC-OCI application" (emphasis added); with just that you can run an OCI program, but you can't compile one. You need to download other instant client components. Specifically for the occi.h header you need the fifth file listed:
*Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
If you download and unzip that in the same place you unzipped the basic package, your instant client directory will gain an sdk folder, which includes all the OCI header files.
You'll then need to compile with -I D:\instantclient_12_1\sdk\include so your compiler knows where to look for the occi.h and other header files. You may also need -L to tell it where to find the Oracle libraries; presumably you already have -lclntsh and/or -locci, which refer to libraries you should have already from the basic package.
I am using Visual Studio and GSOAP 2.8.15 to create a C++ Onvif client.
I have run these commands to create source code:
> wsdl2h -P -x -o onvif.h http://www.onvif.org/onvif/ver10/device/wsdl/devicemgmt.wsdl
> soapcpp2 -i -C -IC:\gsoap-2.8.15\gsoap;C:\gsoap-2.8.15\gsoap\import onvif.h
Then I put these files in my MSVC solution:
duration.h/.cpp
soapH.h/soapC.cpp
stdsoap2.h/.cpp
I added this file to the directory but not to the solution:
soapStub.h
I added this as a #define to the compilation:
WITH_NONAMESPACES
I added this include to the main file of my program:
#include "soapDeviceBindingProxy.h"
This gives me a DeviceBindingProxy object, but I don't know what to do with it. I want to connect to an Onvif camera at a known ip address and request information about the device.
The GSOAP examples aren't specific to Onvif, and the Onvif pseudo-code examples aren't specific to GSOAP. Any help would be appreciated.
Just open the definition of DeviceBindingProxy object (or even better: run a doxygen on the gSoap-generated source files and enjoy comfortable HTML documentation).
It should contain a separate method for each action the service provides, named exactly as per service definition.
Each of the methods should take two parameters: request & response (their types are pointers to gSoap-generated structures: see their definition/documentation for details).
All you need to do is create instances of request & response, fill the request, pass pointers to both to this method and harvest the data from (already parsed) response.
im implementing c++ webservices. i've installed gsoap as i've found that its popular toolkit for c++ webservices. however, im a little confuse in using gsoap.
basically i've got existing c++ codes and i want to use it as webservices. i read the tutorial from gsoap and its instructions are as follows:
1) use the following command and generate the header file with a wsdl file (im using the sample proj "hello" from gsoap):
wsdl2h -o -s h.h h.wsdl
2) with the hello.h, i run the following command to generate a lists of files as follows:
soapcpp2 hello.h
this generate a list of files: RECEV.log, Service.hello.req.xml....soapC.cpp, soapClient.cpp, soapClientLib.cpp, soapH.h,soapServer.cpp,soapServerLib.cpp,soapStub.h,TEST.log
it seems that i have to first generate a c++ header file from a wsdl file. but what if i have existing projects with existing .h and .cpp files. how can i turn them into a webservice?
I have a application that must communicate using SOAP with a SmartServer, which is a embedded device. The SOAP messages it accepts are without the namespaces but gSAOP sends them with namespaces. So they look like this:
<ns3:List>
<ns3:iLonItem>
<ns3:xSelect></ns3:xSelect>
</ns3:iLonItem>
</ns3:List>
Instead of this:
<List>
<iLonItem>
<xSelect></xSelect>
</iLonItem>
</List>
I first tried changing the qualified in the WSDL and XSD files to unqualified and then regenerating the files, and changing unqualified to qualified. But the best what i got is
<ns3:List>
<iLonItem>
<xSelect></xSelect>
</iLonItem>
</ns3:List>
Which looks better, but still the lists are with the namespaces.
Then I found this site stating that I must use the SOAP_XML_DEFAULTNS option, so I tried. This didn't work in the beginning but then I found out I have to use version 2.8.1 instead of 2.7.9l-0.2 (the standard version of Debian). So I uninstall-ed the Debian version and downloaded 2.8.1 and copied the files. But now when i try to generate files with soapcpp2 the following files are missing: soapClient.cpp, soapClientLib.cpp, soapProxy.h and a lot of *.req.xml and *.res.xml files. I need especially the soapClient.cpp file to compile my project.
I tried the standard binarys from the gsoap/bin directory and rebuilding the src and wsdl files from the gsoap directory as described in INSTALL.txt , but none of this works as I want to.
Can anybody help me a bit further?
For if it matters I'm using Debian Linux version 5.0.8 (Lenny, old-stable) 32 bits.
Regarding your question:
...the following files are missing: soapClient.cpp, soapClientLib.cpp, soapProxy.h and a lot of *.req.xml and *.res.xml files. I need especially the soapClient.cpp file to compile my project.
According to the link http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc8 (see section 9.1)
it looks as if you may have used the wrong option set for the call to soapcpp2. Are you sure you did not specify "Generate server-side code only" by using the -S switch? For client side only you would use the -C. For both server and client side files, no switches are required. Also, generating the proxy files requires that -i be used.
Hope this helps,
Ryyker