2014-01-19 3 views
2

Savon 2.1 used : 특성! 중첩 된 xml 태그에 속성을 추가합니다. 2.3에서 어떻게 이루어 집니까? 똑같은 해시가 동일한 XML을 렌더링하지 않습니다. 심지어 내부 속성 How do I use savon nested attributes! hash?Savon 2.3에서 중첩 속성을 어떻게 추가합니까?

다른 예 :

{ 
    :person => { 
    :address => "", 
    :attributes! => { :address => { :id => 44 } } 
    }, 
    :attributes! => { :person => { :id => 666 } } 
} 

<person> 
    <address id="44"/> 
    </person> 
    <attributes> 
    <person> 
     <id>666</id> 
    </person> 
    </attributes> 

대신 참고로

<person id=\"666\"><address id=\"44\"></address></person> 

생성! 실패

{ 
    'Objects' => [{ 
    'EmailAddress' => '[email protected]', 
    :attributes! => { 
     'EmailAddress' => { 'xsi:type' => "tns:email" } 
    } 
    }], 
    :attributes! => { 
    'Objects' => { 'xsi:type' => "tns:Subscriber" }, 
    } 
} 

는 생산 : 문제에 대한

<Objects> 
    <EmailAddress>[email protected]</EmailAddress> 
    <attributes> 
     <EmailAddress> 
     <xsi:type>tns:email</xsi:type> 
     </EmailAddress> 
    </attributes> 
    </Objects> 
    <attributes> 
    <Objects> 
     <xsi:type>tns:Subscriber</xsi:type> 
    </Objects> 
    </attributes> 

나중에 예를 궁극적 인 추론 ExactTarget에 대한 가입자를 만들려고한다. 이 인증 정보를 포함하고 있기 때문에

https://webservice.exacttarget.com/etframework.wsdl

61 def soap 
62 @soap_client ||= Savon.client(
63  soap_header: header, 
64  wsdl:   'https://webservice.exacttarget.com/etframework.wsdl', 
65  endpoint:  endpoint, 
66  wsse_auth: ["*", "*"], 
67  raise_errors: false, 
68  log:   true, 
69  open_timeout: 180, 
70  read_timeout: 180, 
71  pretty_print_xml: true 
72 ) 
73 end 

112 def create_subscriber 
113 soap.call :create, :message => { 
114  'Objects' => [{ 
115  'EmailAddress' => '[email protected]' 
116  }], 
117  :attributes! => { 
118  'Objects' => { 'xsi:type' => "tns:Subscriber" }, 
119  } 
120 } 
121 end 

헤더 생략.

+0

내 예상이 여전히 Savon 2.3에서 작동해야한다는 것입니다 @

soap.call :create, :message => { 'Objects' => [{ 'EmailAddress' => '[email protected]', :'@xsi:type' => "tns:Subscriber" }] } 

속성을 사용하여 동일한 수준에 플래그가 지정됩니다. 이것을 디버깅하기위한 작업에 전달할 수있는 매개 변수가있는 WSDL을 추적하려고하면 약간 어렵습니다. – tjarratt

+0

ExactTarget wsdl에서 오류가 발생하는 곳입니다. 구독자를 만들려고합니다. – Justin

+0

나는 똑같은 문제가있다. – banditKing

답변

3

나는과 같이 점점 결국 :

관련 문제