{"id":20017596,"url":"https://github.com/foomo/soap","last_synced_at":"2026-03-14T07:03:29.437Z","repository":{"id":52684822,"uuid":"50935783","full_name":"foomo/soap","owner":"foomo","description":"SOAP is dead, long live SOAP","archived":false,"fork":false,"pushed_at":"2021-04-19T16:39:44.000Z","size":20,"stargazers_count":25,"open_issues_count":3,"forks_count":38,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-05-04T22:37:38.116Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/foomo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-02T16:48:55.000Z","updated_at":"2025-01-15T17:17:12.000Z","dependencies_parsed_at":"2022-08-22T05:01:13.792Z","dependency_job_id":null,"html_url":"https://github.com/foomo/soap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/foomo/soap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fsoap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fsoap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fsoap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fsoap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foomo","download_url":"https://codeload.github.com/foomo/soap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foomo%2Fsoap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263640772,"owners_count":23493387,"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":[],"created_at":"2024-11-13T08:16:53.146Z","updated_at":"2026-03-14T07:03:29.398Z","avatar_url":"https://github.com/foomo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SOAP is dead - long live SOAP\n\nFirst of all do not write SOAP services if you can avoid it! It is over.\n\nIf you can not avoid it this package might help.\n\n## Service\n\n```go\npackage main\n\nimport (\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/foomo/soap\"\n)\n\n// FooRequest a simple request\ntype FooRequest struct {\n\tXMLName xml.Name `xml:\"fooRequest\"`\n\tFoo     string\n}\n\n// FooResponse a simple response\ntype FooResponse struct {\n\tBar string\n}\n\n// RunServer run a little demo server\nfunc RunServer() {\n\tsoapServer := soap.NewServer()\n\tsoapServer.HandleOperation(\n\t\t// SOAPAction\n\t\t\"operationFoo\",\n\t\t// tagname of soap body content\n\t\t\"fooRequest\",\n\t\t// RequestFactoryFunc - give the server sth. to unmarshal the request into\n\t\tfunc() interface{} {\n\t\t\treturn \u0026FooRequest{}\n\t\t},\n\t\t// OperationHandlerFunc - do something\n\t\tfunc(request interface{}, w http.ResponseWriter, httpRequest *http.Request) (response interface{}, err error) {\n\t\t\tfooRequest := request.(*FooRequest)\n\t\t\tfooResponse := \u0026FooResponse{\n\t\t\t\tBar: \"Hello \" + fooRequest.Foo,\n\t\t\t}\n\t\t\tresponse = fooResponse\n\t\t\treturn\n\t\t},\n\t)\n\terr := soapServer.ListenAndServe(\":8080\")\n\tfmt.Println(\"exiting with error\", err)\n}\n\nfunc main() {\n\tRunServer()\n}\n```\n\n## Client\n\n```go\npackage main\n\nimport (\n\t\"encoding/xml\"\n\t\"log\"\n\n\t\"github.com/foomo/soap\"\n)\n\n// FooRequest a simple request\ntype FooRequest struct {\n\tXMLName xml.Name `xml:\"fooRequest\"`\n\tFoo     string\n}\n\n// FooResponse a simple response\ntype FooResponse struct {\n\tBar string\n}\n\nfunc main() {\n\tsoap.Verbose = true\n\tclient := soap.NewClient(\"http://127.0.0.1:8080/\", nil, nil)\n\tresponse := \u0026FooResponse{}\n\thttpResponse, err := client.Call(\"operationFoo\", \u0026FooRequest{Foo: \"hello i am foo\"}, response)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tlog.Println(response.Bar, httpResponse.Status)\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoomo%2Fsoap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoomo%2Fsoap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoomo%2Fsoap/lists"}