Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Commmunication API problem with BISB

[ Edited ]

I am using NonBlockingSenderDestination and it works perfectly on the simulator. On the device, it fails to work correctly. The problem happens with BIS-B.

 

I was so happy seeing how great the communication api worked on the simulator. It's really depressing to see that it doesn't work the same on the device. 

Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: Commmunication API keeps using GET

The problem seems to happen only on BIS-B. Anyone know why?
Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: Commmunication API keeps using GET

[ Edited ]

I will pay anyone who can help me fix this problem $100 via paypal. I am not kidding,joking or whatever.

Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: Commmunication API keeps using GET

These are the headers that are being receieved by the server:

GET /directory/sxmlrpc.php HTTP/1.1
Host: tapatalk.com

Content-Length: 90

Accept-Charset: *

Accept-Encoding: gzip

Via: BISB_3.5.1.90

User-Agent: Communication API Library

Mobiquo_id: 9

Content-Type: text/xml

Accept: */*

Connection: close
Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: Commmunication API keeps using GET

[ Edited ]
public static void get_nested_category(MessageListener l)
	{
		try {
			Context _context;
			ConnectionFactory _factory= new ConnectionFactory();
		
			_factory.setConnectionMode(ConnectionFactory.ACCESS_READ_WRITE);
			BisBOptions bisOptions = new BisBOptions(NOT INCLUDED);
			
			_factory.setTransportTypeOptions(TransportInfo.TRANSPORT_BIS_B, bisOptions);
			_factory.setAttemptsLimit(3);
			if (DeviceInfo.isSimulator()) {
				_factory.setPreferredTransportTypes(new int[] { TransportInfo.TRANSPORT_TCP_WIFI,
						TransportInfo.TRANSPORT_TCP_CELLULAR });
			}
			_context = new Context("get_nested_category", _factory);
			 NonBlockingSenderDestination des= (NonBlockingSenderDestination)DestinationFactory.getSenderDestination("get_nested_category", SDKConstants.DIRECTORY_URI);
			 if(des==null)
			 {
				 
				
				 
				 DirectoryMsgProcessor p = new DirectoryMsgProcessor(SDKConstants.HASHTABLE);
					
				
				 des =DestinationFactory.createNonBlockingSenderDestination(_context, SDKConstants.DIRECTORY_URI,p, l);
				
			 }
			 
			   ByteMessage b= DirectoryAPIHelper.createDirMessage(des, "get_nested_category", new Vector());
			   VerticalFieldManager m = new VerticalFieldManager();
			   m.add(new ColoredLabelField("Updating Directory Cache...", Field.FIELD_HCENTER,Color.WHITE));
			   SDKConstants.activity.setActivityManager(m);
			      SDKConstants.activity.show();
		         des.send(b);
		       
		        
		        
			
			
	             
			 
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		
	}
	
	}

 

   public static ByteMessage createDirMessage(NonBlockingSenderDestination des,String method,Vector params)
	   {
		   try{
		   ByteArrayOutputStream bos = new ByteArrayOutputStream ();
		   KXmlSerializer xw = new KXmlSerializer();
		    xw.setOutput(new OutputStreamWriter( bos ));
	          XmlRpcWriter  writer = new XmlRpcWriter( xw );
	            writer.writeCall( method, params );
		    xw.flush();
	
		   
	           byte[] request = bos.toByteArray();
	         ByteMessage bt=des.createByteMessage();
	         ((HttpMessage) bt).setMethod(HttpMessage.POST);
	         //bt.setCancellable(true);
	       
	        
	    
	         Hashtable ht=new Hashtable();
	        ht.put(HttpHeaders.HEADER_ACCEPT_ENCODING, "gzip");
	           ht.put(HttpHeaders.HEADER_USER_AGENT, getUserAgent());
	           ht.put(HttpHeaders.HEADER_CONTENT_TYPE, HttpHeaders.CONTENT_TYPE_TEXT_XML);
	           ht.put(HttpHeaders.HEADER_CONTENT_LENGTH, request.length+"");
	       
	 
				ht.put("x-rim-transcode-content", "none");
				ht.put(HttpHeaders.HEADER_ACCEPT_CHARSET,"*");
				ht.put(HttpHeaders.HEADER_ACCEPT, "*/*");
	         Headers he=new Headers(ht);
	         bt.setTransportHeaders(he);
	         bt.setBytePayload(request);
	         return bt;
		   }
		   catch(Exception e)
		   {
			   
		   }
		return null;
	   }

 

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Commmunication API keeps using GET

I am not familiar with the methods, but i've asked for assistance for your issue.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Re: Commmunication API keeps using GET

[ Edited ]

For bis-b transport type u got to append

;deviceside=false;ConnectionType=x-y



to the url... for device, then only u could see some response from the server...

 

Try adding the above string as i mentioned in the brackets.. Hope it helps

Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: Commmunication API keeps using GET

[ Edited ]

Kiran_Snist wrote:

For bis-b transport type u got to append

;deviceside=false;ConnectionType=x-y



to the url... for device, then only u could see some response from the server...

 

Try adding the above string as i mentioned in the brackets.. Hope it helps


If I use that url then I can't use the communication api

Developer
Posts: 246
Registered: ‎12-13-2010
My Device: Not Specified

Re: Commmunication API keeps using GET

The server responds with a message that the requested url can not be found. The problem only happens with BIS-B

Developer
Posts: 174
Registered: ‎01-25-2011
My Device: Not Specified

Re: Commmunication API keeps using GET

Is ur sim bis activated??