locked
Error when updating . RRS feed

  • Question

  • Hi, im doing a bowser application that gets a value from the service and shows it in a textbox, the user can change it and save the value. And it works fine when I’m debugging whit the ASP.NET Development server. But when I use it whit my published service I get this error: Error while processing this request.

    Below is my client code:

    public partial class ConfigurationRF: Page

        {

            private static string dir = ConfigurationManager.AppSettings["dir"];

            private SAAD3_PROYECTO_REXEntities db;

            private OBJETOS sessionTimeOut;

          

     

            public ConfigurationRF()

            {

                InitializeComponent();

                this.db = new SAAD3_PROYECTO_REXEntities(new Uri(dir));

            }

     

            private void loadData()

            {

                this.sessionTimeOut = (from objeto in db.OBJETOS

                                        where objeto.DEFOBJ == "SESSION_TIMEOUT"

                                        select objeto).First();

            }

     

            private void showData()

            {

                this.textBoxSessionTimeOut.Text = this.sessionTimeOut.DEFNOMB.Trim();

            }

     

            private void saveData()

            {

                this.sessionTimeOut.DEFNOMB = this.textBoxSessionTimeOut.Text;

                this.db.UpdateObject(this.sessionTimeOut);

                this.db.SaveChanges();

            }

     

           

            private void buttonSaveData_Click(object sender, RoutedEventArgs e)

            {

                this. saveData ();

            }

     

            private void Page_Loaded(object sender, RoutedEventArgs e)

            {

                this.loadData();

                this.showData();

            }

    Any help is highly appreciated.

    Thanks in advance.

    Friday, July 10, 2009 7:18 PM

Answers

  • Hi,

    Because the Update and Delete client operations translate into the PUT/MERGE and DELETE verbs respectively, its possible that your host is not allowing those verbs through, while the ASP.NET Development Server does.

    You could try intercepting the request/response with a tool like Fiddler to get a better sense of what is going wrong, but my guess it that its the verbs.

    For IIS, you can set the verb permissions on the specific handler for .svc files, but I don't know how to do it for other hosts.
    Matt Meehan, ADO.NET Data Services (Astoria)
    • Marked as answer by Javo0 Monday, July 13, 2009 5:29 PM
    Saturday, July 11, 2009 6:09 AM
    Moderator

All replies

  • I have realized that when im running the application whit my published service the add method works fine, but when I use updateObject or deleteObject, I get the DataServiceRequestException. So it must be a permission problem, but I don’t have any idea how to solve it.

    Friday, July 10, 2009 9:01 PM
  • Hi,

    Because the Update and Delete client operations translate into the PUT/MERGE and DELETE verbs respectively, its possible that your host is not allowing those verbs through, while the ASP.NET Development Server does.

    You could try intercepting the request/response with a tool like Fiddler to get a better sense of what is going wrong, but my guess it that its the verbs.

    For IIS, you can set the verb permissions on the specific handler for .svc files, but I don't know how to do it for other hosts.
    Matt Meehan, ADO.NET Data Services (Astoria)
    • Marked as answer by Javo0 Monday, July 13, 2009 5:29 PM
    Saturday, July 11, 2009 6:09 AM
    Moderator
  • Thank you very much, i set the verb permissions for .svc to all verbs in IIS and it worked fine.

    Thanks again J

    Monday, July 13, 2009 5:30 PM