Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/composite properties and authentication #8

Merged
merged 5 commits into from
Aug 22, 2018

Conversation

Fale
Copy link
Contributor

@Fale Fale commented Aug 22, 2018

This is further work I did on top of #4

This does:

  1. Does everything the other PR does
  2. Successfully execute all test
  3. Support []map[string]interface{}
  4. More "pluggable"

@codecov-io
Copy link

Codecov Report

Merging #8 into master will decrease coverage by 0.73%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
- Coverage   71.26%   70.52%   -0.74%     
==========================================
  Files           3        3              
  Lines         174      190      +16     
==========================================
+ Hits          124      134      +10     
- Misses         47       52       +5     
- Partials        3        4       +1
Impacted Files Coverage Δ
soap.go 84.61% <33.33%> (-3.39%) ⬇️
encode.go 62.79% <80.95%> (+1.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8b526b...78fcffc. Read the comment docs.

@Fale
Copy link
Contributor Author

Fale commented Aug 22, 2018

Just adding here some info about map[string]interface{} and []map[string]interface{} that should probably become an example/test, but I'm not really sure how, since I don't have a public endpoint for those.

    params := gosoap.Params{
        "String": "value",
        "Test": map[string]interface{}{
            "Test2": "value2",
        },  
        "Booking": []map[string]interface{}{
            map[string]interface{}{
                "Booking": map[string]interface{}{
                    "Day":  "asd",
                    "Room": "lol",
                },  
            },  
        },  
    }   

Becomes:

            <Booking>
                <Booking>
                    <Day>asd</Day>
                    <Room>lol</Room>
                </Booking>
            </Booking>
            <Test>
                <Test2>value2</Test2>
            </Test>
            <String>value</String>

@tiaguinho tiaguinho merged commit a3eb3f4 into tiaguinho:master Aug 22, 2018
@chaz8080
Copy link

chaz8080 commented Apr 29, 2019

@Fale Maybe I have a fringe case, but is it possible to add attributes to params as well as values? See AccountInfo e.g.

params := gosoap.Params{
    "Booking": []map[string]interface{}{
        map[string]interface{}{
            "Booking": map[string]interface{}{
                "AccountInfo": map[string]interface{}{
                    `xml:"num,attr"`: "12345",
                    `xml:"secret,attr"`: "topsecret",
                    `xml:"country,attr"`: "US",
                    `xml:"laungauge,attr"`: "en",
                },
                "Day":  "asd",
                "Room": "lol",
            },  
        },  
    },  
} 
<Booking>
    <Booking>
        <AccountInfo num="12345" secret="topsecret" country="US" language="en" />
        <Day>asd</Day>
        <Room>lol</Room>
    </Booking>
</Booking>

Might also be related to #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants