我想用curl 获取 asmx传递出来的数据,http://218.5.78.87/Game2/ws.asmx/GetBuildings
但是就是不行,请问怎么办
谁给段代码
要用到上面技术??
找了一下soap.但是没实现,谢谢各位达人

解决方案 »

  1.   

    GetBuildings这个函数需要哪些参数?
      

  2.   

    httpwatch查看的参数  (Content) = {}
    或者 (Content) = {"id":"35"} 
      

  3.   

    你既然知道webservice有个GetBuildings函数,应该有相关的连接参数文档吧。
      

  4.   

    没有啊,我们就是要抓取别人的数据,
    做游戏外挂,以前用curl 都能顺利的搞定
    但是遇到这个游戏是dot net 做的,就郁闷了
    还是webservice 可以post 数据吗??
      我不知道这个能不能用PHPcurl实现。
    请各位高手 帮帮忙一个CURL登陆的,
    <?php
    $geturl = "http://222.241.150.195:8021/Game2/ws.asmx/GetCastle";
    $loginurl = "http://218.5.78.87/youjia.aspx?user_id=139788&time=2009-9-11&server_id=1801&sign=987AFAC01253EE0FE5178F6A2E189CD8&gameType=5";
     
     
    function getContent($url,$iscookie=false,$param=''){
    //echo $_SESSION['id'];
    $cookie_file = "D:\wamp\www\shikong\cookies.txt";
    $ch = curl_init();
    curl_setopt($ch,CURLOPT_REFERER,0);
    curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1);
    if($param)
    curl_setopt($ch, CURLOPT_POSTFIELDS, $param);
    if($iscookie)
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
    curl_setopt($ch,CURLOPT_COOKIEFILE, $cookie_file);
    curl_setopt($ch, CURLOPT_NOBODY, 0);
    curl_setopt($ch,CURLOPT_TIMEOUT,120);
    $_source = curl_exec($ch);
    curl_close($ch);
    return $_source;
    }
     getContent($loginurl,true);
    //$ss = getContent($geturl,true,http_build_query($post));
    //var_dump($ss);
     
    ?>