Example #1
0
func GetStub(url string) (*WebApiStub, error) {
	var stub WebApiStub
	if len(url) == 0 {
		return nil, errors.New("url length is zero")
	}
	t := strings.Replace(url, "http", "ws", 1) //现在支持
	if t == url {
		fmt.Printf("url[%s]的格式可能不合法\r\n", url)
	}
	if t[len(t)-1] != '/' {
		t = t + "/"
	}
	url = t + "ws/" //待优化

	//fmt.Printf(url)
	client := hprose.NewClient(url)
	client.UseService(&stub)
	return &stub, nil
}
Example #2
0
func getClient(url string) {
	client := hprose.NewClient(url)
	var stub interface{}
	client.UseService(stub)
}