开发者

Access Bing translate service with PHP and SOAP

Does anyone know how to access Bing Translate service (search api 2.0) with PHP and SOAP? I've been trying different ways but no开发者_如何学Cne was yet successful. Here's my code:

$soap=new SoapClient("http://api.search.live.net/search.wsdl");//"http://schemas.microsoft.com/LiveSearch/2008/03/Search"
        $params["AppId"]="";
        $params["Query"]=$term;
        $params["SourceLanguage"]=$lang_from;
        $params["TargetLanguage"]=$lang_to;
        $params["Sources"]="Translation";
        //$params["Translation"]=array(
          //"Translation"=>array(
            //"SourceLanguage"=>$lang_from,
            //"TargetLanguage"=>$lang_to
          //)
        //);
        //$params["Sources"]=$sources;
        //$params["definitions"]="";
        //$res=$soap->Search(array("parameters"=>$params));
        die(print_r($soap->Search(array("parameters"=>$params))));


why don't you try this simple method?

http://www.som3on3.com/programming/php/php-bing-translate-api/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜