Hello,
is there a way, how to specify namespace for item?
I would like to create items like:
...
<ns0:Header>
<ns0:MessageID>TEST-013</ns0:MessageID>
---> <ns1:Respond>Always</ns1:Respond>
</ns0:Header>
...
But when I create this item from wsdl, then my final request has this
item with bad namespace:
...
<ns0:Header>
<ns0:MessageID>TEST-013</ns0:MessageID>
---> <ns0:Respond>Always</ns0:Respond>
</ns0:Header>
...
This is a code, where I create this items:
...
pack = c.factory.create("ns3:Pack")
pack.Envelope = c.factory.create("ns3:Envelope")
pack.Envelope.Header.MessageID = 'TEST-013'
pack.Envelope.Header.Respond = 'Always'
...
The xsd is specified like this:
<xs:complexType name="Envelope">
<xs:sequence>
<xs:element name="Header">
<xs:complexType>
<xs:sequence>
<xs:element name="MessageID" type="xs:string">
<xs:annotation>
<xs:documentation>sMessage unique
identifier.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="RelatesTo"
type="xs:string">
<xs:annotation>
<xs:documentation>In responses contains MessageID of
request message for correlation.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:any maxOccurs="unbounded" minOccurs="0"
namespace="##other" processContents="lax"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="sMsg:Payload">
<xs:annotation>
<xs:documentation>Main part of sMessage. Contains business
data.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
Here are the prefixes of ns, that I get from wsdl:
Prefixes (6)
ns0 = "http://myservices/Messaging"
ns1 = "http://myservices/sMessage/Acceptance" <------ here is
defined a Respond item
ns2 = "http://myservices/sMessage/Charge"
ns3 = "http://myservices/sMessage/Envelope"
ns4 = "http://myservices/sMessage/Payload"
ns5 = "http://myservices/sMessage/sMessageService"
"Respond" is defined:
<xs:element name="Respond">
<xs:annotation>
<xs:documentation>sMessage header property which controls
acceptance/rejection feature for the message.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Never"/>
<xs:enumeration value="Rejects"/>
<xs:enumeration value="Always"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
But I don't know, how to specify the right namespace for this item :(
--
Mira Chlastak
Show replies by date