Forums

Connect to a webservice on Windows 7 PC/SERVER via suds

In an attempt to interface with a webservice on a Windows 7 server I have started writing the following:-

#!/usr/bin/python
import time
from suds.client import Client
url = "http://192.168.0.10//CISWebService/Mediamanager.asmx?WSDL"
client = Client(url)
print client
result = client.service[1].GetSequenceNo("CIS")
print client

and I execute it via

./DevitSoap2.py > test.txt

on my Ubuntu 13.04 laptop in return I get

Suds ( https://fedorahosted.org/suds/ )  version: 0.4.1 (beta) build: R703-20101015

Service ( MediaManager ) tns="http://tempuri.org/"
   Prefixes (1)
      ns0 = "http://tempuri.org/"
   Ports (2):
      (MediaManagerSoap)
         Methods (10):
            GetConfig()
            GetMediaList(xs:string strTerminalname, )
            GetMediaListAll(xs:string strTerminalname, )
            GetRouterXml(xs:string xml, ArrayOfString ips, )
            GetSequenceNo(xs:string strTerminalname, )
            GetSoundList(xs:string strTerminalname, )
            GetTerminalDataXML(xs:string strTerminalname, )
            GetTerminalSoundXML(xs:string strTerminalname, )
            SetSequenceNo(xs:string strTerminalname, )
            UpdateClientMediaLogTime(ArrayOfClientMediaLogTime lsLogs, )
         Types (4):
            ArrayOfClientMediaLogTime
            ArrayOfString
            ClientMediaLogTime
            SequenceNoInfo
      (MediaManagerSoap12)
         Methods (10):
            GetConfig()
            GetMediaList(xs:string strTerminalname, )
            GetMediaListAll(xs:string strTerminalname, )
            GetRouterXml(xs:string xml, ArrayOfString ips, )
            GetSequenceNo(xs:string strTerminalname, )
            GetSoundList(xs:string strTerminalname, )
            GetTerminalDataXML(xs:string strTerminalname, )
            GetTerminalSoundXML(xs:string strTerminalname, )
            SetSequenceNo(xs:string strTerminalname, )
            UpdateClientMediaLogTime(ArrayOfClientMediaLogTime lsLogs, )
         Types (4):
            ArrayOfClientMediaLogTime
            ArrayOfString
            ClientMediaLogTime
            SequenceNoInfo

Suds ( https://fedorahosted.org/suds/ )  version: 0.4.1 (beta) build: R703-20101015

Service ( MediaManager ) tns="http://tempuri.org/"
   Prefixes (1)
      ns0 = "http://tempuri.org/"
   Ports (2):
      (MediaManagerSoap)
         Methods (10):
            GetConfig()
            GetMediaList(xs:string strTerminalname, )
            GetMediaListAll(xs:string strTerminalname, )
            GetRouterXml(xs:string xml, ArrayOfString ips, )
            GetSequenceNo(xs:string strTerminalname, )
            GetSoundList(xs:string strTerminalname, )
            GetTerminalDataXML(xs:string strTerminalname, )
            GetTerminalSoundXML(xs:string strTerminalname, )
            SetSequenceNo(xs:string strTerminalname, )
            UpdateClientMediaLogTime(ArrayOfClientMediaLogTime lsLogs, )
         Types (4):
            ArrayOfClientMediaLogTime
            ArrayOfString
            ClientMediaLogTime
            SequenceNoInfo
      (MediaManagerSoap12)
         Methods (10):
            GetConfig()
            GetMediaList(xs:string strTerminalname, )
            GetMediaListAll(xs:string strTerminalname, )
            GetRouterXml(xs:string xml, ArrayOfString ips, )
            GetSequenceNo(xs:string strTerminalname, )
            GetSoundList(xs:string strTerminalname, )
            GetTerminalDataXML(xs:string strTerminalname, )
            GetTerminalSoundXML(xs:string strTerminalname, )
            SetSequenceNo(xs:string stSuds ( https://fedorahosted.org/suds/ )  version: 0.4.1 (beta)  build: R703-20101015

Service ( MediaManager ) tns="http://tempuri.org/"
   Prefixes (1)
      ns0 = "http://tempuri.org/"
   Ports (2):
      (MediaManagerSoap)
         Methods (10):
            GetConfig()
            GetMediaList(xs:string strTerminalname, )
            GetMediaListAll(xs:string strTerminalname, )
            GetRouterXml(xs:string xml, ArrayOfString ips, )
            GetSequenceNo(xs:string strTerminalname, )
            GetSoundList(xs:string strTerminalname, )
            GetTerminalDataXML(xs:string strTerminalname, )
            GetTerminalSoundXML(xs:string strTerminalname, )
            SetSequenceNo(xs:string strTerminalname, )
            UpdateClientMediaLogTime(ArrayOfClientMediaLogTime lsLogs, )
         Types (4):
            ArrayOfClientMediaLogTime
            ArrayOfString
            ClientMediaLogTime
            SequenceNoInfo
      (MediaManagerSoap12)
         Methods (10):
            GetConfig()
            GetMediaList(xs:string strTerminalname, )
            GetMediaListAll(xs:string strTerminalname, )
            GetRouterXml(xs:string xml, ArrayOfString ips, )
            GetSequenceNo(xs:string strTerminalname, )
            GetSoundList(xs:string strTerminalname, )
            GetTerminalDataXML(xs:string strTerminalname, )
            GetTerminalSoundXML(xs:string strTerminalname, )
            SetSequenceNo(xs:string strTerminalname, )
            UpdateClientMediaLogTime(ArrayOfClientMediaLogTime lsLogs, )
         Types (4):
            ArrayOfClientMediaLogTime
            ArrayOfString
            ClientMediaLogTime
            SequenceNoInfo

now this is all great but my question is how do I call each of these functions with parameters. The call I immediately need to make is to GetSequenceNo() which requires a parameter of "CIS" in my current configuration. How do I do this ?

[Edited by admin: formatting]

It sounds like you're not using PythonAnywhere for this, is that right?

Anyway, it looks like you're already calling GetSequenceNo. Perhaps that second print statement is meant to be

print result

...?