metalpriest / pysimplesoap

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

wsdl-reading ignores part of xsd file #167

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. with the attached script (copied from your wiki page)

from pysimplesoap.client import SoapClient
#client = SoapClient(wsdl="file:DiagSysService-v2.wsdl",trace=False)
client = SoapClient(wsdl="file:EbosService-v2.wsdl",trace=False)
print "Target Namespace", client.namespace
for service in client.services.values():
    for port in service['ports'].values():
        print port['location']
        for op in port['operations'].values():
            print 'Name:', op['name']
            print 'Docs:', op['documentation'].strip()
            print 'SOAPAction:', op['action']
            print 'Input', op['input'] # args type declaration
            print 'Output', op['output'] # returns type declaration
            print

we analyse the attached wsdl File which contains the following part (from 
EbosDiagSysCommon.xsd)

  <xs:complexType name="HistoryData">
    <xs:annotation>
      <xs:documentation>DiagSys Hitory Data</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="row" type="tns:DataRow" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="DataRow">
    <xs:sequence>
      <xs:element name="rowkey" type="xs:long"/>
      <xs:element name="col" type="tns:Data" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="Data">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="colRef" type="xs:int" use="required">
          <xs:annotation>
            <xs:documentation>Reference to column array index obtained from SiteData</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

2. the result is:

When running the script it ignores the last block of the xsd-file. It is not 
possible to attach the colRef and the text field inside "col":{}

Target Namespace 
http://192.168.200.51:80/EBO-S/Edss/EbosWebService.svc/Ebos-v2_0
Name: LiveData
Docs: None
SOAPAction: http://192.168.200.51/wsdl/Ebos-v2/LiveData
Input {'LiveData': {u'diagSys': <type 'str'>, u'session': <type 'int'>, 
u'data': [{u'row': {u'rowkey': <type 'long'>, u'col': [{}]}}]}}
Output {'LiveDataResponse': {u'returnCode': <type 'int'>}}

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

The expected output is something that results of the last block with colRef. On 
my oppinion pysimplesoap ignores the last block covered by  "col".

We think the col should result in soap in something like this:

       <col colRef="0">2014-10-27 13:25:29.610</col>
       <col colRef="3">STR</col>
       <col colRef="1">S/SZb32</col>
       <col colRef="2">Signal</col>
       <col colRef="4">HG16 [HS] [] []</col>
       <col colRef="6">Meldung</col>

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

we use last git version (downloaded yesterday)

we attached everything you need to reproduce the issue.
If you need ANY support, feel free to ask.

Original issue reported on code.google.com by heimosch...@gmail.com on 13 Nov 2014 at 1:53

Attachments:

GoogleCodeExporter commented 8 years ago
perhaps the xs:simplecontent is not yet implemented? Searching for 
simplecontent in the pysimplesoap code brings only one search-hit in helpers.py 
:

./pysimplesoap/helpers.py:                    # TODO: check if this actually 
works for SimpleContent

Perhaps it would be enouth to implement the key "simplecontent"?

  <xs:complexType name="Data">
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="colRef" type="xs:int" use="required">
          <xs:annotation>
            <xs:documentation>Reference to column array index obtained from SiteData</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>

Original comment by heimosch...@gmail.com on 2 Jan 2015 at 12:39

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the report!

SimpleContent should be supported AFAIK, but this could be a corner case, and 
looking at the sample xml it should generate, it seems to use also special 
attributes.

Sadly, I had no time to see this right now, but I could help you if you want to 
debug or propose a patch.

Original comment by reingart@gmail.com on 3 Jan 2015 at 2:22

GoogleCodeExporter commented 8 years ago
Thanks a lot for accepting the report.

I added everything to reproduce the issue. Code, wsdl and xsd files are 
attached to the report.
If you need any support or donation, feel free to ask.

Original comment by heimosch...@gmail.com on 4 Jan 2015 at 1:18