WSDL 调用

falx2004 2010-01-15 02:31:19
现有 WSDL 文件如下:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!-- Generated 2010-01-14 17:23:39 by Four J's WSDL File Generator, Build 73568
-->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:fjsd="http://www.digitalchina.com/types/" xmlns:fjs="http://www.digitalchina.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="aws_pdmstd" targetNamespace="http://www.digitalchina.com/">
<message name="TIPTOPGateWay">
<part name="param" type="xsd:string" />
</message>
<message name="TIPTOPGateWayResponse">
<part name="result" type="xsd:string" />
</message>
<portType name="aws_pdmstdSoap">
<operation name="TIPTOPGateWay">
<input message="fjs:TIPTOPGateWay" />
<output message="fjs:TIPTOPGateWayResponse" />
</operation>
</portType>
<binding name="aws_pdmstdBind" type="fjs:aws_pdmstdSoap">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="TIPTOPGateWay">
<soap:operation soapAction="" />
<input>
<soap:body namespace="http://www.digitalchina.com/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
</input>
<output>
<soap:body namespace="http://www.digitalchina.com/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" />
</output>
</operation>
</binding>
<service name="aws_pdmstd">
<port name="aws_pdmstdSoap" binding="fjs:aws_pdmstdBind">
<soap:address location="http://172.16.9.27/cgi-bin/fglccgi/ws/r/aws_pdmstd" />
</port>
</service>
</definitions>


现需用C++ 封装函数 TIPTOPGateWay

CString TIPTOPGateWay(CString xmlin)
{
ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;

// Connect to the service
Connector.CreateInstance(__uuidof(HttpConnector));
Connector->Property["EndPointURL"] = "http://172.16.9.27/cgi-bin/fglccgi/ws/r/aws_pdmstd";
Connector->Connect();

// Begin message
Connector->Property["SoapAction"] = "uri:soap_2.php";
Connector->BeginMessage();

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

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

// Build the SOAP Message
Serializer->startEnvelope("","","");
Serializer->startBody("");
Serializer->startElement("add","uri:soap_2.php","","m");
Serializer->endElement();
Serializer->endBody();
Serializer->endEnvelope();

// Send the message to the web service
Connector->EndMessage();

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

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

// Display the result
CString xmlout;
return xmlout;
}

对这种模式不熟悉,所以其中诸多参数不知道怎么设置,请帮忙完善,分不够再加
...全文
790 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoyubujimo 2010-01-15
  • 打赏
  • 举报
回复
什么也不说了。
falx2004 2010-01-15
  • 打赏
  • 举报
回复
wsdl.exe /l:cpp ***.wsdl 然后就有了个头文件...真悲剧
科比布莱恩特 2010-01-15
  • 打赏
  • 举报
回复
明显的WebService调用,建议直链它的XML接口就OK.
falx2004 2010-01-15
  • 打赏
  • 举报
回复
我的问题就是 ,给你一个WSDL文件 如果用C++ 调用
healer_kx 2010-01-15
  • 打赏
  • 举报
回复
有什么样的问题呢?这个环境并不好搭建。
falx2004 2010-01-15
  • 打赏
  • 举报
回复
多谢LS 我等你....
wangchentangjuan 2010-01-15
  • 打赏
  • 举报
回复
SF帮顶 等下来看 现在有事情

64,318

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧