[Teamcenter 2007 Development Combat] Call Web Service

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.