soapcpp2 can't generate soapClient.c file - gsoap

I am trying to build a tr069 client using gsoap. I followed the instructions in the document but I could not get soapClient.c.
Here is the steps:
wsdl2h -c -o tr069.h cwmp-1-1.xsd --> this generate tr069.h
soapcpp2 -c tr069.h --> this only generates the following file:
ns1.nsmap, soapC.c soapH.h soapStub.h
According to the examples online and in the document, I am suppose to get file like soapClient.c
Does anyone knows why? I am using gsoap 2.8
Thanks.

The cwmp-1-1.xsd is only an XSD file. You do not have a WSDL defining the operations that normally are stored in soapClient.c. However, you can still use the XML root element serializers (see bottom part of tr069.h for instructions) over sockets etc.

Related

WHat is the difference between the filename_pb2_grpc.py and the filename_pb2.py files?

From what I understand, the pb2.py file is code from the protoc file and the pb2_grpc.py file is code generated by protoc from the .proto file. But I don't understand what that means. I am very confused, can someone please explain this to me.
Thank you
I have tried to google the question, but I couldn't find anything that I could understand
Both are generated by protoc or python -m grpc_tools.protoc (a Python module that wraps protoc).
A pb2.py file contains the core Protocol Buffer (message) definitions and is created as a result of the --python_out flag being specified.
A pb2_grpc.py file contains the service and rpc (method) definitions and is created as a result of the --grpc_python_out flag being specified.

How to generate API Documentation using openapi-generator?

I'm new to the OpenAPI 3.0.0.
I have successfully created a java client library using an openapi-generator.
But OpenAPI Generator allows the generation of API client libraries (SDK generation), server stubs, documentation. So I want to know is there any commands or steps are available to generate HTML documentation and also to customize the documentation template.
Old question, but for those still bumping into it. OpenApi Generator can do generation of html documentation from your yaml or json definition of your API.
openapi-generator generate -i PathToMyInputDefinitionFile.yaml -g html -o /PathToOutputFolder
Where html is the generator you want to use. Other generators include dynamic-html and html2. Also can emit as markdown. See https://openapi-generator.tech/docs/generators/
If using Docker, a full example would look like this:
docker run --rm -v ${PWD}:/local openapitools/openapi-generator:tagname generate -i /local/input.yaml -g html -o /local
PWD is present working directory (current directory) in the host, which you are mapping on to /local in the container. Adjust 'tagname' to suit, from https://hub.docker.com/r/openapitools/openapi-generator/tags Adjust input.yaml to be your input file yaml definition of your API.

flatbuffer implementation and usage.Need some suggestions

Can flatbuffer be used for server client communication?Previously i was using JSON, but do you think flatbuffer will be useful for communication where the response from server is big enough to create some delay in reaching the client side.
If flatbuffer is not recommended, then which one I can use?Is there any library that can reduce the size of response from server and send it to client side for efficient and fast communication?
One of the best way to learn how to use flatbuffer and also to know more about flatbuffers vs JSON. (How to use FlatBuffers?)
FlatBuffer Android Sample Application
This app shows how fast flat buffer works when we compare it with json.
How to start with flatBuffer
$ git clone https://github.com/google/flatbuffers.git
$ cd flatbuffers
* Run the command on the basis of your platform
$ cmake -G "Unix Makefiles"
$ cmake -G "Visual Studio 10"
$ cmake -G "Xcode"
* now build for your platform as usual. This should result in a flatc executable
* Now create your schema file with extension .fbs. Guide to write a schema can be found [here]("https://google.github.io/flatbuffers/flatbuffers_guide_writing_schema.html").And also have your sample json file.
$ ./flatc -j -b schema.fbs sample.json
* This will create few java file and one bin file. Java files are like model(POJO for flatBuffer) of your json.Place the java files in your application package and bin file in raw folder(bin file is only for testing as it is converted to byte that is to be passed to flatbuffer for testing).
* Now we have to get flatbuffer jar file.
$ cd flatbuffers
$ cd java
$ mvn install
This will download all the dependencies.
$ cd target
* Here we will get the flatbuffers-java-1.3.0-SNAPSHOT.jar file that we have to put it in your libs folder of android project.
* For rest you can see my (https://github.com/amitshekhariitbhu/FlatBuffer).
## Major steps:
* Prepare your schema.fbs.
* Have a sample json.
* Build flatBuffer google project to generate your java files to be used in main application.
* Generate java files.
Yes, a FlatBuffers message will typically be a lot smaller than the equivalent JSON, and it will be quicker to access.

gsoap multiple wsdls but only one proxy class

I want to use gsoap to access several web services and combine it all into 1 executable. The problem that I have is even though I do wsdl2h on multiple wsdls, and then compile the header using soapcpp2, there is only 1 proxy object generated. Here are the command line parameters that I use:
wsdl2h -o header.h -ttypemap.dat -s http://services.web.com/WebService/Service1.asmx?WSDL http://services.web.com/WebService/Service2.asmx?WSDL
soapcpp2 -pMy -i -wx -C -Igsoap-2.8/gsoap/import header.h
The problem that I get is whenever I try to access services defined in Service2 wsdl, I get exception. "System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction:
The same code that access service on Service2 works if I only compile single wsdl (only compile Service2 wsdl).
Then I check both Service1 and Service2 wsdls. They have the same "targetNamespace". That's why only 1 proxy is created.
My question is: how do I solve this problem? I need to access services on both Service1.wsdl and Service2.wsdl and put them into 1 binary.
I've read gsoap manual & tried several combination on command line parameters of wsdl2h and soapcpp2 but no luck.
Any help is much appreciated.
I use gsoap 2.8.11 btw
This question is quite old, so I'll be very quick just to help random googlers (I found it when googling for solution to the same problem). If more details are needed, just ask.
Anyway, the solution:
Use multiple calls to the wsdl2h using -q parameter (with namespace name provided) and generate unique .h file each time.
Then, call soapcpp2 on each of those header files - this will generate proxy file for each of them, wrapped in namespace declaration.

Custom templates with phpDocumentor 2

I've been trying to get a custom template to work with PHPDocumentor (2) without much luck. The documentation on their site is incomplete and I'm kind of stumped.
What I've done is downloaded a copy of a complete template and reference it in my command, like so:
php phpdoc.php
--template=/path/to/customtemplate/
-d /path/to/php/source/files
-t /path/to/generated/content/
The command runs fine: it generates the documentation correctly but appears to be ignoring the --template option - at least, any changes I make to the template files in the /customtemplate folder are ignored.
Anyone have any idea?
(Thanks in advance!)
Ben
Instead of declaring the template command on the CLI you might try changing your phpdoc.dist.xml configuration file so that it pulls the template name or path from there directly.

Resources