BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-02-2007, 04:04 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: Cingular
Posts: 23
Post Thanks: 0
Thanked 0 Times in 0 Posts
Red face Calling WebService with Login Crudentials

Please Login to Remove!

Just create this Client Application that hits the webservice on different box
Though i can access to webservice thru Browser and all

My Thick client application cant make call to this webservice, WebService requires windows
crudentials, How would i be able to pass the crudentials to webservice from my black berry application.

Even in design time when i design with VS plugin, I cant make webservice referances, It would askme to provide
crudentials, How web services referanced thru VS pluggin. Even I do provide this info web referance would fail

Can anyone help me out to call this web Service..
Offline  
Old 11-03-2007, 09:39 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

That's wierd.. I've been able to add a web reference with NT authentication to my VS Plugin project.

It uses the same screens as adding the web reference to a normal C# project.

But what happens when it is on the device, is that when the user first executes a method to access the web service they will get a challenge response on the device for their credentials. The MDS Runtime will then cache those credentials.

You can even clear your credential cache using the MDS control center.
Offline  
Old 11-05-2007, 08:55 AM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: Cingular
Posts: 23
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Brcewane,
Yes it uses the same screen when adding web referances, and then pop up box comes up on VS plug in to provide NT crudential for that machine (Where the web service sit) Though i provide it fails to referance in first place.
Second, All users of this client app should be able access this web service from their BB app on their black berry.
I have managed to change web referances from files, First i Have created web referance on local which works and no need crudential. then dump this files on notepad and changed referances. Now app work on BB divice but when make call to web service gives script error. Is there any script or code that you could post..

For test purposes I did a windows project and that works fine
bwe_d1.Service abc = new WindowsApplication1.ibk.bwe_d1.Service();
abc.Credentials = System.Net.CredentialCache.DefaultCredentials;
bwe_d1.Task[] ab = abc.WSGetPendingTasks();

can i do something like this on BB application script.
Offline  
Old 11-05-2007, 09:50 AM   #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

Hi MetDox,

Yeah if the credentials across the network are giving you issues a really simple solution is to save the WSDL file for the webserive locally and then browse to that saved file when adding your web reference. Just make sure you browse to the Service of the web reference in the solution explorer and set the target URL of the webservice to point to your network location of the web service.

Yeah there is a very similar syntax in the BB JavaScript... best way to see the exact syntax is to open up one of the samples that came with the tool.

Go to your start menu and go to "Start -> Programs -> Reasearch In Motion -> BlackBerry Plug-in for Microsoft Visual Studio -> Sample Browser"

A good really simple example in there for what you are trying to do is the Form Submit sample. If you look at the code that is called under the submit button you will see the syntax.

It is a little different in JavaScript as you create an instance of the web reference and the Service is a property of it.. The code should look something like:

var myService = new localhost().MyServiceName;
myService.doMyMethodAsync(param1, param2);
Offline  
Old 11-05-2007, 09:59 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: Cingular
Posts: 23
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks brcewane, I have been looking those samples for a while, those samples inspired me, cant believe i did not see that, this is important for me to work so POC gets approve from upper management. Lemme check those again and i let you all know the outcome.
Offline  
Old 11-05-2007, 10:08 AM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: Cingular
Posts: 23
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Upps,, I just got excited i quess, As i have said i have been looking at this samples and This sample also worked on my local app and local web service. Once i have put this guy on network and machine that running the webservice requires NT authentication, Web script calls fail on black berry application. Any other thought
Well I got some response from black berry support lemme go thru those..
they are talking about suppling username and password for the web service so everone use that userid and password other is MDS runtime you have mentioned. can you enlighteen me about that please if you have any code or steps.
Thanks
Offline  
Old 11-05-2007, 10:33 AM   #7 (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

What is the script error that you are getting? Can you post it here?

It may not be the authentication that is failing the URL for your webservice, it may just be a wrong address.

In your solution explorer expand your web reference that you have added. Select the Service node that will be under your web reference. If you look in your Properties window you will see the "Implementation URL" and a username and password.

The Implementation URL is the actual URL where the webservice is located.. in a .NET web service it would be the asmx file. You will also see that you can specify a username and password here.

If you supply these you will be able to have the challenge response auto answered by the provide username and password.
Offline  
Old 11-05-2007, 11:16 AM   #8 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 7100T
PIN: N/A
Carrier: Cingular
Posts: 23
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

As I mentione Before, I have changed the web Service addresses on wsdl and xsd files to webservice that sits on Network. Application Builds fine and I push the application to local mds fine.
From browse the simulator and find my App icon and execute it.

Woow, I get different Error this time,
"An error accured Server was unable to process this request Unable to connect to server EJECTServername.amr.win.ml.com port 5252 connection failed 10061"

Good thingy was i saw the pop on simulator to enter userid, domain, passwd
what could be causing this, Windows app works fine... do i need some configuration on MDS ?
Offline  
Old 11-05-2007, 08:31 PM   #9 (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

Any chance that the website is using SSL?? I know that there is an issue with the bundled MDS where you have to install a client certificate on it so that it will work with HTTPS.

Also, is your LAN using a proxy server?? if it is you have to configure your MDS development server for the proxy as well.
Offline  
Old 11-14-2007, 12:18 PM   #10 (permalink)
cbm
New Member
 
Join Date: Nov 2007
Model: 8700
PIN: N/A
Carrier: Rodgers
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the same problem using the Visual Studio plug in when pushing data from a web service to the MDS server. I was able to prevent the error by setting the blackberry reference proxy's Credentials like this (C#):

bb.Credentials = new System.Net.NetworkCredential(usr,pswd);

Where bb. is the blackberry proxy object and usr and pswd are "admin" and "admin" You can configure the development server by navigating to the mds server's default location at http://localhost:17080/mds/admin/main.jsp and logging in with "admin" and "admin"

I also set the proxy's url like this:

bb.Url = "http://localhost:17090/mds/PushListener";

I guess at implementation time I'll set up a real user name and password on mds server and read the values from an AppSettings key in the web service's web.config file like this:

string pswd = ConfigurationManager.AppSettings["Password"];

Where "Password" is the name I give the key

Hope this helps. It has caused me a lot of stress
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.