Understanding of usage of Java2Wsdl for axis2/c - web-services

I have a problem with the installation of Java2Wsdl tool.
I have succesfully created and compiled(generated the .class file from the .java file) a simple Java class inside a directory /home/user/examples/com/mycompany/app.
In there I compile my SimpleClass and so, I have two files: SimpleClass.java & a SimpleClass.class .
Next, I have axis2/c installed on my ubuntu system
$ echo $AXIS2C_HOME
/usr/local/axis2c
I also have axis2/java installed
echo $AXIS2_HOME
/opt/axis2-1.6.2
I also downloaded, extracted and installed from this link the java2wsdl plugin.
This is how the bin directory looks like.
username#usernamePC:/opt/axis2-1.6.2/bin$ ls
axis2.bat axis2server.sh java2wsdl.bat setenv.sh wsdl2java.sh
axis2server.bat axis2.sh java2wsdl.sh wsdl2java.bat
Now, I want to convert my initial project from java to wsdl with java2wsdl but I cannot understand the right place of directory I should put that into, if I have the classpath(?) right and what would be the correct command for the conversion to happen.
I am trying something like that: Java2WSDL.sh -cn com.mycompany.app.SimpleClass
In here I put . instead of / and I am typing that in top directory, meaning com directory.
Can you help me out with this?
I am sorry for the long question but I needed to set all things right.
my-app was build with a simple maven project (maven 2.2.1) through this guide.

You should start codegeneration from build/classes directory.
That directory must have com and META-INF subdirs.
Example of generating WSDL:
# compile your project using ant or mvn
ant
# go to binary dir
cd build/classes
# check SimpleClass.class is here
ls com/mycompany/app/SimpleClass.class
# generate WSDL into current directory
$AXIS2_HOME/bin/java2wsdl.sh -cn com.mycompany.app.SimpleClass
# see generated WSDL
cat SimpleClass.wsdl
To generate WSDL into different directory append -o <directory> switch to command line of wsdl2java.sh script.

Related

Embedding files in an iOS app (C++/Qt/cmake)

In an iOS c++/Qt application, I need to ship a few files and to keep them in their directory structure.
For the Android version, we bundle a zip which we unzip on the target before creating the QApplication.
On iOS, it seems that CMake is not capable of bundling files in a tree:
https://cmake.org/cmake/help/latest/prop_tgt/RESOURCE.html#prop_tgt:RESOURCE
https://cmake.org/cmake/help/latest/prop_sf/MACOSX_PACKAGE_LOCATION.html
I am not sure if this is a limitation of cmake or if this is a global limitation on iOS.
From the docs about iOS bundles:
It uses a relatively flat structure with few extraneous directories in an effort to save disk space and simplify access to the files.
What would be the preferred approach?
Is there a solution to ship the files from CMake directly?
If not, how can I achieve this so that they are available before the QApplication is created?
The xcode command
Thanks to #Cy-4AH, I added the folder in Xcode and could get the command to do this:
CpResource _PATH_TO_DIRECTORY_ _APP_BUNDLE_DIRECTORY_/_RESOURCE_DIR_NAME_
cd /Users/denis/opt/qfield/ios/QField
export PATH="....."
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks _PATH_TO_DIRECTORY_ _APP_BUNDLE_DIRECTORY_
But how can I create this from cmake? builtin-copyis an xcode command.
Simple system copy command
From an old (2008) discussion, we could use simple cp commands.
This works up to signing, but then I get an error unsealed contents present in the bundle root.
From this answer, it seems related that I cannot simply add folders in the resource directory. From the docs anatomy of framework bundles: Nonlocalized resources reside at the top level of the Resources directory
(Disclaimer: I'm not a CMake user, and there may be a more CMake-ey way to do this)
If you can set up post-build action, the following terminal script can efficiently sync files into your bundle from another location. I use it in my game engine because it only copies updated or new files upon subsequent builds, and preserves directory structure:
mkdir -p PATHTO/ORIGINFOLDERNAME
mkdir -p PATHTOBUILDFOLDER/PROJECTNAME.app/Contents/Resources/DESTINATIONFOLDERNAME
rsync -avu --delete --exclude=".*" PATHTO/ORIGINFOLDERNAME/ PATHTOBUILDFOLDER/PROJECTNAME.app/Contents/Resources/DESTINATIONFOLDERNAME
The mkdir commands are only to ensure that the folders are generated, if they were deleted.
So apparently the CMake method also works for directories.
target_sources(${QT_IOS_TARGET} PRIVATE ${_resource})
set_source_files_properties(${_resource} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
It will just be added at the root directory of the bundle and not within the Resources.
If the embedded file is not too big, you might consider :
in your source tree, generating a C++ file embedding that file as a constant array. For example, if your file contains just hello, world with a new line, you could have something like
/// file contents.cc
const char file_contents[] = "hello, world\n";
and at the beginning of your program (perhaps in your main function, before your QApplication) call a C++ function which writes such a file (perhaps in /tmp/).
in your build automation (e.g your Makefile or your qmake things), have something which generates the C++ contents.cc file from the genuine source
This is with a POSIX/Linux point of view, adapt my answer to your iOS.

Can't download json schema using gradlew command

I can't figure out how to use the gradlew command to convert my GraphQL schema into a JSON file as it is specified in the documentation.
I opened CMD in my project folder, ran the gradlew command once, and it gave me this error:
Project 'module' not found in root project gradlew
I created a module inside my project with the name "module" and now it's throwing the following error:
Task 'downloadApolloSchema' not found in project ':module'.
I've already added all the dependencies to the latest version (2.0.0 as of the time of posting) so I'm clueless as to why this is happening. I've already searched the web and found nothing about this...
This is the command I'm trying to issue in the CMD:
C:\Users\myuser\AndroidStudioProjects\GraphQLApp\app>..\gradlew :module:downloadApolloSchema -Pcom.apollographql.apollo.endpoint=https://graphql-udemy-android.herokuapp.com/graphql -Pcom.apollographql.apollo.schema=src/main/graphql/com/example/schema.json
I have to go up one directory (..\) since the gradlew command is in the above my app folder.
I'm on Windows, and my Gradle version is 6.4.
You just change ./gradlew to .\gradlew
Open the root terminal
Paste the code below and ENTER!
.\gradlew downloadApolloSchema --endpoint=https://Your Endpoint/graphql --schema=app/src/main/graphql/com/example/Your Path/schema.json
Have a good days!
Sorry about that, the module part was mostly a placeholder for the gradle module where you apply the com.apollographql.apollo plugin. You can ignore it and gradle will find the appropriate task:
./gradlew downloadApolloSchema
This has been updated in the project README as well.
For windows i used
.\gradlew downloadApolloSchema --endpoint="https://rickandmortyapi.com/graphql" --schema=app/src/main/graphql/GetRepositories.json
NOTICE I used:
.\ instead of ./

How do I specify where the dsc, build, changes, update, tar.gz files go when running debuild?

Once in a while I like to send a version of my software to my Ubuntu PPA on Launchpad. To do so, I need to regenerate the source, description, and change files. To do that, I run the following command:
debuild -S -sa -nc -m"alexis#example.com"
The problem is that it spits out all the files one directory up from my main folder. So say I am working on a project named Beautiful, I would see:
projects/
projects/Beautiful/
projects/Beautiful/<source files from my git>
projects/Beautiful_1.2.3~xenial.dsc
projects/Beautiful_1.2.3~xenial_source.build
projects/Beautiful_1.2.3~xenial_source.changes
projects/Beautiful_1.2.3~xenial_source.ppa.upload
projects/Beautiful_1.2.3~xenial.tar.gz
I would like to place all of the source files in a sub-folder such as:
projects/
projects/Beautiful/
projects/Beautiful/<source files from my git>
projects/Beautiful_source/Beautiful_1.2.3~xenial.dsc
projects/Beautiful_source/Beautiful_1.2.3~xenial_source.build
projects/Beautiful_source/Beautiful_1.2.3~xenial_source.changes
projects/Beautiful_source/Beautiful_1.2.3~xenial_source.ppa.upload
projects/Beautiful_source/Beautiful_1.2.3~xenial.tar.gz
Is it possible from the command line or a rule somewhere? Or is the one directory up the only place where debuild will work on that?

Building PostgreSQL driver for Qt

I trying to build psql driver but have some unexpected messages.
maxim#maxim-VirtualBox:~/Downloads/distrib/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql$ qmake psql.pro
Cannot read
/home/maxim/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/modules-inst/qt_lib_bootstrap_private.pri:
No such file or directory
...
Cannot read
/home/maxim/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/modules-inst/qt_lib_xml_private.pri:
No such file or directory
But all of these files exist. What is the problem?
The problem seems to be that you have "modules-inst" as the subfolder name, whereas it is only "modules" without the "-inst" suffix in reality.
See how it works fine on my end:
lpapp ~/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql $ qmake psql.pro
lpapp ~/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql $
I found a problem. After install qt-libraries I created new folder 'distrib' and move sources in there. That's why I got this problem.
I should have checked the existence of the directory by cd command.

boost thread link fails in Netbeans 7.1 debugging/testing session

I am developing an app on Netbeans, while I can run it. I can not debug or reun the test files. When I try to do so, I get:
./build/Debug/GNU-Linux-x86/tests/TestFiles/f1: error while loading shared libraries: libboost_thread.so.1.49.0: cannot open shared object file: No such file or directory
It tried including the library or the specific file with the debugging or testing session, but I continue to get that. Could there be an inconsistency with Netbeans?
Any ideas would be greatly appreciated!
I assume your OS is Linux. It follows from your email that you have access to the copy of the libboost_thread.so.1.49.0 file. Let DIR be directory where this library exists.
If you do not have superuser on this computer, use method A. If you have superuser, use method A or method B.
Method A. Good for non-superuser or for superuser.
Let DIR be directory in which library libboost_thread.so.1.49.0 exists.
I assume you can start NetBeans from shell command line, not from GUI icon.
Quit NetBeans. Execute following command in bash:
export LD_LIBRARY_PATH=DIR:$LD_LIBRARY_PATH
start netbeans from command line
Eventually, you will want to put the export command into your ~/.bashrc file.
Method B. Good only for superuser.
If you have superuser, use one the following methods to place the missing library into /usr/lib or /lib:
(1) install boost from rpm or apt or whatever packaging your linux system has, or
(2) install boost from sources with --prefix=/usr, or
(3) copy the mentioned library to /usr/lib. If you have to use #3, be careful about symlinks. Copy using "cp -a" and copy all files beginning libboost_thread.so*, like
cp -a DIR/libboost_thread.so* /usr/lib