Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Ticket #229 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Incorrect obj2soap mapping (Case-Sensitivity)

Reported by: Kent Assigned to: nahi
Priority: highest Milestone: 1.5.6
Component: wsdl4r Version: 1.5
Keywords: Cc:

Description

WSDL declares this type: <xs:complexType name="TTMHeader">

<xs:sequence>

<xs:element name="DSN" type="xs:string"/> <xs:element name="Password" type="xs:string"/> <xs:element name="Schema" type="xs:string"/> <xs:element name="Username" type="xs:string"/>

</xs:sequence>

</xs:complexType>

wsdl2ruby generates this class:

# {urn:TruckMateTypes}TTMHeader class TTMHeader

@@schema_type = "TTMHeader" @@schema_ns = "urn:TruckMateTypes" @@schema_element = [

["dSN", ["SOAP::SOAPString", XSD::QName.new(nil, "DSN")]], ["password", ["SOAP::SOAPString", XSD::QName.new(nil,

"Password")]],

["schema", ["SOAP::SOAPString", XSD::QName.new(nil, "Schema")]], ["username", ["SOAP::SOAPString", XSD::QName.new(nil,

"Username")]]

]

attr_accessor :dSN attr_accessor :password attr_accessor :schema attr_accessor :username

def initialize(dSN = nil, password = nil, schema = nil, username =

nil)

@dSN = dSN @password = password @schema = schema @username = username

end

end

Mapping generates this output

<n1:TTMHeader xmlns:n1="urn:TruckMateTypes"

xsi:type="n1:TTMHeader" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

<dSN xsi:type="xsd:string">xxx</dSN> <password xsi:type="xsd:string">xxx</password> <schema xsi:type="xsd:string">xxx</schema> <username xsi:type="xsd:string">xxx</username>

</n1:TTMHeader>

which is violates the schema definition.

Note that soap4r version which is bundled with the current Ruby doesn't have this problem

Change History

08/06/06 23:30:05 changed by nahi

  • status changed from new to closed.
  • resolution set to fixed.

(In [1698]) generated classDef + capitalized element name caused the schema violation. soap4r must check a defined XSD::QName, not varname. fixes #229.

09/03/06 21:34:36 changed by nahi

  • priority changed from normal to highest.
  • summary changed from Incorrent obj2soap mapping to Incorrect obj2soap mapping (Case-Sensitivity).
  • component changed from soap4r to wsdl4r.
  • milestone changed from undefined to 1.5.6.