Discussion:
Problems Calling Web Services in VS 2008
(too old to reply)
Donald
2008-10-12 02:56:00 UTC
Permalink
Hi all,

This might seem like a newbie question, but I am stuck with Web Services in
VS 2008. I have 2 problems:
1) I am not able to provide my UID/password credentials when I call the
remote web service
2) I can’t get my Web Services Client code to look like the
documentation’s example code

Here is the background:
I am trying to call the services at
http://staging.mappoint.net/standard-30/mappoint.wsdl
In VS 2008, I add a Services Reference into my VB project and I am able to
reference it in call it.

I have Problem #1 because when I call the web service I get the following
error message:
The HTTP request is unauthorized with client authentication scheme
'Anonymous'. The authentication header received from the server was 'Digest
qop="auth", realm="MapPoint",
nonce="a17e71846cb67ac73650773221001af264661b46f929b4eca744e3adcd37"'.

This MSDN page http://msdn.microsoft.com/en-us/library/cc514450.aspx says I
should write this code
' Initialize the credentials of the find service
' Use your customer ID and password for the UserID and Password parameters
Dim findService As New FindServiceSoap()
findService.Credentials = New System.Net.NetworkCredential("UserID",
"Password")
findService.PreAuthenticate = True

I’ve tried that code, but I get a compile error. This brings me to Problem
#2.

In VS 2008 the generated Web Service client code does not look like this.
My generated code has FindServiceSoap being an interface (and you can’t
instantiate an interface). In VS 2008, my project has a
FindServiceSoapClient class which implements the FindServiceSoap interface,
however, the client class does not have a credentials property.

Can someone help me solve Problems #1 & #2?

Thanks in advance,
Donald
Lowell
2008-10-14 21:22:54 UTC
Permalink
Just a note.

I was never really able to solve problem #1 in VS2008 for my test C#
application. What I ended up doing was using my web browser and
pointing it at the web service and then clicking to get the WSDL and
downloading it to my harddrive. After which, I could point VS2008 at
the file on my hard drive to generate the web service proxy classes.

Lowell
Creeple
2008-10-17 23:08:00 UTC
Permalink
When I added the web reference in VS 2008 to the staging URL, I saw an
authentication box and I had to enter my VE credentials just to get the
reference to register. I'm using it and calling the methods without any
issues.

I like to use VB so I do have to convert the C# samples to VB, and VS
doesn't report many of the available methods but it's working nicely.
Continue reading on narkive:
Loading...