def _integration_test_send_request_GetRequestedData():
    host = 'www.dev1.eraserver.net'
    post = '/RCKCONTROLS/RCKData.asmx'
    action_server = 'http://RCKServices.com/'
    action = 'GetRequestedData'
    list = []
    list.append([['Name', 'Differential Pressure 1'], ['Type', 'analog']])
    list.append([['Name', 'Differential Pressure 3'], ['Type', 'analog']])
    request = build_point_request(list)
    print request
    envelope_start = """<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <""" + action + ' xmlns="' + action_server + '" >'
    envelope_end = """
        </""" + action + """>
      </soap:Body>
    </soap:Envelope>
    """
    r = suds.send_request(host, post, action_server + action,
                          envelope_start + request + envelope_end)
    print r
    rsp = parse_response(r)
    print rsp
    return rsp
Beispiel #2
0
    def test_case_build_point_request(self):
        list = []
        list.append([['Name','Differential Pressure 1'], ['Type','analog']])
        list.append([['Name','Differential Pressure 3'], ['Type','analog']])
        x = build_point_request(list)
        s = """
<Request>
  <DataRequest>
    <Request>
      <Name>Differential Pressure 1</Name>
      <Type>analog</Type>
    </Request>
    <Request>
      <Name>Differential Pressure 3</Name>
      <Type>analog</Type>
    </Request>
  </DataRequest>
</Request>
"""
        if x != s: 
            raise 'SOAP point request failed'
    def test_case_build_point_request(self):
        list = []
        list.append([['Name', 'Differential Pressure 1'], ['Type', 'analog']])
        list.append([['Name', 'Differential Pressure 3'], ['Type', 'analog']])
        x = build_point_request(list)
        s = """
<Request>
  <DataRequest>
    <Request>
      <Name>Differential Pressure 1</Name>
      <Type>analog</Type>
    </Request>
    <Request>
      <Name>Differential Pressure 3</Name>
      <Type>analog</Type>
    </Request>
  </DataRequest>
</Request>
"""
        if x != s:
            raise 'SOAP point request failed'
Beispiel #4
0
def _integration_test_send_request_GetRequestedData():
    host = 'www.dev1.eraserver.net'
    post = '/RCKCONTROLS/RCKData.asmx'
    action_server = 'http://RCKServices.com/'
    action = 'GetRequestedData'
    list = []
    list.append([['Name','Differential Pressure 1'], ['Type','analog']])
    list.append([['Name','Differential Pressure 3'], ['Type','analog']])
    request = build_point_request(list)
    print request
    envelope_start = """<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <""" + action + ' xmlns="' + action_server + '" >'
    envelope_end = """
        </""" + action + """>
      </soap:Body>
    </soap:Envelope>
    """
    r = suds.send_request(host, post, action_server + action, envelope_start + request + envelope_end)
    print r
    rsp = parse_response(r)
    print rsp
    return rsp