Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Web service problem - error when binding to datagrid [modified]

Web service problem - error when binding to datagrid [modified]

Scheduled Pinned Locked Moved C#
helpcsharphtmlwpfwcf
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gindi Bar Yahav
    wrote on last edited by
    #1

    Hey, I am programing a program that uses a Web Service to connect between the Server and WinAPP forms. I made the web service and active my IIS 7 (Using vista ultimate), then i enterd into my localost(using IP) and all go ok (check my defined methods and they returned void XML data) But when i combine that web service to WinAPP and them bind data to datagrid i got error:

    System.Net.WebException: ‏‏הבקשה נכשלה עם הודעת השגיאה:

    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a href="%2fUniversityWebServices%2fService.asmx%3fAspxAutoDetectCookieSupport%3d1">here</a>.</h2>
    </body></html>

    --.
    ב- System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
    ב- System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
    ב- WindowsUniversityClient.UniversityWebReference.Service.GetGradesByStudentId(Int32 id) ב- C:\Users\יהב\Desktop\UniversityTestOrgnizer\UniversityTestOrgnizer\WindowsUniversityClient\Web References\UniversityWebReference\Reference.cs:שורה 83
    ב- WindowsUniversityClient.Form1.searchgrades_btn_Click(Object sender, EventArgs e) ב- C:\Users\יהב\Desktop\UniversityTestOrgnizer\UniversityTestOrgnizer\WindowsUniversityClient\Form1.cs:שורה 24

    the code i userd

            UniversityWebReference.Service service = new WindowsUniversityClient.UniversityWebReference.Service();
            try
            {
                this.grades\_dataview.DataSource = service.GetGradesByStudentId(int.Parse(this.studentid\_txtbox.Text));
            }
            catch (FormatException format\_e)
            {
                MessageBox.Show(format\_e.Message, "נוצרה שגיאה במהלך הצגת הנתונים", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch(Exception ee)
            {
                MessageBox.Show(ee.Message, "נוצרה שגיאה במהלך הצגת הנתונים", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
    

    Gindi Bar Yahav - Web & Software defeloper.

    modified on Saturday, June 20, 2009 10:43 AM

    L 1 Reply Last reply
    0
    • G Gindi Bar Yahav

      Hey, I am programing a program that uses a Web Service to connect between the Server and WinAPP forms. I made the web service and active my IIS 7 (Using vista ultimate), then i enterd into my localost(using IP) and all go ok (check my defined methods and they returned void XML data) But when i combine that web service to WinAPP and them bind data to datagrid i got error:

      System.Net.WebException: ‏‏הבקשה נכשלה עם הודעת השגיאה:

      <html><head><title>Object moved</title></head><body>
      <h2>Object moved to <a href="%2fUniversityWebServices%2fService.asmx%3fAspxAutoDetectCookieSupport%3d1">here</a>.</h2>
      </body></html>

      --.
      ב- System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
      ב- System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
      ב- WindowsUniversityClient.UniversityWebReference.Service.GetGradesByStudentId(Int32 id) ב- C:\Users\יהב\Desktop\UniversityTestOrgnizer\UniversityTestOrgnizer\WindowsUniversityClient\Web References\UniversityWebReference\Reference.cs:שורה 83
      ב- WindowsUniversityClient.Form1.searchgrades_btn_Click(Object sender, EventArgs e) ב- C:\Users\יהב\Desktop\UniversityTestOrgnizer\UniversityTestOrgnizer\WindowsUniversityClient\Form1.cs:שורה 24

      the code i userd

              UniversityWebReference.Service service = new WindowsUniversityClient.UniversityWebReference.Service();
              try
              {
                  this.grades\_dataview.DataSource = service.GetGradesByStudentId(int.Parse(this.studentid\_txtbox.Text));
              }
              catch (FormatException format\_e)
              {
                  MessageBox.Show(format\_e.Message, "נוצרה שגיאה במהלך הצגת הנתונים", MessageBoxButtons.OK, MessageBoxIcon.Error);
              }
              catch(Exception ee)
              {
                  MessageBox.Show(ee.Message, "נוצרה שגיאה במהלך הצגת הנתונים", MessageBoxButtons.OK, MessageBoxIcon.Error);
              }
      

      Gindi Bar Yahav - Web & Software defeloper.

      modified on Saturday, June 20, 2009 10:43 AM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hmm, my Hebrew is no so good, but you might try using: int.TryParse() instead of int.Parse(). Also, it is good to use some debug methods for inspecting the SOAP message before and after it is processed. You can do this in debug mode in Visual Studio. Make sure your IO is working correctly. This is the half split, method for finding bugs in SOAP based web services. Then depending on where the problem is manifesting you will know what end point is responsible for the problem.

      G 1 Reply Last reply
      0
      • L Lost User

        Hmm, my Hebrew is no so good, but you might try using: int.TryParse() instead of int.Parse(). Also, it is good to use some debug methods for inspecting the SOAP message before and after it is processed. You can do this in debug mode in Visual Studio. Make sure your IO is working correctly. This is the half split, method for finding bugs in SOAP based web services. Then depending on where the problem is manifesting you will know what end point is responsible for the problem.

        G Offline
        G Offline
        Gindi Bar Yahav
        wrote on last edited by
        #3

        Sorry about the hebrew... :$ Isolved the problem i enterd in the windows form into app.config and them edit

        <setting name="WindowsUniversityClient_UniversityWebReference_Service"
        serializeAs="String">
        <value>http://192.168.111.1/UniversityWebServices/Service.asmx</value>
        </setting>

        To:

        <setting name="WindowsUniversityClient_UniversityWebReference_Service"
        serializeAs="String">
        <value>http://192.168.111.1/UniversityWebServices/Service.asmx?AspxAutoDetectCookieSupport=1</value>
        </setting>

        Now, when he hav AspxAutoDectateCoolieSupport it gives me the results :D Thanks for your help!, Yahav.

        Gindi Bar Yahav - Web & Software developer.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups