Preface
In the service-side development of the tc, you can use gSOAP to invoke the Web Service.
How to use gsoap, references
gSOAP Implementing a C + + call to a Web servicenext, we'll Show you how to develop in tc.
the way of development and environment construction
The CF side of the TC calls webservice, capable of gSOAP the generated and finished code into A. lib file (windows, a. A file under Linux)
The development tools used here are visual studio.
Create a new empty Project. Language selected C + + will be able to
The path after creation is as Above.
In the file structure Above. In addition to Libsoa.h and LIBSOA.C Files. The other files are gSOAP based on Wsdl.
In the LIBSOA.C paper. We write some wrapper function for external Invocation.
The reason is that the function names produced by gSOAP are longer and inconvenient to Use.
Similar ns1__xxxxxx this.
To create A. Lib file, make the following settings in the properties of the project, for example:
After the setup is complete and the relevant code is written, it will be possible to generate A. lib File.
Click Generate--create a solution
This will result in a debug folder under the Project's path.
Similar approaches:
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 capable of debugging in visual Studio.
But at the time of collaborative Development. If you encounter a condition that cannot be debugged, you can use the source code again to generate A. lib file at the same time.
[Teamcenter 2007 development] call Web service