Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6179237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:37:17+00:00 2026-05-24T00:37:17+00:00

To use webservice I added a web service reference and then added the following

  • 0

To use webservice I added a web service reference and then added the following code to my MainPage.xaml.cs file.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace WebServiceTest
{
  public partial class MainPage : PhoneApplicationPage
  {
    // Constructor
    public MainPage()
    {
      InitializeComponent();
    }

    private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
    {
      try
      {
        ServiceReference.PDAServiceSoapClient ws = 
          new ServiceReference.PDAServiceSoapClient();
        ws.GetResoureAroudCompleted += 
          new EventHandler<ServiceReference.GetResoureAroudCompletedEventArgs>(ws_GetResoureAroudCompleted);

        ws.GetResoureAroudAsync("基站,机楼", 113, 23, 10000);
      }
      catch
      {
        System.Windows.MessageBox.Show("error!");
      }
    }

    void ws_GetResoureAroudCompleted(object sender, ServiceReference.GetResoureAroudCompletedEventArgs e)
    {
      if (e.Error != null)
      {
        var result = e.Result;
      }
    }
  }
}

Then I ran PhoneApplication and got this exception:

System.InvalidOperationException was unhandled
Message=There was an error reflecting type ‘WebServiceTest.ServiceReference.GetResoureAroudResponseGetResoureAroudResult’.
InnerException: System.InvalidOperationException
Message=There was an error reflecting property ‘Any1’.

in Reference.cs
Code:

public WebServiceTest.ServiceReference.GetResoureAroudResponseGetResoureAroudResult EndGetResoureAroud(System.IAsyncResult result) {
                object[] _args = new object[0];
                **WebServiceTest.ServiceReference.GetResoureAroudResponseGetResoureAroudResult _result = ((WebServiceTest.ServiceReference.GetResoureAroudResponseGetResoureAroudResult)(base.EndInvoke("GetResoureAroud", _args, result)));**
                return _result;
            }

It’s not caught by try-catch, anybody know why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:37:18+00:00Added an answer on May 24, 2026 at 12:37 am

    The exception is not caught by your exception handler because it occurs in the framework and is out of scope. Depending on whether the webservice conforms to best practice, it may surface an Error object and if so you should inspect this prior to attempting to retrieve any data.

    This can produce symptoms similar to yours, but I’m not certain this is the problem you face.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use a web service and thus added a web service reference
In Visual Studio 2010, I have a web service reference added. In the app.config,
I am attempting to consume an intranet web service with WCF. I added reference
Im working on a Web-Application (MyWebApp). I have a Service-Reference to a WCF-Webservice. The
In Visual Studio I just added a web service reference to my Asp.net website,
I often use webservice this way public void CallWebservice() { mywebservice web = new
I'm using Java 6, Tomcat 6, and Metro. I use WebService and WebMethod annotations
I'm developing a web service using NHibernate, WCF and Oracle 11g R1. The web
I'm connecting to a web service hosted by a third-party provider. I've added a
I am trying to use a SOAP Web Service provided by a third party.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.