Hi all, I am trying to use OS 5.0 Network API to create HTTP connection. However I can't use that to create BIS-B connection for some of my customers. I always get null returned when ConnectionFactory.getConnection invoked.
My code looks like this
Code:
ConnectionFactory connFact = new ConnectionFactory();
ConnectionDescriptor connDesc = null;
int connType = TransportInfo.TRANSPORT_BIS_B;
if (!TransportInfo.isTransportTypeAvailable(connType))
throw new XYZException("!TransportInfo.isTransportTypeAvailable");
if (!TransportInfo.hasSufficientCoverage(connType))
throw new XYZException("!TransportInfo.hasSufficient");
TransportDescriptor[] tds = TransportInfo.getTransportDescriptors(connType);
if (tds.length <= 0) throw new XYZException("tds.length<0");
for (int i = 0; i < tds.length; i++) {
connDesc = connFact.getConnection(url, connType, tds[i].getUid());
if (connDesc != null) {
System.out.println("well done");
break;
}
}
Please let me known if I made anything wrong in this segment. Also if there are other checks I should perform, appreciate for telling that to me
And FYI, I am in a country no BIS service provided from any operator now, so I can only try to change code and let our customers attempt to connect.
Thanks in advance for any hints.