Jump to content

Consume WSDL


Recommended Posts

I need to consume a web service with a complex data type. Here are the relevant lines in the C class structure. I need to re-create the EZInmate object and populate it with data in Autoit:

namespace WebServiceCall.SyncService {
    using System.Runtime.Serialization;
    using System;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="EZInmate", Namespace="https://service.ezcardandkiosk.com")]
    [System.SerializableAttribute()]
    public partial class EZInmate : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
        
        [System.NonSerializedAttribute()]
        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string Address1Field;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string Address2Field;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private decimal BailAmountField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string BookingNumField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string CellPhoneField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string CityField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private System.DateTime DOBField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private decimal DebtField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string EmailField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string FacilityNameField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string FirstNameField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string HomePhoneField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private int JailIdField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string LastNameField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string MiddleInitialField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string NameNumField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string RaceField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string SSNField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string SexField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string StateField;
        
        [System.Runtime.Serialization.OptionalFieldAttribute()]
        private string ZipField;

Would someone please help me create a structure I can build in autoit to send to the web service?

Also - does anyone have the thought of writing a utility to consume web services and create autoit code to ease this process? There are some available for other languages - but way above my level of experience to do.

Link to comment
Share on other sites

Why do you want this done in AutoIt? I am sure it can be done but I am not sure AutoIt is the best tool. You may want introduce a third party program like SoapUI which has data sources and data sinks. Also uses Groovy which can do just about anything.

If you really want to do it in AutoIt, you have will have to construct your requests and responses based on the WSDL. Functions that come to mind are _IEDocWriteHTML and _IEDocReadHTML except you will have to send a Soap envelope instead of HTML. You can search the Example scripts to see if anyone else has attempted this.

Hope that helps.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Link to comment
Share on other sites

Thanks for your reply. I have used simple web services in the past. The problem with this web service is that one of the parameters expects an array of objects. The C code I have provided is the result of a utility that reads the web service and creates code (and ultimately a dll) to help the user develop programs that consume the web service. So, they just update with object.variable=value, attach the object an array, and send the array to the web service function using the MSSOAP object.

It seems I need to be able to create a structure similar to that structure before I can send data to the service function.

Any help would be appreciated. I just don't know enough about DLLStructCreate.

@ptrex: I had studied the example you referenced which moved me forward in other areas.

@bo8ster: I want to create it in AutoIt because I am so close to this working and I do a lot of little projects, for work, in Autoit! I work to retrieve data from a records management system to provide to vendors and interface systems, as needed, using scheduled tasks. This is the first Web Service that has expected an object as a parameter.

Link to comment
Share on other sites

The help file has some good examples for DLLStructCreate - if you post your attempt and say what is going wrong we can go from there. If you can post the API that would really help too.

AutoIt can handle objects but I have not dealt with it much. I suggest you have a search to see how others have worked with them. I sounds like what you want to do is possible, its just a matter of putting all the pieces together.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...