急急急!求教VC6.0调用WEB接口

泥鳅不是鱼 2011-10-31 11:53:30
XML文件如下

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="GetAlarmMsgDataSet">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Account" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="PassWord" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="RowCount" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="ErrCode" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetAlarmMsgDataSetResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetAlarmMsgDataSetResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
<s:element minOccurs="1" maxOccurs="1" name="ErrCode" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetAlarmMsg">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Account" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="PassWord" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="RowCount" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="ErrCode" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetAlarmMsgResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetAlarmMsgResult" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="ErrCode" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="GetAlarmMsgDataSetSoapIn">
<wsdl:part name="parameters" element="tns:GetAlarmMsgDataSet" />
</wsdl:message>
<wsdl:message name="GetAlarmMsgDataSetSoapOut">
<wsdl:part name="parameters" element="tns:GetAlarmMsgDataSetResponse" />
</wsdl:message>
<wsdl:message name="GetAlarmMsgSoapIn">
<wsdl:part name="parameters" element="tns:GetAlarmMsg" />
</wsdl:message>
<wsdl:message name="GetAlarmMsgSoapOut">
<wsdl:part name="parameters" element="tns:GetAlarmMsgResponse" />
</wsdl:message>
<wsdl:portType name="AMServiceSoap">
<wsdl:operation name="GetAlarmMsgDataSet">
<wsdl:input message="tns:GetAlarmMsgDataSetSoapIn" />
<wsdl:output message="tns:GetAlarmMsgDataSetSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetAlarmMsg">
<wsdl:input message="tns:GetAlarmMsgSoapIn" />
<wsdl:output message="tns:GetAlarmMsgSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="AMServiceHttpGet" />
<wsdl:portType name="AMServiceHttpPost" />
<wsdl:binding name="AMServiceSoap" type="tns:AMServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetAlarmMsgDataSet">
<soap:operation soapAction="http://tempuri.org/GetAlarmMsgDataSet" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetAlarmMsg">
<soap:operation soapAction="http://tempuri.org/GetAlarmMsg" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="AMServiceSoap12" type="tns:AMServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetAlarmMsgDataSet">
<soap12:operation soapAction="http://tempuri.org/GetAlarmMsgDataSet" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetAlarmMsg">
<soap12:operation soapAction="http://tempuri.org/GetAlarmMsg" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="AMServiceHttpGet" type="tns:AMServiceHttpGet">
<http:binding verb="GET" />
</wsdl:binding>
<wsdl:binding name="AMServiceHttpPost" type="tns:AMServiceHttpPost">
<http:binding verb="POST" />
</wsdl:binding>
<wsdl:service name="AMService">
<wsdl:port name="AMServiceSoap" binding="tns:AMServiceSoap">
<soap:address location="http://218.3.118.213:8111/AMService.asmx" />
</wsdl:port>
<wsdl:port name="AMServiceSoap12" binding="tns:AMServiceSoap12">
<soap12:address location="http://218.3.118.213:8111/AMService.asmx" />
</wsdl:port>
<wsdl:port name="AMServiceHttpGet" binding="tns:AMServiceHttpGet">
<http:address location="http://218.3.118.213:8111/AMService.asmx" />
</wsdl:port>
<wsdl:port name="AMServiceHttpPost" binding="tns:AMServiceHttpPost">
<http:address location="http://218.3.118.213:8111/AMService.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
现我用SOAP方式调用提供的一个接口

string GetAlarmMsg(string Account,string PassWord,int RowCount,ref int ErrCode)
参数说明:
Account 分中心账号
PassWord 分中心密码
RowCount 每次读取的记录数
ErrCode 接口执行结果代码 :
0 成功 -1 账号密码不正确 -2 IP地址被限制 -99 系统错误

没接触过啊,无法下手啊!求高手解答
...全文
56 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
q56591154 2011-11-03
  • 打赏
  • 举报
回复
System::String^ Account;
System::String^ PassWord;
System::Int32 RowCount ;
System::Int32 ErrCode;
GetAlarmMsg(Account,PassWord,RowCount,ErrCode);
泥鳅不是鱼 2011-11-01
  • 打赏
  • 举报
回复
现在我用VC2008直接添加的一个WEB ,在CLR模式下,
这个函数声明应该怎么传参?
inline System::String^ AMService::GetAlarmMsg(System::String^ Account, System::String^ PassWord, System::Int32 RowCount, System::Int32 %ErrCode){...}
泥鳅不是鱼 2011-10-31
  • 打赏
  • 举报
回复
返回值:xml格式的告警信息列表 如下:
<?xml version="1.0" encoding="UTF-8"?>
<AlarmMsg Count="2">
<Msg ID="" title="" content="" HostCode="" TrueName="" SendTime=""></Msg>
<Msg ID="" title="" content="" HostCode="" TrueName="" SendTime=""></Msg>
.
.
.
</AlarmMsg>

ID:记录编号
Title:告警信息标题
Content:告警信息内容
HostCode:告警电话
TrueName:告警用户姓名
SendTime:告警时间

3,055

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC HTML/XML
社区管理员
  • HTML/XML社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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