Idan Lahat
Idan Lahat

Reputation: 93

UPS API .net not resolve namespace TrackWSSample.TrackWebReference

I am trying to write a simple web form in .net that checks UPS tracking status.

I downloaded the API and example from UPS< I was able to run the example and get response.

The issue is that the example is written as a console C# program and not as a web page, so I created a new web site, and copied the code. I added the WSDL, but i am still receiving: "The type or namespace name 'TrackWebReference' does not exist in the namespace 'TrackWSSample' (are you missing an assembly reference?)"

I cant find any info about how to import this namespace, and I cant find anything in the example that give me a clue.

code

Upvotes: 2

Views: 1774

Answers (1)

Hao Nguyen
Hao Nguyen

Reputation: 536

The error was caused by wrong Web Reference Url that points to the Track.wsdl file. You need to update the path to the right file and update the Web Reference in Visual Studio.

To update the path for the web reference URL, do these steps:

  • From Solution Explorer, select Web References --> TrackWebReference
  • Look at Properties tables, Web Reference URL, it should be "C:\arun_UPS\UPS\codeworkspace\DodgeTrackSchema\Track.wsdl". Change this path to your local Track.wsdl file. You can find this file in the CodeSamples\Track\Dotnet\TrackWSSample\TrackWSSample\Web Reference folder.
  • Finally, regenerate the Reference.cs file by right click on the TrackWebReference again on Solutions Explorer, and select Update Web Reference.

Now you should have your problem resolved.

Upvotes: 8

Related Questions