我有一份SSRS 2005报告,我想使用webservice来检索一些数据.该Web服务将采用几个参数.
作为测试,我在本地环境中设置了一个非常简单的演示Web服务项目:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {}
[WebMethod]
public int DivideByTwo(int numberIn) {
return numberIn/2;
}
}
Run Code Online (Sandbox Code Playgroud)
然后我的测试报告有一个使用XML数据源的数据集,连接字符串中有webservice的(localhost)URL.
在数据集的查询字符串中,我有以下内容,基于MS文档(http://msdn.microsoft.com/en-us/library/aa964129(SQL.90).aspx):
<Query>
<SoapAction>http://tempuri.org/DivideByTwo</SoapAction>
<Method Namespace="http://tempuri.org/" Name="DivideByTwo" />
<Parameters>
<Parameter Name="NumberIn">
<DefaultValue>100</DefaultValue>
</Parameter>
</Parameters>
<ElementPath IgnoreNamespaces="True">*</ElementPath>
</Query>
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是,尽管web服务被触发,但参数没有传递给webservice,因此返回值始终为0.我调试了webservice并在DivideByTwo()方法中放置了一个断点,当从报表触发webservice调用并且命中断点时,无论我在查询XML的元素中放置什么,numberIn值始终为0.
我还尝试在"数据集"对话框的"参数"选项卡中指定"NumberIn"参数(带有提供的值),并从查询XML中删除元素 - 结果是相同的.
我在网上发现了一些帖子,概述了同样的问题,但似乎无法找到解决方案,并且在过去的几个小时内一直在撕扯我的头发.任何帮助将非常感激.
我有一个Android活动,其中我有一个ListView绑定到自定义ArrayAdapter.ListView的每一行都有两个EditText(数字)字段.
ArrayAdapter最初是从SQLite DB填充的.但是,用户可以在ListView的末尾添加一行,或者(通过长按一行)删除ListView中的任何行.当他们点击"保存"按钮时,他们的更改会保持不变.
我通过将AfterTextChanged()事件的CustomTextWatcher附加到ArrayAdapter的getView()方法中的每个EditText(传递EditText和ArrayAdapter项目列表中的相应对象)然后设置匹配来跟踪更改.该对象的属性为EditText的内容.这样,在保存时我可以简单地遍历底层对象列表并进行适当的DB更改,因为知道对象列表是最新的.
适配器类和CustomTextWatcher的代码:
private class CustomAdapter extends ArrayAdapter<DataItem> {
private ArrayList<DataItem> items;
public CustomAdapter(Context context, int textViewResourceId, ArrayList<DataItem> items) {
super(context, textViewResourceId, items);
this.items = items;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
DataItem wed = items.get(position);
if (v == null) {
LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.log_exercise_row, null);
}
if(wed != null)
{
EditText text1 = (EditText) v.findViewById(R.id.text1);
EditText text2 = (EditText) v.findViewById(R.id.text2);
text1.addTextChangedListener(new CustomTextWatcher(text1,wed));
text2.addTextChangedListener(new CustomTextWatcher(text2,wed));
int …Run Code Online (Sandbox Code Playgroud)