view cmd/bottlenecks/main.go @ 566:5e45f441aed6

Added SOAP client for the IFBN bottleneck service. Generated by github.com/hooklift/gowsdl from official WSDL (2018-09-03) and edit by hand to resolve some problems.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 04 Sep 2018 17:13:25 +0200
parents
children 18c007104106
line wrap: on
line source

package main

import (
	"flag"
	"fmt"
	"log"

	"gemma.intevation.de/gemma/pkg/soap/ifbn"
)

func main() {

	url := flag.String("url", "", "the IFBN service")
	insecure := flag.Bool("insecure", false, "skip SSL verification")

	flag.Parse()

	client := ifbn.NewIBottleneckService(*url, *insecure, nil)

	req := &ifbn.Export_bn_by_isrs{}

	resp, err := client.Export_bn_by_isrs(req)
	if err != nil {
		log.Fatalf("error: %v\n", err)
	}

	fmt.Printf("%v\n", resp)

	if resp.Export_bn_by_isrsResult == nil {
		return
	}
	bns := resp.Export_bn_by_isrsResult.BottleNeckType

	log.Printf("bottle necks: %d\n", len(bns))

	for i := range bns {
		bn := bns[i]
		log.Printf("%s: %s %v\n", bn.Fk_g_fid, bn.OBJNAM, bn.Date_Info)
	}
}