I have a web service that returns following type:
<xsd:complexType name="TaggerResponse">
<xsd:sequence>
<xsd:element name="msg" type="xsd:string"></xsd:element>
</xsd:sequence>
<xsd:attribute name="status" type="tns:Status"></xsd:attribute>
</xsd:complexType>
The type contains one element (msg
) and one attribute (status
).
To communicate with the web service I use SOAPpy library. Below is a sample result return by the web service (SOAP message):
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:TagResponse>
<parameters status="2">
<msg>text</msg>
</parameters>
</SOAP-ENV:TagResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Python parses this message as:
<SOAPpy.Types.structType parameters at 157796908>: {'msg': 'text'}
As you can see the attribute is lost. What should I do to get the value of "status
"?