本文主要讲述VC++6.0调用Web Services的方法,其中web services可以是c#,java,vc++.net等提供的服务都可以调用!主要的大致过程如下:
需要装Soap Toolkit3.0,电脑上一般自带Soap Toolkit1.0,以下代码在VC++6.0中测试成功。
在stdafx.h加上
//WEB_SERVICE
#include <stdio.h>
#import "msxml4.dll"
using namespace MSXML2;
#import "C:/Program Files/Common Files/MSSoap/Binaries/mssoap30.dll" /
exclude("IStream", "IErrorInfo", "ISequentialStream", "_LARGE_INTEGER", /
"_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME")
using namespace MSSOAPLib30;
//END
SoapTestDlg.h里面
/
CString BeginSoap(CString,CString,CString);
ISoapConnectorPtr SoapConnector;
ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
///
SoapTestDlg.cpp里面
///
void CSoapTestDlg::O