Download gsoap-linux-2.7.tar.gz (http://gsoap2.sourceforge.net/) to/test/gsoap
Decompress gsoap-2.7.tar.gz
Run
./Configure -- prefix =/usr/local/gsoap
Make
Make install
Cd/
# Create a/jira folder
Mkdir/jira
Cd/jira
# Http: //.../jira/rpc/soap/jirasoapservice-v2? Wsdl: This is the jira wsdl file.
/Usr/local/gsoap/bin/wsdl2h-c-o jira. h http: //.../jira/rpc/soap/jirasoapservice-v2? Wsdl
/Usr/local/gsoap/bin/soapcpp2-c jira. h
/Usr/local/gsoap/bin/wsdl2h is the installation path of gsoap.
Gcc-I/test/gsoap/gsoap-2.7/gsoap-o jiraclient. c soapC. c soapClient. c/test/gsoap/gsoap-2.7/gsoap/stdsoap2.c
/Test/gsoap/gsoap-2.7/gsoap ==> download source file decompression path of gsoap
When an error occurs, delete the error function in the specified file until there is no error. Warning does not matter.
If the compilation is successful, the jiraclient executable file is generated in the/jira directory.
The executable file name generated by-o.
The following is the dependent file.
Run the command as follows.
Cd/jira
./Jiraclient jiraname jirapwd
For gcc-I/test/gsoap/gsoap-2.7/gsoap-o jiraclient. c soapC. c soapClient. c/test/gsoap/gsoap-2.7/gsoap/stdsoap2.c
This command, tested-I/test/gsoap/gsoap-2.7/gsoap can be omitted. Stdsoap2.c stdsoap2.h in/test/gsoap/gsoap-2.7/gsoap/stdsoap2.c
Copy to the/jira folder. In this way, the compilation command is programmed.
Gcc-o jiraclient. c soapC. c soapClient. c stdsoap2.c
The following is the source code of jiraclient. c.
--------------------
Jiraclient. c
--------------------
# Include "soapH. h"
# Include "jirasoapservice_v2SoapBinding.nsmap"
Int main (int argc, char ** argv)
{
Struct soap;
Soap_init (& soap );
Char * retValue;
// SoapStub. h contains the soap_call_ns4 _ login function. All WebService methods that can be called are in this folder.
If (soap_call_ns4 _ login (& soap, NULL, NULL, argv [1], argv [2], & retValue) = SOAP_ OK)
Printf ("% s", retValue );
Else
Soap_print_fault (& soap, stderr );
Soap_destroy (& soap );
Soap_end (& soap );
Soap_done (& soap );
RetValue = null;
Return 0;
}