VB.NET - Using FedEx Web Services

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ddieckmann
    New Member
    • Oct 2007
    • 3

    #1

    VB.NET - Using FedEx Web Services

    I am writing an application that will use the FedEx Web Services to validate addresses and determine what services are available for an address.

    I have downloaded the sample code and WSDL files from FedEx.

    I have created references to both WSDL files:
    C:\Sep-WSDLs\AddressVa lidationService _v1.wsdl
    C:\Sep-WSDLs\RateAvail ableServicesSer vice_v2.wsdl

    I have created Imports statements for both references:
    Code:
    Imports System.Web.Services.Protocols
    Imports Validate = FedEx_Tester.WebReference.AddressValidationService
    Imports Rate = FedEx_Tester.WebReference1.RateAvailableServicesService
    'Imports AddressValidationWebServiceClient.AddressValidationWebReference
    'Imports RateAvailableWebServiceClient.RateAvailableServicesWebReference
    
    Public Class Form1
        Dim strKey As String = "MNYPn7v1XXSxlyrs"
        Dim strPassword As String = "JhEK8KXSrKcyuB26VIQIxg9kt"
        Dim strAccount As String = "510087640"
        Dim strMeter As String = "1197029"
    
        Private Sub ValidateAddress()
            txtResult.Text = ""
            ' Build a AddressValidationRequest object
            Dim request As AddressValidationRequest = New AddressValidationRequest()
    Dim request As AddressValidati onRequest , as found in the address validation example from FedEx, complains that "AddressValidat ionRequest is not defined", yet AddressValidati onRequest is found in the AddressValidati onService_v1.ws dl file.

    What am I missing?

    Thanks.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Are you sure you are importing ALL of the required namespaces?

    Comment

    • ddieckmann
      New Member
      • Oct 2007
      • 3

      #3
      Originally posted by Plater
      Are you sure you are importing ALL of the required namespaces?
      I found I was putting too much in my Imports statement.

      Rather than the code in my original message I should have used:
      Code:
      Imports FedEx_Tester.AddressValidationWebReference
      Imports FedEx_Tester.RateAvailableServicesWebReference
      Thanks.

      Comment

      Working...