Webservice series (10)-How to call webservice (vc1)

Source: Internet
Author: User
4.10 use vc to call
Download mssoaptoolkit20.exe
Reference
# Import "msxml3.dll"
Using namespace MSXML2;
# Import "C: \ Program Files \ Common Files \ MSSoap \ Binaries \ mssoap1.dll" exclude ("IStream", "ISequentialStream", "_ LARGE_INTEGER", "_ ULARGE_INTEGER ", "tagSTATSTG", "_ FILETIME") raw_interfaces_only
Using namespace MSSOAPLib;
Routine:
Create a project named "MFC AppWizard (exe) [Mclient] à step1' basic dialogs. You can use other default values.
Modify source file:
< StdAfx. h>
// Stdafx. h: include file for standard system include files,
// Or project specific include files that are used frequently,
// Are changed infrequently
//

# If! Defined (afx_stdafx_h0000045cd307_9518_4af00008ce3_8ffe38d1acb200000000ded _)
# Define afx_stdafx_h0000045cd307_9518_4af00008ce3_8ffe38d1acb200000000ded _

# If _ MSC_VER> 1000
# Pragma once
# Endif // _ MSC_VER> 1000

# Define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

# Include <afxwin. h> // MFC core and standard components
# Include <afxext. h> // MFC extensions
# Include <afxdisp. h> // MFC Automation classes
# Include <afxdtctl. h> // MFC support for Internet Explorer 4 Common Controls
# Ifndef _ AFX_NO_AFXCMN_SUPPORT
# Include <afxcmn. h> // MFC support for Windows Common Controls
# Endif // _ AFX_NO_AFXCMN_SUPPORT



# Import "msxml3.dll"
Using namespace MSXML2;

# Import "C: \ Program Files \ Common Files \ MSSoap \ Binaries \ mssoap1.dll" exclude ("IStream", "ISequentialStream", "_ LARGE_INTEGER", "_ ULARGE_INTEGER ", "tagSTATSTG", "_ FILETIME") raw_interfaces_only
Using namespace MSSOAPLib;


# Define MSG (message )\
{\
: MessageBox (NULL, _ T (message), NULL, MB_ OK | MB_ICONEXCLAMATION | MB_APPLMODAL );\
Goto cleanup ;\
}


# Define CHECK_HRESULT (hr, message )\
If (FAILED (hr ))\
{\
MSG (message );\
}


// {AFX_INSERT_LOCATION }}
// Microsoft Visual C ++ will insert additional declarations immediately before the previous line.

# Endif //! Defined (afx_stdafx_h0000045cd307_9518_4af00008ce3_8ffe38d1acb200000000ded _)
<MClient. h>
// MClient. h: main header file for the MCLIENT application
//

# If! Defined (afx_mclient_h00009a0000da6_5a62_4aef_be5e_6c7629322ecc00000000ded _)
# Define afx_mclient_h00009a0000da6_5a62_4aef_be5e_6c7629322ecc00000000ded _

# If _ MSC_VER> 1000
# Pragma once
# Endif // _ MSC_VER> 1000

# Ifndef _ AFXWIN_H __
# Error include 'stdafx. H' before including this file for PCH
# Endif

# Include "resource. h" // main symbols

//////////////////////////////////////// /////////////////////////////////////
// CMClientApp:
// See MClient. cpp for the implementation of this class
//

Class CMClientApp: public CWinApp
{
Public:
CMClientApp ();

// Overrides
// ClassWizard generated virtual function overrides
// {AFX_VIRTUAL (CMClientApp)
Public:
Virtual BOOL InitInstance ();
//} AFX_VIRTUAL

// Implementation

// {AFX_MSG (CMClientApp)
// NOTE-the ClassWizard will add and remove member functions here.
// Do not edit what you see in these blocks of generated code!
//} AFX_MSG
DECLARE_MESSAGE_MAP ()
};


//////////////////////////////////////// /////////////////////////////////////

// {AFX_INSERT_LOCATION }}
// Microsoft Visual C ++ will insert additional declarations immediately before the previous line.

# Endif //! Defined (afx_mclient_h00009a0000da6_5a62_4aef_be5e_6c7629322ecc00000000ded _)
 

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.