UPS Web Service

  • Thread starter Thread starter Looch
  • Start date Start date
L

Looch

Hi All,

I'm getting this error:

Server was unable to process request. --> Object reference not set to
an instance of an object.


When using this code

{
UPSWebService.ups.UPSTracking track = new
UPSWebService.ups.UPSTracking();
txtResponse.Text = track.TrackingInfo("1Z385....").ToString ();
}


If I go to the actual web service URL (http://glkev.webs.innerhost.com/
glkev_ws/UPSTracking.asmx) and try to test it, I get an HTTP 500
message.

Is that what the error in C# Express is about or am I really not
creating a track object above?

Thanks for any insight.
 
The first level of debugging is to remove and then re-add the (web) service,
in case the contract has changed.

Remember, there is a (background) proxy which you code against, which DotNet
adds for you very nice like when you add the web/reference.

UPSWebService.ups.UPSTracking is a local (proxy) object.
 
Looch said:
{
UPSWebService.ups.UPSTracking track = new
UPSWebService.ups.UPSTracking();
txtResponse.Text = track.TrackingInfo("1Z385....").ToString ();
}


If I go to the actual web service URL (http://glkev.webs.innerhost.com/
glkev_ws/UPSTracking.asmx) and try to test it, I get an HTTP 500
message.

Is that what the error in C# Express is about or am I really not
creating a track object above?

did you check if track.TrackingInfo("1Z385....") returns something not null?
string trackingInfo = track.TrackingInfo("1Z385....");
if (string.IsNullOrEmpty(trackingInfo))
{
txtResponse.Text = trackingInfo;
}
else
{
txtResponse.Text = "No info for that ID"
}
 
Thanks for the response. I looked at the actual SOAP response message
and found that the error seems to have originated at the UPS server.
I'm fairly sure its a valid tracking number so maybe UPS is on the
fritz eh:)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top