Skip to content

nicolaturcato/soap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SOAP is dead - long live SOAP

First of all do not write SOAP services if you can avoid it! It is over.

If you can not avoid it this package might help.

package main

import "github.com/foomo/soap"

type FooRequest struct {
	Foo string
}

type FooResponse struct {
	Bar string
}

func RunServer() {
	soapServer := soap.NewServer("127.0.0.1:8080")

	soapServer.HandleOperation(
		"operationFoo",
		func() interface{} {
			return &FooRequest{}
		},
		func(request interface{}) (response interface{}, err error) {
			fooRequest := request.(FooRequest)
			fooResponse := &FooResponse{
				Bar: "Hello " + fooRequest.Foo,
			}
			response = fooResponse
			return
		},
	)

}

func main() {
	RunServer()
}

About

go soap utilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%