コード例 #1
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
コード例 #2
0
ファイル: _test_case_suds.py プロジェクト: mcruse/monotone
    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'
コード例 #3
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'
コード例 #4
0
ファイル: _test_case_suds.py プロジェクト: mcruse/monotone
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