BlackBerry 模拟器上网

BB simulator 上网需要有MDS支持,BB的请求数据会经过MDS进行中转,步骤如下:

1 启动MDS【run.bat】

      位置可能在“eclipse/plugins/net.rim.ejde.componentpack5.0.0_5.0.0.25/components/MDS/”

            或者“Program Files/Research In Motion/BlackBerry Email and MDS Services Simulators 4.1.5/MDS/“

            或者....

    1). PC没有使用proxy

           直接运行run.bat ,弹出cmd运行窗口,通常只要窗口没有自动关闭,就应该没有什么问题

    2). PC使用了proxy

          ../MDS/config/目录下,打开rimpublic.property文件,

          [HTTP HANDLER]配置节下,查看是否有以下配置参数[无则加之,有则改之]:

              application.handler.http.proxyEnabled = true
              application.handler.http.proxyHost=host

              application.handler.http.proxyPort=port
              application.handler.http.proxyUser=name
              application.handler.http.proxyPass=paw          

              application.handler.http.AuthenticationSupport = true

 

            红色部分是对应代理服务器的参数,根据实际情况修改

            注意最后一个参数的值,如果是false,那么用BB simulator上网时,就会提示输入代理服务器的user 和pass

              

          [SRPH]配置节下,看是否有下述配置参数[无则加之,有则改之]:

             push.application.reliable.ports=100

          

             切记,前面如有“#”符号,请删除

 

 

          保存,运行run.bat

 

2.启动BB browser        

Update 2010-11-20            

   在开发应用程序过程中,使用到了HttpConnection,当涉及到Authorization参数时,可能会在http header 中添加name和pass

   例如:

          string  credential = name +":" +pass;

          this.httpConnection.setRequestProperty("Authorization", "Basic " + encodeAsString(credential);

 

        如果MDS配置文件中配置参数为: application.handler.http.AuthenticationSupport = true

   则程序执行上述代码后,请求经过MDS后,Authorization信息会被擦掉,通过fiddler可以看到Http header中,不包含Authorization信

 

   息,如果服务端验证使用Basic Authentication,就会出现401的错误    

 

  

       如果MDS配置文件中配置参数为: application.handler.http.AuthenticationSupport = false,就不会有问题,但用代理上网时 ,就

    要手工输入user和pwd

 

 

 


版权声明:本文为kufeiyun原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。