BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-06-2007, 01:03 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2005
Model: 8300
Carrier: EntelPCS
Posts: 41
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Web service question.

Please Login to Remove!

Hi, I have a very simple webservice and need to call it form the BB

In vb.net I do:

Dim MyVar as New localhost.Service1
Dim MyVar2

MyVar2 = MyVar.MyTest

Form1.Label1.Value=MyVar2

How do I do this with the BB plugin?
Offline  
Old 11-06-2007, 02:54 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2007
Model: 8100
PIN: N/A
Carrier: Rogers
Posts: 140
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Take a look at the bundled samples that come with the plugin, there are examples there for a Form Submit and accessing a database via webservice that will give you the syntax you need.

Go to your start menu via "Start -> Programs -> Research In Motion -> BlackBerry Plugin for Microsoft Visual Studio -> Sample Browser"

The syntax would look something like the following in javascript:

var myservice = new localhost().Service1;
myservice.MyTestAsync();

Also remember that all the web service calls are asynchronous in case you are out of coverage so you need to assign a event handler to the return of the web service. Very similar to doing asynchronous web service calls in .NET. You can expand the web reference you added to see the "completed" event that you can assign JavaScript to.

Hope that helps
Offline  
Old 11-13-2007, 11:51 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Jul 2005
Model: 8300
Carrier: EntelPCS
Posts: 41
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes it did help!
but now I have a new problem.
Instaleed the app on the 8800 and when I click the button, after a few seconds I get "an error has occurred, Not Found" error.
Any clues?
Offline  
Old 11-13-2007, 12:22 PM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2007
Model: 8100
PIN: N/A
Carrier: Rogers
Posts: 140
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

When you published your app to the BlackBerry Enterprise server did you make sure your target URL for the web service was set properly. If you were working with a webservice that was running on your local machine it may have been in there as local host.

If you expand your web reference, you will see the service node for it. If you select the service node and view the properties window, you can see where you can actually set the target URL of the web service
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.