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

  • Home
  • SEARCH
  • 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 3781600
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:57:53+00:00 2026-05-19T10:57:53+00:00

I am learning asp.net, and trying to understand in consuming a webservice. I am

  • 0

I am learning asp.net, and trying to understand in consuming a webservice. I am using the following wsdl file

http://www.webservicex.net/uszip.asmx?WSDL

I am using a textbox to enter the zipcode, added the wsdl in the web reference , and am using C# to retrieve data. The structure of the data is as follows:

http://www.webservicex.net/uszip.asmx/GetInfoByZIP

I am not able to understand on how to display the results on a webpage. The following code is what I have until now..

protected void Button1_Click(object sender, EventArgs e)
{
    USZip s1 = new USZip();
    var input = zipcode.Text.ToString();
    String result = s1.GetInfoByZIP(input);

}

It would be great if anyone can give me helpful pointers

Thanks a lot

  • 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-19T10:57:53+00:00Added an answer on May 19, 2026 at 10:57 am

    Hover over the call to GetInfoByZIP and you should see that it returns an XmlNode. Since there is no implicit conversion from an XmlNode to a string, then you should not be able to assign the result directly to a string. To get the string value, call the XmlNode property OuterXml, like so (make sure you have a multi-line text control):

    XmlNode result = s1.GetInfoByZIP(input);    
    YourTextControl.Text = result.OuterXml;
    

    Per the WSDL, the call returns a GetInfoByZipResult, which can contain any XML (with no further specification in the WSDL). The XML I get looks like the XML below. So, if you want to get to the name of the City, State, etc., you will need to parse the XML.

    <NewDataSet xmlns="">
      <Table>
        <CITY>Glendale</CITY> 
        <STATE>CA</STATE> 
        <ZIP>91210</ZIP> 
        <AREA_CODE>818</AREA_CODE> 
        <TIME_ZONE>P</TIME_ZONE> 
      </Table>
    </NewDataSet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just learning ASP.NET c# and trying to incorporate best practices into my
I am playing with learning ASP.NET MVC as a non-web developer. I am trying
I am currently learning asp.net MVC2. I was trying to do a simple project
I've been learning the ASP.NET MVC framework using the Apress book Pro ASP.NET MVC
Learning how to do a master page in asp.net. Trying to figure out how
I've been learning asp.net mvc 3. So, basically I'm trying to create a new
I'm just learning asp.net mvc and I'm trying to figure out how to move
I'm learning ASP.NET MVC 3 and trying to create a View with a single
I am learning ASP.Net and I am trying to use OutputCache - varybycontrol based
Have been learning ASP.NET (using C#) over the past few days. I have made

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.