嗯,是用的直接请求,但参数好像无效,返回来总是提示参数为空
//构造soap请求信息
stringbuilder soap = new stringbuilder();
soap.append();
soap.append();
soap.append();
soap.append();//
soap.append(244767);
soap.append();
soap.append();
soap.append();
//发起请求
uri uri = new uri(http://xxxxxxxx/index.php?r=yar/tgoods);
webrequest webrequest = webrequest.create(uri);
webrequest.contenttype = text/xml; charset=utf-8;
webrequest.method = post;
using (stream requeststream = webrequest.getrequeststream())
{
byte[] parambytes = encoding.utf8.getbytes(soap.tostring());
requeststream.write(parambytes, 0, parambytes.length);
}
httpwebresponse res;
try
{
res = (httpwebresponse)webrequest.getresponse();
}
catch (webexception ex)
{
res = (httpwebresponse)ex.response;
}
streamreader sr = new streamreader(res.getresponsestream(), encoding.utf8);
string strhtml = sr.readtoend();
