Results 1 to 2 of 2

Thread: WSDL creating an array and passing to object

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2011
    Posts
    16

    WSDL creating an array and passing to object

    I'm in a one deep position and really coulld use some help with this issue. I'm consuming webservice and this WSDL is driving me nuts.

    Here's the WSDL https://www.estes-express.com/tools/...teService?wsdl

    I'm having a problem creating the FullCommditiesType(), commodity and associated FullCommodityType().

    I want to ship 2 pallets of freight.

    #1
    weight 530
    Class 60
    Description Books

    #2
    weight 245
    Class 65
    Description Magazines

    Below is a screenshot of the reference.vb (svcmap)


    Name:  commodity3.jpg
Views: 293
Size:  49.7 KB

    Here's the code I've tried. It keeps failing at the "With mycommodity.commodity(1)". Says I didnt create the object.
    The freight loads are supposed to be put into an array and passed to the myrequest.item which is an object.

    I can't seem to resolve how to create the array correctly.

    Thanks in advance





    Code:
    		Dim myAuthorize As New wsdl_estes.AuthenticationType
    		Dim myrequest As New wsdl_estes.rateRequest()
    		Dim EstesRates As ratingPortTypeClient = New ratingPortTypeClient
    		Dim pickup As New wsdl_estes.PointType
    		Dim delivery As New wsdl_estes.PointType
    
    		With myAuthorize
    			.user = ("myuser")
    			.password = ("myPWD")
    		End With
    
    		With myrequest
    			.account = ("xxxxxx")
    			.payor = ("S")
    			.terms = ("P")
    		End With
    
    		With pickup
    			.city = ("Knoxville")
    			.stateProvince = ("TN")
    			.postalCode = ("37918")
    			.countryCode = ("USA")
    		End With
    
    		With delivery
    			.city = ("Knoxville")
    			.stateProvince = ("TN")
    			.postalCode = ("37918")
    			.countryCode = ("USA")
    		End With
    
    		myrequest.originPoint = pickup
    		myrequest.destinationPoint = delivery
    
    **** Fails
    		Dim mycommodity As New wsdl_estes.FullCommoditiesType()
    
    		With mycommodity.commodity(1)
    			.class = 60
    			.weight = ("450")
    			.description = "Used Books"
    
    		End With
    
                  myrequest.item = ???? The array holding the commodities
    Attached Images Attached Images  

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Aug 2011
    Posts
    16

    Re: WSDL creating an array and passing to object

    Dim loaddata As New wsdl_estes.FullCommoditiesType
    Dim comList As New List(Of wsdl_estes.FullCommodityType)
    Dim com As wsdl_estes.FullCommodityType

    '1St commodity
    com = New wsdl_estes.FullCommodityType()
    com.class = 60
    com.description = ("Used Books")
    com.weight = ("1680")
    com.pieces = ("1")
    com.pieceType = PackagingType.SK
    com.dimensions = New wsdl_estes.DimensionsType()
    com.dimensions.length = ("42")
    com.dimensions.width = ("42")
    com.dimensions.height = ("36")
    comList.Add(com)

    loaddata.commodity = comList.ToArray()

    myrequest.Item = loaddata

    May thanks Jim for your help

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width