Preface
In the service-side development of the TC, you can use gSOAP to invoke the Web service.
How to use gSOAP, reference
The gSOAP implementation of A/C + + call to Web service next describes how to develop in TC.
The way of development and environment construction
On the CF side of the TC call WebService, you can put the gSOAP generated and completed code into a. lib file (Windows, under Linux is. a file)
The development tools used here are Visual Studio.
Create a new empty project, the language selected C + + can be
After the creation completes the path as above.
In the above file structure, except for the libsoa.h and LIBSOA.C files, the other files are gSOAP based on WSDL.
In LIBSOA.C This document, we write some wrapper function for external invocation. The reason is that the function names produced by gSOAP are long and inconvenient to use.
Similar to ns1__xxxxxx.
To create a. lib file, make the following settings in the properties of the project:
Setup is complete, and the relevant code is written, you can generate. lib file.
Click Build-Build Solution
In this case, a debug directory will be generated under the project path.
The pathway is similar:
some problems of attention in development
Returnflag=soap_call___ns1__batchexecutesqls (&mesoap,parameter.endpoint, NULL, Batchexecutesqlsrequest, Batchexecutesqlsresponse); if (returnflag==28) { *returncode=strdup ("fail"); *returnmsg=strdup ("Could not connect to Web service host!"); } else if (batchexecutesqlsresponse!=null) { *returncode= strdup (batchexecutesqlsresponse->returncode); *returnmsg=strdup (batchexecutesqlsresponse->errormessage); }
Similar to the above code:
The return value is 28 for servers that cannot connect to the Web service. This time response inside naturally also is empty.
Another issue to be aware of is:
The above generated. Lib is available for debugging in Visual Studio.
However, in collaborative development, if you encounter a situation that cannot be debugged, you can re-create a. lib file using the source code in the local computer.
[Teamcenter 2007 Development] Call Web service