{"id":16443176,"url":"https://github.com/tiaguinho/gosoap","last_synced_at":"2025-05-15T20:00:45.251Z","repository":{"id":21954249,"uuid":"93806293","full_name":"tiaguinho/gosoap","owner":"tiaguinho","description":"🦉SOAP package for Go","archived":false,"fork":false,"pushed_at":"2024-03-03T15:45:35.000Z","size":114,"stargazers_count":524,"open_issues_count":28,"forks_count":181,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-08T01:36:44.786Z","etag":null,"topics":["go","golang","gosoap","soap","soap-client","soap-messages"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiaguinho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["tiaguinho"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2017-06-09T01:27:46.000Z","updated_at":"2025-04-06T11:08:04.000Z","dependencies_parsed_at":"2024-06-18T12:32:26.966Z","dependency_job_id":"6c6f9272-899a-4003-a2c7-0a9dff1eb6d7","html_url":"https://github.com/tiaguinho/gosoap","commit_stats":{"total_commits":119,"total_committers":33,"mean_commits":3.606060606060606,"dds":0.7058823529411764,"last_synced_commit":"5bd41250cae9f0f822bd0edf9fc06ecf2e8e5b96"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaguinho%2Fgosoap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaguinho%2Fgosoap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaguinho%2Fgosoap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaguinho%2Fgosoap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaguinho","download_url":"https://codeload.github.com/tiaguinho/gosoap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414457,"owners_count":22067263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","gosoap","soap","soap-client","soap-messages"],"created_at":"2024-10-11T09:19:38.990Z","updated_at":"2025-05-15T20:00:44.930Z","avatar_url":"https://github.com/tiaguinho.png","language":"Go","funding_links":["https://github.com/sponsors/tiaguinho","https://www.patreon.com/temporin"],"categories":["Go"],"sub_categories":[],"readme":"# Go Soap [![Build Status](https://travis-ci.org/tiaguinho/gosoap.svg?branch=master)](https://travis-ci.org/tiaguinho/gosoap) [![GoDoc](https://godoc.org/github.com/tiaguinho/gosoap?status.png)](https://godoc.org/github.com/tiaguinho/gosoap) [![Go Report Card](https://goreportcard.com/badge/github.com/tiaguinho/gosoap)](https://goreportcard.com/report/github.com/tiaguinho/gosoap) [![Coverage Status](https://coveralls.io/repos/github/tiaguinho/gosoap/badge.svg?branch=master)](https://coveralls.io/github/tiaguinho/gosoap?branch=master) [![patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/temporin) [![Known Vulnerabilities](https://snyk.io/test/github/tiaguinho/gosoap/badge.svg)](https://snyk.io/test/github/tiaguinho/gosoap)\npackage to help with SOAP integrations (client)\n\n### Install\n\n```bash\ngo get github.com/tiaguinho/gosoap\n```\n\n### Examples\n\n#### Basic use\n\n```go\npackage main\n\nimport (\n\t\"encoding/xml\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/tiaguinho/gosoap\"\n)\n\n// GetIPLocationResponse will hold the Soap response\ntype GetIPLocationResponse struct {\n\tGetIPLocationResult string `xml:\"GetIpLocationResult\"`\n}\n\n// GetIPLocationResult will\ntype GetIPLocationResult struct {\n\tXMLName xml.Name `xml:\"GeoIP\"`\n\tCountry string   `xml:\"Country\"`\n\tState   string   `xml:\"State\"`\n}\n\nvar (\n\tr GetIPLocationResponse\n)\n\nfunc main() {\n\thttpClient := \u0026http.Client{\n\t\tTimeout: 1500 * time.Millisecond,\n\t}\n\tsoap, err := gosoap.SoapClient(\"http://wsgeoip.lavasoft.com/ipservice.asmx?WSDL\", httpClient)\n\tif err != nil {\n\t\tlog.Fatalf(\"SoapClient error: %s\", err)\n\t}\n\t\n\t// Use gosoap.ArrayParams to support fixed position params\n\tparams := gosoap.Params{\n\t\t\"sIp\": \"8.8.8.8\",\n\t}\n\n\tres, err := soap.Call(\"GetIpLocation\", params)\n\tif err != nil {\n\t\tlog.Fatalf(\"Call error: %s\", err)\n\t}\n\n\tres.Unmarshal(\u0026r)\n\n\t// GetIpLocationResult will be a string. We need to parse it to XML\n\tresult := GetIPLocationResult{}\n\terr = xml.Unmarshal([]byte(r.GetIPLocationResult), \u0026result)\n\tif err != nil {\n\t\tlog.Fatalf(\"xml.Unmarshal error: %s\", err)\n\t}\n\n\tif result.Country != \"US\" {\n\t\tlog.Fatalf(\"error: %+v\", r)\n\t}\n\n\tlog.Println(\"Country: \", result.Country)\n\tlog.Println(\"State: \", result.State)\n}\n```\n\n#### Set Custom Envelope Attributes\n\n```go\npackage main\n\nimport (\n\t\"encoding/xml\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/tiaguinho/gosoap\"\n)\n\n// GetIPLocationResponse will hold the Soap response\ntype GetIPLocationResponse struct {\n\tGetIPLocationResult string `xml:\"GetIpLocationResult\"`\n}\n\n// GetIPLocationResult will\ntype GetIPLocationResult struct {\n\tXMLName xml.Name `xml:\"GeoIP\"`\n\tCountry string   `xml:\"Country\"`\n\tState   string   `xml:\"State\"`\n}\n\nvar (\n\tr GetIPLocationResponse\n)\n\nfunc main() {\n\thttpClient := \u0026http.Client{\n\t\tTimeout: 1500 * time.Millisecond,\n\t}\n\t// set custom envelope\n    gosoap.SetCustomEnvelope(\"soapenv\", map[string]string{\n\t\t\"xmlns:soapenv\": \"http://schemas.xmlsoap.org/soap/envelope/\",\n\t\t\"xmlns:tem\": \"http://tempuri.org/\",\n    })\n\n\tsoap, err := gosoap.SoapClient(\"http://wsgeoip.lavasoft.com/ipservice.asmx?WSDL\", httpClient)\n\tif err != nil {\n\t\tlog.Fatalf(\"SoapClient error: %s\", err)\n\t}\n\t\n\t// Use gosoap.ArrayParams to support fixed position params\n\tparams := gosoap.Params{\n\t\t\"sIp\": \"8.8.8.8\",\n\t}\n\n\tres, err := soap.Call(\"GetIpLocation\", params)\n\tif err != nil {\n\t\tlog.Fatalf(\"Call error: %s\", err)\n\t}\n\n\tres.Unmarshal(\u0026r)\n\n\t// GetIpLocationResult will be a string. We need to parse it to XML\n\tresult := GetIPLocationResult{}\n\terr = xml.Unmarshal([]byte(r.GetIPLocationResult), \u0026result)\n\tif err != nil {\n\t\tlog.Fatalf(\"xml.Unmarshal error: %s\", err)\n\t}\n\n\tif result.Country != \"US\" {\n\t\tlog.Fatalf(\"error: %+v\", r)\n\t}\n\n\tlog.Println(\"Country: \", result.Country)\n\tlog.Println(\"State: \", result.State)\n}\n```\n\n#### Set Header params\n\n```go\n\tsoap.HeaderParams = gosoap.SliceParams{\n\t\txml.StartElement{\n\t\t\tName: xml.Name{\n\t\t\t\tSpace: \"auth\",\n\t\t\t\tLocal: \"Login\",\n\t\t\t},\n\t\t},\n\t\t\"user\",\n\t\txml.EndElement{\n\t\t\tName: xml.Name{\n\t\t\t\tSpace: \"auth\",\n\t\t\t\tLocal: \"Login\",\n\t\t\t},\n\t\t},\n\t\txml.StartElement{\n\t\t\tName: xml.Name{\n\t\t\t\tSpace: \"auth\",\n\t\t\t\tLocal: \"Password\",\n\t\t\t},\n\t\t},\n\t\t\"P@ssw0rd\",\n\t\txml.EndElement{\n\t\t\tName: xml.Name{\n\t\t\t\tSpace: \"auth\",\n\t\t\t\tLocal: \"Password\",\n\t\t\t},\n\t\t},\n\t}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaguinho%2Fgosoap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaguinho%2Fgosoap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaguinho%2Fgosoap/lists"}