drza10046 2011-10-05 06:53
浏览 48

使用javascript而不是php访问网络服务器

I'm now using phonegap to develop a application. I have found a similar php code which can assess to a local server here, but unfortunately phonegap doesn't support php.

Can anyone help me to 'translate' the php code below into JQuery ajax or any other javascript code? Thanks!

require_once('nusoap.php');

  /* create client */
  $endpoint = "http://www.pascalbotte.be/rcx-ws/rcx";
  $ns = "http://phonedirlux.homeip.net/types";

  $client = new soapclient($endpoint);

  // queryRcx is the name of the method you want to consume
  // RcxQuery_1 is the name of parameter object you have to send
  // x and y are the names of the integers contained in the object
  $result = $client->call('queryRcx',array('RcxQuery_1' => array('x' => 12,'y' => 13)), $ns);
print_r($result);
  • 写回答

2条回答 默认 最新

  • dsp15140275697 2011-10-05 06:58
    关注

    Step 1. Resolve the 404 associated with http://www.pascalbotte.be/rcx-ws-rpc/rcx?WSDL
    Step 2. Get a JavaScript SOAP client.
    Step 3. ... ... ...
    Step 4. PROFIT!

    Seriously though. All this really takes is a JavaScript based SOAP client. While they aren't a dime-a-dozen, they are pretty common. The one above is for jQuery, but it is easy enough to find other implementations.

    The fact that the WSDL definition causes a 404 may or may not be a problem as the actual wsdl definition is technically optional, but you really want to figure out what happened.

    评论

报告相同问题?

悬赏问题

  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私