|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
IntroductionSome days ago I faced the problem of calling the Webservices from VC++ 6.0 written in C#. The I searched on Google and found the article by Neil Yao that was very useful. Then I started to find the another way for calling the webservices. I came to know about the SPROXY.EXE. It is a command line tool that generates native C++ client code for accessing an XML Web service based on a WSDL description.
Soap Features:Soap is a protocol which helps to communicate between the applications. Sending messages through internet. It is language independent, platform independent and is based on XML. Today the better way to communicate between is via Http request. Soap was brought in for this purpose. Creating the Application:
First Step:
Creating Web Service :
Create the virtual directory and in that Create the Asp.net web Service project. Name it as MyWebService . In
Implementation file that is MyWebService.asmx.cs file write the below code after the Component Designer Generated Code heading:
Second Step:
Using SPROXY.EXE
Go to the Visual studio 2003 command prompt there you type the following line:
Third Step: Creating MFC Application I am using Visual Studio 2003. Create New VC++ project then choose MFC Application after that you will see the MFC Application wizard. Click on Application type and Select dialog based application and Click finish. Now go to Resource view, place one button on it and name it as Call WebService and name of button as btnWebService. Double Click on the button you will see the message handler added for the button. You will See the OnbtnWebService() function being added. Now add the file created in Step Second in the Application. You will find the new class been created there. Now on click of OnbtnWebService() create the object of class and you can invoke the WebServices Methods. For this you have to include the header file and write the one more statement as: Using namespace createdby_Sproxy;
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||