日期:2014-05-17  浏览次数:20890 次

C#POST问题(Data)
我的url="http://www.ftmap.cn/Common/CommonService.asmx",但data="<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><GetLatLngXmlByAddress xmlns=\"http://SHMIS/Common/CommonService\"><pstrAddress>%E5%8C%97%E4%BA%AC%E6%B5%B7%E6%B7%80%E5%8C%BA%E7%BE%8A%E5%9D%8A%E5%BA%97%E4%B8%9C%E8%B7%AF</pstrAddress></GetLatLngXmlByAddress></soap:Body></soap:Envelope>";

ie浏览器上是这么说的,但是却无法获得网页信息;我要获得信息网址是http://www.diatiantian.com/search.html  那位高手可以指点一下为什么啊?
我需要获取的是地图的经纬度
------最佳解决方案--------------------
CommonService.asmx应该是webservice,你直接引用过来编程就行。
------其他解决方案--------------------
右键项目,添加 服务引用
然后 直接调用方法就行了
------其他解决方案--------------------
看你填的命名空间是什么

[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    //若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 
    //[System.Web.Script.Services.ScriptService]

文件的上面有。。
using WEB服务命名空间;

WEB服务命名空间 service=new WEB服务命名空间();
service.GetLatLngXmlByAddress
....

没了

------其他解决方案--------------------
ServiceReference1.xxxxx
------其他解决方案--------------------
引用:
右键项目,添加 服务引用
然后 直接调用方法就行了

额,我可以问下怎么直接引用吗?我添加了服务引用,也添加上了,就是不知道怎么用……
知道添加这个了[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    //若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 
    //[System.Web.Script.Services.ScriptService]
然后呢?
------其他解决方案--------------------
还有我不知道怎么和我的URL联系到一起……我的URL是post的获取方式
------其他解决方案--------------------
引用:
看你填的命名空间是什么

[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    //若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。 
  ……

你所说的命名空间是什么?你看我添加后是这样的,
------其他解决方案--------------------
引用:
ServiceReference1.xxxxx


使用这个要不要开设么服务器啊?直接用ServiceReference service = new ServiceReference();就可以吗?
------其他解决方案--------------------
啊……我知道怎么用了,谢谢各位的回答……