gsoap latest version generates different code than the version we use - c++

We are upgrading our gsoap version from 2.7.8 to the latest version 2.8.33
When our make file runs soapcpp2.exe and wsdl2h.exe with the exact same flags, I don't get the exact same classes and API, so I figured I'll have to tweak them a little bit.
We used to run soapcpp2.exe with these flags: -C -L -x -I
The first noticeable change was classes inheriting from structs soap rather than pointing to them. I was able to solve this compatibility issue by adding -j.
Now, I am encountering another incompatibility where a function
SOAP_FMAC5 int SOAP_FMAC6 soap_serve_request(struct soap *soap)
is absent.
I searched the gsoap code and found it, so I guess there's some way to make gsoap to generate it. Is there really a way to make gsoap generate this function, or will I have to adjust my code/ write the function myself

The gsoap tools have options to support backward compatibility. Run soapcpp2 -h to see your options:
Usage: soapcpp2 [-0|-1|-2] [-C|-S] [-T] [-Ecdt] [-L] [-a] [-A] [-b] [-c|-c++|-c++11] [-d path] [-e] [-f N] [-h] [-i] [-I path:path:...] [-l] [-m] [-n] [-p name] [-Q name] [-q name] [-r] [-s] [-t] [-u] [-v] [-w] [-x] [-y] [-z#] [infile]
...
...
-z1 compatibility: generate old-style C++ service proxies and objects
-z2 compatibility with 2.7.x: omit XML output for NULL pointers
-z3 compatibility with 2.8.30 and earlier: _param_N is indexed globally
Try -z1.
PS. The old proxy and service classes with option -z1 are more simplistic, the new classes generated with option -j are an improvement. But when you're generating service classes with -j the C-like API with global functions are gone (a good thing IMO).

Related

WS Import issue in Netbeans while creating Web Service Client Stub

WS Import issue in netbeans when try to create webservice client in maven project using wsdl.
--- jaxws-maven-plugin:2.3:wsimport (wsimport-generate-v34.0) # masterdata-workday ---
Processing: file:/C:/Users/ei10441/OneDrive%20-%20DEVRY/Documents/NetBeansProjects/masterdata-workday/src/wsdl/wdd9-impl-services15.workday.com/xxx/service/chuto1/Human_Resources/v34.0.wsdl
jaxws:wsimport args: [-keep, -s, C:\Users\ei10441\OneDrive - DEVRY\Documents\NetBeansProjects\masterdata-workday\target\generated-sources\jaxws-wsimport, -d, C:\Users\ei10441\OneDrive - DEVRY\Documents\NetBeansProjects\masterdata-workday\target\classes, -verbose, -encoding, UTF-8, -extension, -Xnocompile, -p, com.devry.masterdata.workday, -catalog, C:\Users\ei10441\OneDrive - DEVRY\Documents\NetBeansProjects\masterdata-workday\src\jax-ws-catalog.xml, -wsdllocation, https://wdd9-impl-services15.workday.com/xxx/service/chuto1/Human_Resources/v34.0?wsdl, "file:/C:/Users/ei10441/OneDrive%20-%20DEVRY/Documents/NetBeansProjects/masterdata-workday/src/wsdl/wdd9-impl-services15.workday.com/xxx/service/chuto1/Human_Resources/v34.0.wsdl"]
unrecognized parameter -
Usage: wsimport [options] <WSDL_URI>
where [options] include:
-b <path> specify jaxws/jaxb binding files or additional schemas
(Each <path> must have its own -b)
-B<jaxbOption> Pass this option to JAXB schema compiler
-catalog <file> specify catalog file to resolve external entity references
supports TR9401, XCatalog, and OASIS XML Catalog format.
-d <directory> specify where to place generated output files
-encoding <encoding> specify character encoding used by source files
-extension allow vendor extensions - functionality not specified
by the specification. Use of extensions may
result in applications that are not portable or
may not interoperate with other implementations
-help display help
-httpproxy:<proxy> set a HTTP proxy. Format is [user[:password]#]proxyHost:proxyPort
(port defaults to 8080)
-keep keep generated files
-p <pkg> specifies the target package
-quiet suppress wsimport output
-s <directory> specify where to place generated source files
-target <version> generate code as per the given JAXWS spec version
Defaults to 2.2, Accepted values are 2.0, 2.1 and 2.2
e.g. 2.0 will generate compliant code for JAXWS 2.0 spec
-verbose output messages about what the compiler is doing
-version print version information
-fullversion print full version information
-wsdllocation <location> #WebServiceClient.wsdlLocation value
-clientjar <jarfile> Creates the jar file of the generated artifacts along with the
WSDL metadata required for invoking the web service.
-generateJWS generate stubbed JWS implementation file
-implDestDir <directory> specify where to generate JWS implementation file
-implServiceName <name> local portion of service name for generated JWS implementation
-implPortName <name> local portion of port name for generated JWS implementation
Extensions:
-XadditionalHeaders map headers not bound to request or response message to
Java method parameters
-Xauthfile file to carry authorization information in the format
http://username:password#example.org/stock?wsdl
-Xdebug print debug information
-Xno-addressing-databinding enable binding of W3C EndpointReferenceType to Java
-Xnocompile do not compile generated Java files
-XdisableAuthenticator disable Authenticator used by JAX-WS RI,
-Xauthfile option will be ignored if set
-XdisableSSLHostnameVerification disable the SSL Hostname verification while fetching
wsdls
Examples:
wsimport stock.wsdl -b stock.xml -b stock.xjb
wsimport -d generated http://example.org/stock?wsdl
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 27.405 s
Finished at: 2020-04-22T14:44:08+05:30
Final Memory: 14M/309M
Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (wsimport-generate-v34.0) on project masterdata-workday: Mojo failed - check output -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Any idea what is issue and how to fix it in netbeans?
Changed the folder structure to one without hyphen and space and this got fixed for me.
It appears may be "OneDrive - DEVRY" is getting stucked

wsimport utility: set JVM arguments

I am getting the below exception when generating pojos from WSDL.
External DTD: Failed to read external DTD 'XMLSchema.dtd', because
'http' access is not allowed due to restriction set by the
accessExternalDTD property.
I found solution in [WebService Client Generation Error with JDK8
[1]: WebService Client Generation Error with JDK8 where someone has mentioned to add below jvm argument.
-Djavax.xml.accessExternalSchema=all
How do I add this argument in jvm 1.8(fyi I am using macos) or run wsimport with above jvm argument?
I struggled with the same issue as you.
There are two ways to do that (at least those I have found).
The simply one is to invoke the WsImport as a java class via the java command with this concrete attribute:
java -Djavax.xml.accessExternalSchema=all \
-Djavax.xml.accessExternalDTD=all \
-cp /path/to/jdk/lib/tools.jar com.sun.tools.internal.ws.WsImport \
-d destination -s source wsdl_file_location
Explanation:
I invoke the concrete class (com.sun.tools.internal.ws.WsImport) that is also called from the wsimport command. I have chosen this way, as the problem is that wsimport does not provide any option to specify additional jvm arguments, this workaround was fastest for me.
Second option is to modify the JVM parameters. For that you can refer to:
jvm configuration

Failed to generate gRPC service classes

I am trying to follow along with this tutorial. I am stuck on trying to generate the .grpc files (service classes) but I was able to generate the message classes. When I run
protoc -I ../proto --grpc_out=.
--plugin=protoc-gen-grpc=grpc_cpp_plugin ../proto/eample.proto
I get "grpc_cpp_plugin: program not found". How can I generate the service classes? Im not sure about the correct command I have to run.
The question is pretty old, but I hope my answer will help somebody. Giorgio Azzinnaro was right you need to install GRPC (in addition to protoc). On OSX you can do it with:
brew install grpc
For the other languages, commands are described here
Can you try to run this?
$ which grpc_cpp_plugin
If it finds a match, try to use the full path:
--plugin=protoc-gen-grpc=`which grpc_cpp_plugin`
If that isn't found, see if it is there in /usr/local/bin (it might just not be in the path), and if you find it there again use the full path in the --plugin directive.
If all this fails I suppose it might be that gRPC was not installed correctly...

MacVim does not build against a custom Python Framework

I have been desperately trying to build MacVim against a custom Python framework with no luck so far. I have tried many things, at the end MacVim builds with no errors, but when I check the linking of the final binary, it always lists as being linked against the default OSX Python.Framework, which is not something that I want.
Here is my configure command:
./configure --prefix=/Users/me/apps/Darwin64/macvim-7.4.258-clang-500.2.79\
--with-features=huge \
--enable-rubyinterp=yes \
--enable-perlinterp=yes \
--enable-cscope \
--enable-pythoninterp=yes \
--with-python-config-dir=/Users/me/apps/Darwin64/python2.7/lib/python2.7/config \
--enable-luainterp=yes \
--with-lua-prefix=/Users/me/apps/Darwin64/lua-5.2.3-clang-500.2
I have every possible environment variable out there set to point to the correct python folder ($PYTHONPATH, $PYTHONHOME etc.) My custom Python build is solid and healthy, I have never had issues with it.
Analysing the configure and build logs, I can see that the build process is finding my custom Python2.7 every time it performs some kind of a check:
(from the build log)
-I/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79/include/python2.7 -DPYTHON_HOME='"/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79"'
(from the config log)
configure:5792: found /Users/me/apps/Darwin64/bin/python
...
configure:5837: checking Python's install prefix
configure:5846: result: /Users/me/apps/Darwin64/python2.7.6-clang-500.2.79
...
configure:6014: checking if compile and link flags for Python are sane
configure:6031: gcc -o conftest -g -O2 -I/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79/include/python2.7 -DPYTHON_HOME='"/Users/me/apps/Darwin64/python2.7.6-clang-500.2.79"' -DMACOS_X_UNIX conftest.c -framework Python >&5
configure:6031: $? = 0
configure:6032: result: yes
...
So despite the fact that it is all properly set, the resulting MacVim.app is always built against the default Python.Framework:
$ otool -L ./MacVim.app/Contents/MacOS/Vim | grep "Python"
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
I am suspecting (at least this is what I have seen on some other discussion groups) that the Python linking is hardcoded somewhere despite the fact that the checks are going through with no issues.
Could you please help me with this? Other bits and pieces in my pipeline compiles fine against my custom python, but things are breaking for me when MacVim is not using the Python framework every other package is using. For example YouCompleteMe will compile fine using my custom Python but the MacVim will start crashing because of this Python framework discrepancy.
Thank you very much!

upgrade ocsigen error

I want to upgrade the ocsigen to 2.1 in my freebsd box.
$pkg_info | grep -i ocsigen
ocsigen-1.1.0_1 Web programming framework for OCaml
$cat /usr/ports/www/ocsigen/Makefile | grep -i version
POPORTVERSION= 2.1
$sudo pormaster ocsigen
...
===> Building for ocaml-tyxml-2.1
gmagmake: *** no rule to create “files/META.in” needed by “files/META”。 Stop
StoStop in /usr/ports/textproc/ocaml-tyxml.
...
===>>> You can restart from the point of failure with this command line
porportmaster <flags> www/ocsigen textproc/ocaml-tyxml
Maybe it is a simple error, but i cannot fix it by myself.
Sincerely!
You should now use OPAM, the "standard" tool for managing source distributions of OCaml packages. OPAM is available here:
http://opam.ocamlpro.com/