开发者

Connecting to webservice from BlackBerry

开发者 https://www.devze.com 2023-01-23 16:30 出处:网络
I am connecting to a web server from a BlackBerry simulator for the 9630, to get an image and display it on screen.

I am connecting to a web server from a BlackBerry simulator for the 9630, to get an image and display it on screen.

But while testing this same app in the 8520 and 9700 simulators, it doesn't work. I think it didn't connect to the web service.

I need to be able to connect to a web service from all simulators.

String filepath="file:///store/home/user/loan1.jpg";
FileConnection fc = (FileConnection)Connector.open(filepath,Connector.READ_WRITE);
String photoXml=
    "<Mortgage开发者_Python百科GetPhoto><LoanOfficerID>82</LoanOfficerID></MortgageGetPhoto>";
byte[] imgArry=
    Base64InputStream.decode(new DataParsingComm().ILGetImage(photoXml));
EncodedImage image = EncodedImage.createEncodedImage(imgArry,0,imgArry.length);

BitmapField bitf=new BitmapField() {
    public void layout(int width, int height) {
        super.layout(100, 100);
    }
};
bitf.setImage(image);
HorizontalFieldManager bfm = new HorizontalFieldManager(FIELD_HCENTER); 
bfm.add(bitf);

add(bfm);


I think it didn't connect to the web service.

It seems you should verify this before asking your question. Set a breakpoint in the debugger, and see where code execution fails.


Have you opened the mds simulator? The simulator needs it to access internet.


Make sure you have MDS turned on. Use JSR172 webservices (see NetBeans documentation), and I don't think you can transfer and image direclty, you'll need to transfer a byte array.

0

精彩评论

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