Skip to content

gRPC - SOAP proxy in Go, and protoc-gen-wsdl to generate WSDL from .proto file

License

Notifications You must be signed in to change notification settings

UNO-SOFT/soap-proxy

Repository files navigation

soapproxy

A simple SOAP <-> gRPC proxy.

1. Generate the WSDL

with ./protoc-gen-wsdl:

protoc --wsdl_out=myproxy -I $GOPATH/src $GOPATH/src/unosoft.hu/ws/bruno/pb/dealer/dealer.proto

will create myproxy/dealer.wsdl and myproxy/dealer.wsdl.go.

2. Generate the Client code

with github.com/UNO-SOFT/gprcer/protoc-gen-grpcer:

protoc --grpcer_out=myproxy -I $GOPATH/src $GOPATH/src/unosoft.hu/ws/bruno/pb/dealer/dealer.proto

will create myproxy/dealer.grpcer.go, with grpc.Client implementation in it.

3. Profit!

Then use the SOAPHandler in myproxy/main.go (see ./example/example.go):

cc, err := grpcer.Connect("grpc-host:port", "ca.pem", "localhost")
if err != nil {
	log.Fatal(err)
}
http.ListenAndServe(
	":8080",
	soapproxy.SOAPHandler{Client:NewClient(cc), WSDL:soapproxy.Ungzb64(WSDLgzb64)},
)

About

gRPC - SOAP proxy in Go, and protoc-gen-wsdl to generate WSDL from .proto file

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages