首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

MS Soap Toolkit的返回值(xml)改如何取得?&&MS SoapToolkit支持SSL麽

2012-01-16 
MS Soap Toolkit的返回值(xml)改怎么取得?&&MS SoapToolkit支持SSL麽?我用的是MSSoapToolkit来访问WebServ

MS Soap Toolkit的返回值(xml)改怎么取得?&&MS SoapToolkit支持SSL麽?
我用的是MS   Soap   Toolkit来访问WebService

代码如下:

CoInitialize(NULL);


//   TODO:   Add   your   control   notification   handler   code   here

ISoapSerializerPtr   Serializer;

ISoapReaderPtr   Reader;

ISoapConnectorPtr   Connector;

//   Connect   to   the   service.
Connector.CreateInstance(__uuidof(HttpConnector30));
Connector-> Property[ "EndPointURL "]   =   "http://119.119.114.24:8090/aglo_ws/services/MemberService ";
//Connector-> Property[ "EnableAutoProxy "]   =   TRUE;
//Connector-> Property[ "ProxyServer "]   =   "119.119.119.9:8080 ";

Connector-> Connect();


//   Begin   the   message.
Connector-> Property[ "SoapAction "]   =   "http://119.119.114.24:8090/aglo_ws/services/MemberService ";

Connector-> BeginMessage();

//   Create   the   SoapSerializer   object.
Serializer.CreateInstance(__uuidof(SoapSerializer30));

//   Connect   the   serializer   object   to   the   input   stream   of   the   connector   object.
Serializer-> Init(_variant_t((IUnknown*)Connector-> InputStream));

//   Build   the   SOAP   Message.
Serializer-> StartEnvelope( " ", " ", " ");
Serializer-> StartBody( " ");
Serializer-> StartElement( "login ", "http://119.119.114.24:8090/alo_ws/services/MemberService ", " ", " ");
Serializer-> StartElement( "in0 ", " ", " ", " ");
Serializer-> WriteString( "admin ");
Serializer-> EndElement();
Serializer-> StartElement( "in1 ", " ", " ", " ");
Serializer-> WriteString( "test ");
Serializer-> EndElement();
Serializer-> EndElement();
Serializer-> EndBody();
Serializer-> EndEnvelope();

//   Send   the   message   to   the   XML   Web   service.
Connector-> EndMessage();            

//   Read   the   response.
Reader.CreateInstance(__uuidof(SoapReader30));

//   Connect   the   reader   to   the   output   stream   of   the   connector   object.
Reader-> Load(_variant_t((IUnknown*)Connector-> OutputStream),   " ");

//   Display   the   result.
TRACE( "Answer:   %s\n ",   (const   char*)Reader-> RpcResult-> text);

CoUninitialize();


-----------------------

最好那句是
TRACE( "Answer:   %s\n ",   (const   char*)Reader-> RpcResult-> text);

它打印出了webservice的返回值,本来那个值是个xml,现在TRACE只打印出了它的text部分,请问怎么取得这个返回的完整部分,也就是那个xml。

我今天才看MS   Soap   Toolkit,不知道怎么用,请高手给个例子

-----------------------


还有,MS   Soap   Toolkit,   怎么可以访问SSL的Webservice麽??
如果可以,该怎么访问??




[解决办法]
你对ca了解吗?

配置ssl,很容易就搜到

我最担心的是,你能否把开发环境搭建起来

热点排行