[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

Stock quote service error message

(Ian Varley)

12/30/2002 8:05:00 PM

I'm trying to use a web service for the first time, to get a stock
symbol. When I run this code (using a web reference from
"com.garsterworks.webservices"):

Stocks s = new Stocks();
Console.WriteLine("Price:" + s.GetLatestQuote("IBM").ToString());

I get this runtime error:

"An unhandled exception of type
'System.Web.Services.Protocols.SoapException' occurred in
system.web.services.dll. Additional information: Server was unable to
process request. --> Object reference not set to an instance of an
object."

The error is thrown from within the Visual-Studio-created Reference.cs
file, when the generated GetLatestQuote function is called. Can
anybody suggest what I might be doing wrong? I tried using a couple
other stock-quote web services with no luck there either.

Thanks!
Ian
4 Answers

Greg Ewing

12/31/2002 7:36:00 AM

0

Ian, are you sure that's not a bug on their side? Your code (all 2 lines of
it ) looks fine. The error sounds like a server side error too.

--
Greg Ewing [MVP]
http://www.clar...

"Ian Varley" <ivarley@spamcop.net> wrote in message
news:b3aaecc.0212301017.2871d3ee@posting.google.com...
> I'm trying to use a web service for the first time, to get a stock
> symbol. When I run this code (using a web reference from
> "com.garsterworks.webservices"):
>
> Stocks s = new Stocks();
> Console.WriteLine("Price:" + s.GetLatestQuote("IBM").ToString());
>
> I get this runtime error:
>
> "An unhandled exception of type
> 'System.Web.Services.Protocols.SoapException' occurred in
> system.web.services.dll. Additional information: Server was unable to
> process request. --> Object reference not set to an instance of an
> object."
>
> The error is thrown from within the Visual-Studio-created Reference.cs
> file, when the generated GetLatestQuote function is called. Can
> anybody suggest what I might be doing wrong? I tried using a couple
> other stock-quote web services with no luck there either.
>
> Thanks!
> Ian


rich

12/31/2002 11:31:00 AM

0

I can't help very much, but I think the Axis stock quote example uses some
simple authentication, you're probably getting a not authorised response.
the last time i looked, you had to do something like wait for the not
authorised response, then reply with the authentication credentials, which
was to do with how an MS client worked, however this may have changed, or
may have been to do with MS Pre .NET SOAP implementation, rather than .NET.
Have a look at the Axis Java client, it sets a user name and password as
part of the call initialisation (ie in Java client you set user/password in
the initial invocation, I don't know if .NET works like this).
the Axis mailing list, see http://xml.apache..., could be your best
bet.



"Greg Ewing <MVP>" <gewing@_NO_SPAM_claritycon.com> wrote in message
news:u1vitbJsCHA.1080@TK2MSFTNGP10...
> Ian, are you sure that's not a bug on their side? Your code (all 2 lines
of
> it ) looks fine. The error sounds like a server side error too.
>
> --
> Greg Ewing [MVP]
> http://www.clar...
>
> "Ian Varley" <ivarley@spamcop.net> wrote in message
> news:b3aaecc.0212301017.2871d3ee@posting.google.com...
> > I'm trying to use a web service for the first time, to get a stock
> > symbol. When I run this code (using a web reference from
> > "com.garsterworks.webservices"):
> >
> > Stocks s = new Stocks();
> > Console.WriteLine("Price:" + s.GetLatestQuote("IBM").ToString());
> >
> > I get this runtime error:
> >
> > "An unhandled exception of type
> > 'System.Web.Services.Protocols.SoapException' occurred in
> > system.web.services.dll. Additional information: Server was unable to
> > process request. --> Object reference not set to an instance of an
> > object."
> >
> > The error is thrown from within the Visual-Studio-created Reference.cs
> > file, when the generated GetLatestQuote function is called. Can
> > anybody suggest what I might be doing wrong? I tried using a couple
> > other stock-quote web services with no luck there either.
> >
> > Thanks!
> > Ian
>
>


rich

12/31/2002 11:39:00 AM

0

beg pudding, i notice you don't mention axis at all, sorry!

"rich" <rpcee@operamail.com> wrote in message
news:eYCgCfLsCHA.1624@TK2MSFTNGP10...
> I can't help very much, but I think the Axis stock quote example uses some
> simple authentication, you're probably getting a not authorised response.
> the last time i looked, you had to do something like wait for the not
> authorised response, then reply with the authentication credentials, which
> was to do with how an MS client worked, however this may have changed, or
> may have been to do with MS Pre .NET SOAP implementation, rather than
.NET.
> Have a look at the Axis Java client, it sets a user name and password as
> part of the call initialisation (ie in Java client you set user/password
in
> the initial invocation, I don't know if .NET works like this).
> the Axis mailing list, see http://xml.apache..., could be your best
> bet.
>
>
>
> "Greg Ewing <MVP>" <gewing@_NO_SPAM_claritycon.com> wrote in message
> news:u1vitbJsCHA.1080@TK2MSFTNGP10...
> > Ian, are you sure that's not a bug on their side? Your code (all 2
lines
> of
> > it ) looks fine. The error sounds like a server side error too.
> >
> > --
> > Greg Ewing [MVP]
> > http://www.clar...
> >
> > "Ian Varley" <ivarley@spamcop.net> wrote in message
> > news:b3aaecc.0212301017.2871d3ee@posting.google.com...
> > > I'm trying to use a web service for the first time, to get a stock
> > > symbol. When I run this code (using a web reference from
> > > "com.garsterworks.webservices"):
> > >
> > > Stocks s = new Stocks();
> > > Console.WriteLine("Price:" + s.GetLatestQuote("IBM").ToString());
> > >
> > > I get this runtime error:
> > >
> > > "An unhandled exception of type
> > > 'System.Web.Services.Protocols.SoapException' occurred in
> > > system.web.services.dll. Additional information: Server was unable to
> > > process request. --> Object reference not set to an instance of an
> > > object."
> > >
> > > The error is thrown from within the Visual-Studio-created Reference.cs
> > > file, when the generated GetLatestQuote function is called. Can
> > > anybody suggest what I might be doing wrong? I tried using a couple
> > > other stock-quote web services with no luck there either.
> > >
> > > Thanks!
> > > Ian
> >
> >
>
>


(Ian Varley)

12/31/2002 4:07:00 PM

0

Greg,

Thanks for your help! I agree about the probability of a server-side
error. After some more searching, I finally found one that seems to
work, via xmethods (found in an MDSN article about pulling it from
within Excel). The working URL has its WSDL file at:

http://services.xmethods.net/soap/urn:xmethods-delayed-q...

The working code is very similar to my original code (although with a
somewhat more wordy object name!):

netxmethodsservicesstockquoteStockQuoteService s =
new netxmethodsservicesstockquoteStockQuoteService();
Console.WriteLine(s.getQuote("IBM").ToString());

I'd be interested to hear if anyone's gotten the garsterworks version
to run, or if there's something else I should be doing (for example,
using Asynch callbacks; and if so, how?)

Thanks again,
Ian

"Greg Ewing <MVP>" <gewing@_NO_SPAM_claritycon.com> wrote in message news:<u1vitbJsCHA.1080@TK2MSFTNGP10>...
> Ian, are you sure that's not a bug on their side? Your code (all 2 lines of
> it ) looks fine. The error sounds like a server side error too.
>
> --
> Greg Ewing [MVP]
> http://www.clar...