views:

114

answers:

3

A bit long, but, shorter than the first draft :)

We have a small VB.net application that basically pulls information from our dBase and then exports this information to an .xls file. From this .xls file, in house agents then manually update a third party listing service (which maintains our current inventory) with the information contained within. The information is very basic, consisting of, for ease of discussion, a 'Part Number', a 'Description' and a 'Quantity On Hand.'

Normally we update this information once a week, but, a newly revised contract with this listing service now requires a daily update to maintain our 'platinum' vendor status.

The problem is that it can take quite some time to manually update this information. Therefore, an automated process is in dire need. And I have finished most of the ground-work and coding - up to a point. Hence the question, and hence where I get stuck.

The listing service has provided us with the following WSDL's: One for Increasing our Inventory, one for Decreasing our inventory, one for Adding inventory and one for Removing Inventory.

Up to this point, I have re-programmed a Stored Procedure that was generating the exported information. this SP now does some internal math to figure out if a transaction result occurring on 'yesterday' was an 'Increase', a 'Decrease', an 'Add' or a 'Remove.' These results are then added to a result table under a newly created column named 'SERVICE.' This new information is then pulled from the dBase with vb.net and imported into a Data Table for analysis.

With this Data Table, I can now loop through each row, looking in the column 'SERVICE' and depending on the information contained in that cell, call the appropriate web service.

I have added all the web references to my project and created the Proxy classes for each web service.

Second problem is, I have no idea how to actually call the actual web service. The following is a small snippet of the code

' loads data into the 'AviationDataBaseResult.ILS_ARRAY_2' table. 
Me.ILS_ARRAY_2TableAdapter.Fill(Me.AviationDataBaseResult.ILS_ARRAY_2)

' Start the looping process
For Looper = 0 To RowCount - 1 
    If Me.AviationDataBaseResult.ILS_ARRAY_2.Rows(Looper).Item("Service") = _
        "Increase" Then
        ' Call Appropriate Web service
    End If
' More If..Then's ensue, one for each service
Next

' More code ensues

I realize that this has become quite long winded, mostly because on any given day I have 25 FF tabs open and none of them agreeing with each other. To add another wrinkle; the WSDL's in question use a lot of complex types within complex types with, you guessed it, other complex types entwined. I have looked over many examples, and have yet to find one that deals with complex types and how to handle them. Any help on pointing me in the right direction on 'where to go to find what I need to know' is greatly appreciated.

If any other information is required, I'd be more than happy to provide you with as much as I can. If my thought process and logic is ill-suited to do what I need to do, I'm more than happy to hear that as well. Being relatively new to vb.net, I have become quite adept at consuming humble-pie.

Thanks for your time.

A: 

If you have imported the WSDL and generated the proxies, it just becomes a matter of instantiating the proxy (you should see a new namespace which you were prompted for when you generated the proxy) and then calling the methods.

You are going to have to perform mapping between your data and the types that the web service expects, and while tedious, shouldn't be difficult at all.

casperOne
A: 

I'd have to see the actual WSDLs to know specifically how to call these services. However, in general, if you named the Web Reference "WebRef", and if the service is called "Service", and if the operation is "Operation", then you would do the following:

Using svc As New WebRef.Service
    Dim parameter As New ComplexType
    parameter.Property1 = value1
    parameter.Property2 = New Property2Type
    parameter.Property2.SubProperty1 = value12
    ' ...
    svc.Operation(parameter)
End Using
John Saunders
A: 

Thanks for your help guys. Much appreciated. Some day I hope can return the favor.

Cheers,

Jasoomian

Jasoomian