[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, 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

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.