The type or namespace name 'RateWebServiceClient' could not be found

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rrocket
    New Member
    • Aug 2007
    • 116

    The type or namespace name 'RateWebServiceClient' could not be found

    The entire error is "CS0246: The type or namespace name 'RateWebService Client' could not be found (are you missing a using directive or an assembly reference?)"

    I am trying to access a web reference and cannot figure out why I am giving the above error. When I type the "using RateWebServiceC lient...." the intellisense shows the "RateServiceWeb Reference" so it has to know that it is there, but keeps throwing me an error.

    Here is the code:
    [code=C#]
    using System.Data;
    using System.Configur ation;
    using System.Collecti ons;
    using System.Web;
    using System.Web.Secu rity;
    using System.Web.UI;
    using System.Web.UI.W ebControls;
    using System.Web.UI.W ebControls.WebP arts;
    using System.Web.UI.H tmlControls;
    using RateWebServiceC lient.RateServi ceWebReference;
    using System.Web.Serv ices.Protocols;

    //namespace RateWebServiceC lient
    //{
    public partial class FedExSPS_FedEx_ Package_Letter : System.Web.UI.P age
    {
    protected void Page_Load(objec t sender, EventArgs e)
    {
    RateRequest request = CreateRateReque st();
    RateService rateService = new RateService();

    ShowRateReply(r eply);
    }

    private static void ShowRateReply(R ateReply reply)
    {
    lblFedExRespons e.Text = "RateReply details:<br/>";

    //Console.WriteLi ne("RateReply details:");
    foreach (RateReplyDetai l rateDetail in reply.RateReply Details)
    {
    lblFedExRespons e.Text += "ServiceTyp e : " + rateDetail.Serv iceType + "<br/>";
    lblFedExRespons e.Text += "************** *************** *************** **************< br/>";
    foreach (RatedShipmentD etail shipmentDetail in rateDetail.Rate dShipmentDetail s)
    {
    lblFedExRespons e.Text += "RateType : " + shipmentDetail. ShipmentRateDet ail.RateType + "<br/>";
    }
    }
    }
    }
    [/code]
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    You have the following lines commented out in your code example
    //namespace RateWebServiceC lient
    //{

    If this is not a typo remove the comments and build your project again.

    Nathan

    Comment

    • rrocket
      New Member
      • Aug 2007
      • 116

      #3
      Thanks for the resonse...

      With or without it commented out it pretty much gives me the same error with a different error number.

      Here is the exact error I get when the namespace stuff is uncommented.
      CS0234: The type or namespace name 'RateServiceWeb Reference' does not exist in the namespace 'RateWebService Client' (are you missing an assembly reference?)

      If it helps I am trying to implement some class files and WSDL from FedEx to run rates on a webpage.

      Comment

      • tlhintoq
        Recognized Expert Specialist
        • Mar 2008
        • 3532

        #4
        That's not the same error at all.

        With the namespace declaration commented out you get an error saying there is no such namespace as 'RateWebService Client'. Which is true. If you comment out the namespace declaration, then the namespace doesn't exist.

        With the namespace UNcommented, and thus it does exist, the compiler continues to the next error which is
        'RateServiceWeb Reference' does not exist in the namespace 'RateWebService Client'

        You have a using statement above the creation of your namespace that says...
        using RateWebServiceC lient.RateServi ceWebReference;

        But no where in your namespace of RateWebServiceC lient do I see a definition for "RateServiceWeb Reference"

        There is only one class of "FedExSPS_FedEx _Package_Letter "
        with two methods.

        So the error that there is no "RateSeviceWebR eference" inside "RateWebService Client" is correct.

        Comment

        • rrocket
          New Member
          • Aug 2007
          • 116

          #5
          I followed what you posted for the most part, but am not sure what I need to do to fix it... Any ideas would be much appreciated.

          I am the code I am trying to reference in the using is in a .cs file in App_Code. The file is directly from FedEx and huge so I attached it in case you need to check it out.
          Attached Files
          Last edited by rrocket; Nov 10 '08, 02:43 PM. Reason: Added more info...

          Comment

          • tlhintoq
            Recognized Expert Specialist
            • Mar 2008
            • 3532

            #6
            Originally posted by rrocket
            I followed what you posted for the most part, but am not sure what I need to do to fix it... Any ideas would be much appreciated.

            I am the code I am trying to reference in the using is in a .cs file in App_Code. The file is directly from FedEx and huge so I attached it in case you need to check it out.
            From what I can see the References.cs file really does have a namespace that you seem to be referencing:
            RateWebServiceC lient.RateServi ceWebReference

            But since you are getting an error that says this Namespace doesn't exist I can only think that you haven't properly added this file to your project, or to your project's references. When you browse the Class View pallet for your project you should be able to navigate all the way down to all the methods in this References.cs file. Are you seeing all of them, or just the ones you've created as part of the RateWebServiceC lient namespace?

            If you're not seeing the RateServiceWebR eference or its method, then this file hasn't been added properly, or added to the references for the project properly.

            Comment

            • rrocket
              New Member
              • Aug 2007
              • 116

              #7
              I am not sure what the deal was, but after putting it on the live site it started to work fine. Thanks for the info.

              Now that the rating portion is now working I am have nothing much issues getting the Shipment Creation portion to work. I am getting a similar error (CS0246: The type or namespace name 'ShipServiceWeb Reference' could not be found (are you missing a using directive or an assembly reference?)), but I have it done the same way the rating portion is done with the reference.cs files in the App_WebReferenc es folder.

              If anyone has experience with the FedEx API/WSDL I would greatly appreciate a few hints.

              Comment

              • Matthewmass
                New Member
                • Sep 2009
                • 1

                #8
                Fed Ex Fun

                Rocket I am woking with the FexexClient too... (OH MY GOD IS IT FUN BLAHHHHH) I am getting an error Error 23 The type or namespace name 'ProcessShipmen tRequest' could not be found (are you missing a using directive or an assembly reference?) . How did you get past this error?

                Comment

                Working...