From: Justin Zipperle Date: 2010-10-06T06:41:06+09:00 Subject: soap4r orders multi-element sequences incorrectly? Hi all- I'm building an app using soap4r v1.5.8 and I've generated client stubs using wsdl2ruby. I can retrieve a complex object but when I try to 'put' the same object I get an error from the API: "Unmarshalling Error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'n3:logicalOperation'. One of '{"http://www.strongmail.com/services/2009/03/02/schema":condition}' is expected." When I examine the raw XML I see differences in the structure where the error is being reported. Here is the part of the XML returned for a 'get' operation: true table.code EQUALS IC AND table.level NOT_ONE_OF gold,platinum OR table.level EQUALS none And here's the XML generated by soap4r for the corresponding 'put' request to the same API: table.code EQUALS IC AND OR table.level NOT_ONE_OF gold,platinum table.level EQUALS none I create this request using the same Ruby object created by the original response. I would expect soap4r to generate identical XML for the object, but notice how the ordering of elements differs - it should be "condition1, logicalOperation(AND), condition, logicalOperation(OR), condition". When I inspect the Ruby object I see that logicalOperation and condition are both Arrays containing the original values in the right order. I assume this is a correct transformation from the original XML using the XSD/WSDL... I'm hoping someone here knows more about the inner workings of soap4r and can help me find a workaround. Here's the relevant section from the XSD: And here's the class generated by wsdl2ruby: # {http://www.strongmail.com/services/2009/03/02/schema}RuleIfPart # condition1 - RuleIfPartCondition # logicalOperation - LogicalOperation # condition - RuleIfPartCondition class RuleIfPart attr_accessor :condition1 attr_accessor :logicalOperation attr_accessor :condition def initialize(condition1 = nil, logicalOperation = [], condition = []) @condition1 = condition1 @logicalOperation = logicalOperation @condition = condition end end The full WSDL and XSD are more than 4k lines - I can send them directly if someone wants to peel them apart. Any thoughts on how I can workaround this issue? Many thanks in advance! -Justin -- Posted via http://www.ruby-forum.com/.