hecsa / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

soap data structure when using wsdl file #147

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.starting attached server.py and client.py with attached wsdl and xsd files

2.sends the following data from client.py to server.py
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soap:Header/>
  <soap:Body>
    <UpdateFaultList xmlns="http://www.grumpftiklumpf.com/wsdl/Ebos-v2.0">
      <update><siteDataVersion xmlns="http://www.grumpftiklumpf.com/Ebos/2011">42.1</siteDataVersion>
        <diagSys xmlns="http://www.grumpftiklumpf.com/Ebos/2011">222222222</diagSys>
        <allActiveFaults xmlns="http://www.grumpftiklumpf.com/Ebos/2011">true</allActiveFaults>
        <newFaults xmlns="http://www.grumpftiklumpf.com/Ebos/2011">
          <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2</faultId>
          <elementId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">1</elementId>
          <severity xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">1</severity>
          <descr xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">das ist ein Fehler</descr>
          <url xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">http://192.168.1.1</url>
          <detail xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">false</detail>
          <time xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2014-06-12T01:01:48.612682</time>
          <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">3</faultId>
                :
        </newFaults>
        <deletedFaults xmlns="http://www.grumpftiklumpf.com/Ebos/2011">
          <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">7</faultId>
      <elementId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2</elementId>
      <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">9</faultId>
      <elementId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2</elementId>
      <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">8</faultId>
      <elementId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2</elementId>
        </deletedFaults>
      </update>
    </UpdateFaultList>
  </soap:Body>
</soap:Envelope>

3.

What is the expected output? What do you see instead?

The server can not work with this structur. The server expects e.q. the 
deletedFaults part like this:

        <deletedFaults xmlns="http://www.grumpftiklumpf.com/Ebos/2011">
          <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">7</faultId>
      <elementId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2</elementId>
       </deletedFaults>
       <deletedFaults xmlns="http://www.grumpftiklumpf.com/Ebos/2011">
      <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">9</faultId>
      <elementId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2</elementId>
       </deletedFaults>
       <deletedFaults xmlns="http://www.grumpftiklumpf.com/Ebos/2011">
      <faultId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">8</faultId>
      <elementId xmlns="http://www.grumpftiklumpf.com/EbosDiagSysCommon/2011">2</elementId>
        </deletedFaults>

What version of the product are you using? On what operating system?

latest version of pysimplesoap
Linux
Python 2.7

Please attach the related WSDL (if any), a small code fragment to reproduce
and provide any additional information below.

Original issue reported on code.google.com by heimosch...@gmail.com on 11 Jun 2014 at 11:15

Attachments:

GoogleCodeExporter commented 9 years ago
In earlier versions of pysimplesoap we sent data in structure like this to the 
client:

[{'siteDataVersion': '42.1', 'allActiveFaults': False, 'diagSys': '222222222'}, 
{'newFaults': {'faultId': 1, 'severity': '1', 'descr': 'Zaehlerstand 0 
currentStatus:0', 'url': 'http://192.168.1.11:8008/docu/installation manual 
(german).pdf', 'detail': True, 'time': datetime.datetime(2014, 6, 14, 22, 4, 
25, 323789), 'elementId': 1}}, {'newFaults': {'faultId': 7, 'severity': '1', 
'descr': 'IMC_status: currentStatus:0 channel:1 errorCode:0 wheelsensorType:0', 
'url': 'http://192.168.1.11:8008/docu/installation manual (german).pdf', 
'detail': True, 'time': datetime.datetime(2014, 6, 14, 22, 4, 25, 331861), 
'elementId': 0}}, {'deletedFaults': {'faultId': 9, 'elementId': 0}}, 
{'deletedFaults': {'faultId': 6, 'elementId': 1}}, {'deletedFaults': 
{'faultId': 1, 'elementId': 1}}, {'deletedFaults': {'faultId': 7, 'elementId': 
0}}]

The part ....
{'deletedFaults': {'faultId': 9, 'elementId': 0}}, {'deletedFaults': 
{'faultId': 6, 'elementId': 1}}, {'deletedFaults': {'faultId': 1, 'elementId': 
1}}, {'deletedFaults': {'faultId': 7, 'elementId': 0}}
was working fine and brought the expected result.

But in the last version of pysimplesoap we become the following errormessage 
when we pass the above client-parameter:

Traceback (most recent call last):
  File "server.py", line 392, in <module>
  File "server.py", line 324, in startSubProcess
  File "server.py", line 299, in soapClient
  File "server.py", line 111, in handle_EDSS_1sec_gone
  File "client.py", line 136, in soapSendMessages
  File "client.py", line 206, in soapSendUpdateFaultList
  File "/home/default/exd/ramdisk/frauscher/Frauscher-Diagnose-Schnittstelle/ebo-s/server/lib/pysimplesoap/client.py", line 172, in <lambda>
  File "/home/default/exd/ramdisk/frauscher/Frauscher-Diagnose-Schnittstelle/ebo-s/server/lib/pysimplesoap/client.py", line 328, in wsdl_call
  File "/home/default/exd/ramdisk/frauscher/Frauscher-Diagnose-Schnittstelle/ebo-s/server/lib/pysimplesoap/client.py", line 360, in wsdl_call_get_params
  File "/home/default/exd/ramdisk/frauscher/Frauscher-Diagnose-Schnittstelle/ebo-s/server/lib/pysimplesoap/client.py", line 430, in wsdl_validate_params
  File "/home/default/exd/ramdisk/frauscher/Frauscher-Diagnose-Schnittstelle/ebo-s/server/lib/pysimplesoap/client.py", line 430, in wsdl_validate_params
  File "/home/default/exd/ramdisk/frauscher/Frauscher-Diagnose-Schnittstelle/ebo-s/server/lib/pysimplesoap/client.py", line 426, in wsdl_validate_params
TypeError: unhashable type: 'dict'

Is this a helpful information? Do you need some more information?

with best regards,
Heimo

Original comment by heimosch...@gmail.com on 14 Jun 2014 at 8:15

GoogleCodeExporter commented 9 years ago
in pysimplesoap client.py in line 268 we added the following hack:

        xml = xml.replace("</elementId><faultId", 
                          '</elementId></deletedFaults><deletedFaults xmlns="http://www.grumpftiklumpf.com/Ebos/2011"><faultId')

any ideas how we could solve this issue?

Original comment by heimosch...@gmail.com on 1 Jul 2014 at 6:29