1. webservice还是用http://netboy.cnblogs.com/archive/2006/02/18/333260.html。^_^,这就叫复 用!自己先吐下!
2.偶用的是vs2005,首先当然是添加MSXML2的com组件了,地球人都知道。下面代码直接上了,^_^。
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Text;
7
using System.Windows.Forms;
8
using FormChild;
9
using MSXML2;
10
11
namespace FormParent
12
}
2
3
4
5
6
7
8
9
10
11
12
使用post方法访问的时候必须加:
xmlhttp.setRequestHeader("SOAPAction", "http://tempuri.org/SayHelloTo");
有点疑惑,用get方法为什么就可以不加?这算什么?
3.题外话:
最开始我测试Get方式是放在Form_Load里,post方法是放在button_Click,后来我就在窗体上按住Crlf拖动复制了原来的按钮,然后双击打开……奇怪,咱们双击两个按钮总是定位到原来的button_click的处理过程。bug? 2003好像不是这样的。