使用webservice,生成Request、Response类如何使用?

pfworld 2018-02-09 04:28:21


[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="userLogin", WrapperNamespace="http://webservice.cms.hikvision.com", IsWrapped=true)]
public partial class userLoginRequest {

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://webservice.cms.hikvision.com", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string request;

public userLoginRequest() {
}

public userLoginRequest(string request) {
this.request = request;
}
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
[System.ServiceModel.MessageContractAttribute(WrapperName="userLoginResponse", WrapperNamespace="http://webservice.cms.hikvision.com", IsWrapped=true)]
public partial class userLoginResponse {

[System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://webservice.cms.hikvision.com", Order=0)]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public string @return;

public userLoginResponse() {
}

public userLoginResponse(string @return) {
this.@return = @return;
}
}



一般的使用webservice都是方法,但是现在使用第三方webservice直接出现的是Request、Response类,请问这个如何使用?

...全文
1300 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cainiao234 2018-12-20
  • 打赏
  • 举报
回复
new 里面的xxxxClient类就可以了,就可以调用对用的方法了
  • 打赏
  • 举报
回复
这个是 partial class。你应该贴出完整的 class 代码,或者至少仔细看人家的教程。 如果第三方组件没有教程,那就扔掉!
pfworld 2018-02-09
  • 打赏
  • 举报
回复


还真没有!所以不会用了!
正怒月神 2018-02-09
  • 打赏
  • 举报
回复
引用 3 楼 pfworld 的回复:
[quote=引用 2 楼 hanjun0612 的回复:] 首先看他们 api文档。 而且你看他们是 public string request; 所以这个request,并不是 Http...Request 只是一个字符串参数而已。
这个如何调用呀, ServiceReference1.userLoginRequest; 都是类!! 以前使用的webservice都是方法! [/quote] 不是吧。我觉得这个userloginrequest和userloginresponse是两个对象,分别用来作为参数传递和接收的。 应该有一个 userlogin的方法吧? 可能有一个 public userloginresponse userlogin(userloginrequest){}这样的方法吧?
pfworld 2018-02-09
  • 打赏
  • 举报
回复
引用 2 楼 hanjun0612 的回复:
首先看他们 api文档。 而且你看他们是 public string request; 所以这个request,并不是 Http...Request 只是一个字符串参数而已。
这个如何调用呀, ServiceReference1.userLoginRequest; 都是类!! 以前使用的webservice都是方法!
正怒月神 2018-02-09
  • 打赏
  • 举报
回复
首先看他们 api文档。 而且你看他们是 public string request; 所以这个request,并不是 Http...Request 只是一个字符串参数而已。
  • 打赏
  • 举报
回复
这就是对应WS方法的请求参数和响应参数吧……

12,166

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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