python - using suds to pull data points through wsdl on Smartserver 2.0 -


The Icon is written by the reader function which pulls the smartserver data point by using the reed function provided by wsdl. Through remote, I can successfully connect to smartserver and print Client WSDL which gives me a list of methods and types. How can I use these methods through suds to draw data? Ive tried to print client.service.list () that should give me a data point in accordance with the programmer documentation of this server, but it gives me a urlopen error [Errno 13] SOAP is used to pull the data but since I am using suds, this code is very streamlined and I only want to do client.service.somemethod (parameter), I've attached my code so far And the list is when I print the client I get it

Thank you very much.

  Import Import suds.client import client suds from suds.clansport.http HttpAuthenticated url = "http: // example / WSDL / v4 .0 / foo.WSDL" client = Client ( url, username = 'foo', password = 'bar') myheaders = dict (userid = 'foo', passwd = 'bar') client.set_options (Sopheders = Mayheders) name = Clientkfactorykcreate ( 'Ns0: E_xSelect ') Print Name of Name [' xSelect '] = "" "// Item [UCPTpointName =" Net / MB485 / Main POWER / Fb / PowerSum "]" "" Print Client Service. Read (name)  

What do I get in the console

  Ports (1): (iLON100httpPort) Methods (8): Clear (NS: Madkol ILonItem,) (ns0: Item_Coll iLonItem,) get (Ns0: Item_Coll ILonItem,) InvokeCmd (Ns0: Item_Coll ILonItem,) list (Ns0: E_x select Read iLonItem,) (ns 0 item cylinder, iLonItem,) set ( Ns0: Item_CfgColl ILonItem,) write (ns0: Item_DataColl iLonItem,)  

instance document code you

  static void main (string [] ARG) {iLON_SoapCal ls.BindClientToSmartServer (); ILON_SmartServer.iLON100portTypeClient SmartServer = iLON_SoapCalls._iLON; // -------------- Try a figure score READING -------------- {// member object iLON_SmartServer.Item_Coll item instantiateColl = new iLON_SmartServer. Item_Coll (); ItemColl.Item = new iLON_SmartServer.Item [1]; ItemColl.Item [0] = new iLON_SmartServer.DP_Data (); // Set the DP Item Name. Cove. ITEM [0] .UCPTname = "Net / LOON / ILOON App / Digital Output 1 / NVI Callahalli" / / Set To Maximum AAP To Obtain Update DP Value If this data is cached for more than 10 seconds on the server was (see section 4.3.4.1 for more information) ((iLON_SmartServer.Dp_Data) (itemColl.Item [0])). Useepitimaksaj = 10; ((ILON_SmartServer.DP_Data) (itemColl.Item [0])). UCPTmaxAgeSpecified = True; // Read Call Forum iLON_SmartServer.Item_DataColl dataColl = SmartServer.Read (itemColl); if (datacoll.Item == faucet) {// Discreet investigation is not the console Write ("no items were returned");} Else if (datacoll.Item [0] .fault! = Null) {// error console.out.creative.lit ("An error occurred." Code = "+ datacol. ITM [0]. Fault. Falcodes +" fault text =% s. "+ Datacol.it [0]. Fault.faultstring);} and {// success console.out.prakeline (" Read successful "); Console.Out.WriteLine (((iLON_SmartServer.Dp_Data) dataColl.Item [0]). UCPTname +" = "+ ((iLON_SmartServer.Dp_Data) dataColl.Item [0]). UCPTvalue [0]. Value + "\ n"); }  

I detected the problem. You have to open the wsdl which you are accessing through an soap in an XML format and you can read the sections named after the wsdl services that specify a location. To successfully communicate with the server, define that location in the client constructor. For some reason this location was not seeing this place in the wsdl file.


Comments