Closed yangyao closed 2 years ago
For this type of struct . not able to transform
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>2</name>
<value>
<struct>
<member>
<name>tag_id</name>
<value>
<string>2</string>
</value>
</member>
<member>
<name>name</name>
<value>
<string>product01-tag02</string>
</value>
</member>
</struct>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>
&struct {
2 : struct {
TagId : string,
Name : string
}
}
not able to define this kind of struct ..
use raw http response . and xmlpath to get data
/methodResponse/params/param/value/struct/member/value/struct/member[name="name"]/value/string/text()
This should now be possible with v0.4.0 by using xmlrpc
tag on fields. Specifically, you can remap the field with something like this:
&struct {
Two: struct {
TagId : string,
Name : string
} `xmlrpc:"2"`
}
And also transform xml response to go struct
After a lot of struggle, I found the following pattern. ( Notice the green text