SUNDAY, JULY 20, 2008




MY ACCOUNT LOGIN

LOGIN NAME:

PASSWORD:

REGISTER TODAY!
FORGOT YOUR PASSWORD?
TRY ALL WEB SERVICES
FREE FOR 30 DAYS!

WEB SERVICES

XWEBEMAILVALIDATION [tool]

XWEB1003 [real estate]

XWEBACHDIRECTORY [financial]

XWEBCHECKOUT [ecommerce]

XWEBTD [ecommerce]

XWEBNEWS [content mgmt.]


ANNOUNCEMENTS


OPEN SOURCE ONLINE 1003 SOA SOLUTION VERSION 2.0 RELEASED

XWEB1003 VERSION 2 LAUNCHED

XWEB1003 OFFICIALLY RELEASED

SECTION VI (ASSETS AND LIABILITIES) - REAL ESTATE AND CREDIT PREVIOUSLY RECEIVED

SECTION VI (ASSETS AND LIABILITIES) - LIABILITIES



Web Services, SOA Solutions, SOA Services - XWebServices.com


HOME

WEB SERVICES

SOA SOLUTIONS

SOA SERVICES

ABOUT US





XWEB1003


Documentation


FAQs


Implementation Guides


Forum


Pricing






SEARCH









HOME  ::  WEB SERVICES  ::  XWEB1003  ::  IMPLEMENTATION GUIDES

:: Web Services :: XWeb1003 :: Implementation Guides ::

How-To Display a Mortgage Loan Application

The procedures in this implementation guide require that you have some knowledge of XML and ASP.NET web development with the Microsoft Visual Basic.NET development tool.

***Note: This implementation guide applies to Version 1 of the Web Service.

The steps in this "how-to" implementation guide are:

To download the source code for this "how-to" implementation guide, as well as for additional hints and tips, please read our Final Notes.

Add a "Web Reference" to the XWeb1003 Web Service

  • In your web project, add a Web Reference to the XWeb1003 Web Service. Here are 2 ways you can accomplish this:

    • Browse the Solution Explorer, right click on References and select Add Web Reference... from the drop down menu.
    • From the File Menu, select Project - Add Web Reference....
  • The Add Web Reference pop-up window will open. In the URL textbox, enter the following URI:

    https://ws.xwebservices.com/XWeb1003/XWeb1003.asmx?wsdl

  • Hit the Enter key or click the Go button located to the right of the URL textbox.
  • Change the Web reference name to XWeb1003 for easier reference.
  • Click the Add Reference button to complete this step.

Add a "Web Form" to the Web Application

  • In your web project, add a Web Form. This Web Form will display the details of the Mortgage Loan Application you select from the queue. Here are 2 ways you can accomplish this:

    • Browse the Solution Explorer, right click the name of your project, and select Add - Add Web Form....
    • From the File Menu, select Project - Add Web Form....
  • Change the Name textbox in the Add New Item pop-up provided to application.aspx.

Write code in the "Codebehind" of the web form to retrieve the Mortgage Loan Application record by consuming the XWeb1003 Web Service

Based on the documentation for the XWeb1003 Web Service, in order to successfully consume the Web Service, we will need to authenticate first using SOAP Headers. Here's how:

  • Open the "Codebehind" of the application.aspx web form we added to the web project in the previous step.
  • Since the Web Service requires SOAP Headers for authentication purposes, we must first create a new instance of the class representing the SOAP Header and then populate the SOAP Header values:

    ' handle authentication
    Dim objAuth As New XWeb1003.AuthHeader
    objAuth.LoginName = "<my_login_name>"
    objAuth.Password = "<my_password>"

    NOTE***: Instead of hard-coding the LoginName and Password values, you may want to dynamically read them from the web.config file (LOGIN_NAME and PASSWORD must be added to the <AppSettings> section of the web.config file):

    objAuth.LoginName = System.Configuration.ConfigurationSettings.AppSettings("LOGIN_NAME")
    objAuth.Password = System.Configuration.ConfigurationSettings.AppSettings("PASSWORD")

  • Next, we need to create a new instance of the proxy class and assign the SOAP Header object to the member variable of the proxy class representing the SOAP Header:

    'create the XWeb1003 Web Service proxy
    Dim objApplication As New XWeb1003.XWeb1003
    objApplication.AuthHeaderValue = objAuth

  • We are now ready to call the method on the proxy class that communicates with the Web Service method and returns the Mortgage Loan Application record we want displayed on the web page.

    'the querystring parameter should be in this format "aid=xxx"
    'store the result in a variable
    Dim strApplicationXML As String =
    objApplication.LoadApplication(Request.QueryString("aid"))

Implement ASP.NET Labels to display the Mortgage Loan Application's details

In the Codebehind:

  • Declare as many labels as you need to display the Mortgage Loan Application's details (for this "how-to" guide, we will be only display 3):

    Protected lblPurpose, lblAmount, lblDateCreated As System.Web.UI.WebControls.Label

  • Load the XML string we previously stored in the strApplicationXML variable into an XMLDocument:

    'load an XML DOM with the <Application> xml string returned by the Web Service SOAP Method
    Dim objDOM As New System.Xml.XmlDocument
    objDOM.LoadXml(strApplicationXML)

  • Set the labels' Text property to the corresponding Element or Attribute value:

    lblPurpose.Text =
    objDOM.DocumentElement.SelectSingleNode("Purpose/Type_Description").InnerText
    lblAmount.Text =
    objDOM.DocumentElement.SelectSingleNode("Amount").InnerText
    lblDateCreated.Text =
    objDOM.DocumentElement.Attributes.ItemOf("Date_Created").Value

In the HTML Editor, we simply define the 3 ASP.NET labels. Here is the code:

<asp:Label ID="lblPurpose" Runat="server" />
<asp:Label ID="lblAmount" Runat="server" />
<asp:Label ID="lblDateCreated" Runat="server" />

Final Notes

The source code for this "how-to" implementation guide can be downloaded by clicking the link below (zip file, contains the source code for all "how-to" implementation guides for the XWeb1003 Web Service)

XWeb1003Client.zip

If you do not want to display all the details in individual labels, you can write a recursive function that will display the mortgage loan application's details in a "tree" format.

It's always good practice to implement a Try...Catch... error handling technique to handle some or all possible errors that may occur while the code is executing. We strongly recommend that you implement such a technique.



HOME
WEB SERVICES
SOA SOLUTIONS
SOA SERVICES
MY ACCOUNT
ABOUT US