ShelbySue Posted March 25, 2010 Share Posted March 25, 2010 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: expandcollapse popupnamespace 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 More sharing options...
bo8ster Posted March 25, 2010 Share Posted March 25, 2010 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 More sharing options...
ptrex Posted March 26, 2010 Share Posted March 26, 2010 @ShelbySue A Web Service is consumed by a SOAP client for instance. see here http://www.autoitscript.com/forum/index.php?showtopic=45904&st=0#entry342453 The example in there can get you started. rgds, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
ShelbySue Posted March 26, 2010 Author Share Posted March 26, 2010 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 More sharing options...
bo8ster Posted March 28, 2010 Share Posted March 28, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now