locked
Webservice call Failure--SOAPHeader exception unhandled error - java.lang.Nullpointer Exception RRS feed

  • Question

  • Hi
    I am new to windodws mobile, c# and web service. And I am currently devleoping a mobile app in C#. I try to call a web service from a button click, the code I wrote is based on looking at wsdl. The following is my code for the button click:

    private void btnCalculate_Click(object sender, EventArgs e)
    {
    ServicePointManager.CertificatePolicy = new MyPolicy();
    eclipse.HealthExpensesService ws = new HealthExpenses.eclipse.HealthExpensesService();
    ws.Url = URL_OF_WSDL;
    eclipse.GrossReliefDueRequest request = new eclipse.GrossReliefDueRequest();
    request.Claim = new eclipse.HealthExpensesClaim();
    request.Claim.medicalExpenses = Convert.ToInt32(lblMedicalAmount.Text);
    request.Claim.dentalExpenses = Convert.ToInt32(lblDentalAmount.Text);
    request.Claim.nursingHomeFees = Convert.ToInt32(lblNursingAmount.Text);
    request.Claim.nameNursingHome1 = "NursingHome1";
    request.Claim.nameNursingHome2 = "NursingHome2";
    request.Claim.amountReceivedUnderInsurance = 200;
    request.Claim.amountReceivedUnderInsuranceNursingFees = 300;
    request.Claim.psnOfPersonInNursingHome = "xxxxxxx";
    request.lang =eclipse.langType.EN ;
    request.clientId = "0";
    request.year = Convert.ToInt32(lblYear.Text);
    eclipse.GrossReliefDueResponse response = new eclipse.GrossReliefDueResponse();
    response.grossReliefDue =Convert .ToInt32 ( ws.GrossReliefDue(request));
    lblGrossRelief.Text = response .grossReliefDue .ToString ();
    lblGrossRelief.Visible = true;
    btnCalculate.Visible = false;
    }

    After clicking the button, I get error message: SOAPHeader exception unhandled error - java.lang.Nullpointer Exception.
    Anyone please tell me what is wrong in my code? I have more details if needed!
    Thanks a lot for help
    Jane

    Wednesday, January 13, 2010 9:32 AM

All replies

  • Hi,

    Is the web service written in Java?

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Wednesday, January 13, 2010 9:35 AM
  • Hi Paul,

    Here's me again, with the question of problem deploying application onto real device. Thanks a lot for  trying to help so much!
    I think so, the web service is written in Java, and my application, as you might know already, is written in C#, with MVC model.
    This error has got me stuck for a whole week, and I tried various ways in codes, and it still crashes so far with the above error.
    Please help if you can
    Jane
    Wednesday, January 13, 2010 9:43 AM
  • Hi,

    Does the same problem occur if you use the code in a Windows client application?

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Wednesday, January 13, 2010 9:45 AM
  • I don't quite understand your question, the application I am developing is a windows client application?!!
    Thanks
    Jane

    Wednesday, January 13, 2010 9:48 AM
  • Hi,

    By Windows client, I mean an application targetting the Full .NET Framework, not the Compact Framework.

    Thanks

    Paul Diston
    http://www.smartmobiledevice.co.uk/
    Wednesday, January 13, 2010 10:54 AM
  • Hello Sir,

     

    I need a help from u can u give solution

     

    i called a java webserive from .net client (mobile application )  . how can i pass the soap header to this javawebservice . After clicking the button, I get error message: SOAPHeader exception unhandled error - java.lang.Nullpointer Exception.

    Tuesday, March 30, 2010 3:57 AM