asmx webservice的代理Web引用在endoperation中具有void返回类型 [英] Proxy webreference for asmx webservice has void return type in endoperation

查看:85
本文介绍了asmx webservice的代理Web引用在endoperation中具有void返回类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个返回JSON数据的asmx webservice。但是当我添加webreference 2.0时,我的结束操作会得到无效的返回类型



当我直接调用URL时的示例数据http://XX.XXX .XX.XX:88 / tabsaleswithdatasync.asmx / FeatureMaster



[{msg:,FeatureSlno:2,Feature: Fuel Used,DefaultValue:,FeatureType:B,Groups:OverView,GroupOrder:0,SubGroupOrder:0,CategorySlno:2 ,UtilisationSlno:1,IconImagePath:,LowerIsBetter:0},{msg:,FeatureSlno:3,功能:座位容量 , 默认值: , 类型特征: B, 组: 概述, GroupOrder: 0, SubGroupOrder: 0, CategorySlno: 3,UtilisationSlno :0,IconImagePath:,LowerIsBetter:0}]



使用wsdl生成的代理webservice是



public System.IAsyncResult BeginFeatureMaster(System.AsyncCallback callback,object asyncState)

{

返回this.BeginInvoke(FeatureMaster, new object [0],callback,asyncState);

}





public void EndFeatureMaster(System.IAsyncResult asyncResult)

{

this.EndInvoke(asyncResult);

}





为什么我没有回报按我的要求键入对象???



我尝试过:



右键单击项目并添加webreference选项

I have a asmx webservice returning JSON data. But when I add webreference 2.0, I am getting void return type on my end operation

example data when I make direct call to URL "http://XX.XXX.XX.XX:88/tabsaleswithdatasync.asmx/FeatureMaster"

[{"msg":"","FeatureSlno":"2","Feature":"Fuel Used","DefaultValue":"","FeatureType":"B","Groups":"OverView","GroupOrder":"0","SubGroupOrder":"0","CategorySlno":"2","UtilisationSlno":"1","IconImagePath":"","LowerIsBetter":"0"},{"msg":"","FeatureSlno":"3","Feature":"Seating Capacity","DefaultValue":"","FeatureType":"B","Groups":"OverView","GroupOrder":"0","SubGroupOrder":"0","CategorySlno":"3","UtilisationSlno":"0","IconImagePath":"","LowerIsBetter":"0"}]

proxy webservice generated using wsdl is

public System.IAsyncResult BeginFeatureMaster(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("FeatureMaster", new object[0], callback, asyncState);
}


public void EndFeatureMaster(System.IAsyncResult asyncResult)
{
this.EndInvoke(asyncResult);
}


Why am i not getting return type as object as I require ???

What I have tried:

Right click on project and add webreference option

推荐答案

您已在如何对从asmx webservice创建的代理webreference进行异步调用 - C#讨论板 [ ^ 。请不要交叉。
You already posted this at how to making async call to proxy webreference created from asmx webservice - C# Discussion Boards[^]. Please do not crosspost.


这篇关于asmx webservice的代理Web引用在endoperation中具有void返回类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆