GithubHelp home page GithubHelp logo

how to use generated service? about gowsdl HOT 6 OPEN

hooklift avatar hooklift commented on June 20, 2024 13
how to use generated service?

from gowsdl.

Comments (6)

icobani avatar icobani commented on June 20, 2024 1

It is very important i can not find any sample anywhere?

from gowsdl.

chuyennm avatar chuyennm commented on June 20, 2024

Hello ,

Please help me , I have using gowsdl.exe my.wsdl to myservice.go

When i wrote the test file:

type LoginRequest struct {
XMLName xml.Name xml:"http://entities login"
username string xml:"username,omitempty"
password string xml:"password,omitempty"
partnerID string xml:"partnerID,omitempty"
}

client := myservice.NewSOAPClient("MYURL service", true, nil)

req := new(LoginRequest)

req.username="gamef7"
req.password="sgrglb"
req.partnerID="gamef7"
fmt.Println(req)
res := &myservice.LoginResponse{}
if err := client.Call("", req, res); err != nil {
	panic(err)
}

Run it, then from console log:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
      <Body xmlns="http://schemas.xmlsoap.org/soap/envelope/">
          <login xmlns="http://entities"></login>
      </Body>
  </Envelope>

Why my parameter not in there? (username, password,...).

Thanks for your support.

from gowsdl.

kfimchenko avatar kfimchenko commented on June 20, 2024

still no any examples? wow
I'm trying to use service.Call("MethodName", rq, rsp)
and my rsp is nil always without any error. Have no idea what is wrong..

from gowsdl.

anjmao avatar anjmao commented on June 20, 2024

Example:

package integration

import (
	"do/pkg/soap"
	"fmt"
	"testing"
)

func TestSoapClient(t *testing.T) {
	url := "http://webservices/service.asmx"
	soapService := soap.NewServiceSoap(url, false, &soap.BasicAuth{})
	echoReply, err := soapService.Ping(&soap.Ping{Message: "a"})
	fmt.Println(echoReply.PingResult)
}

Replace import do/pkg/soap with your import to generated soap file.

from gowsdl.

zaddok avatar zaddok commented on June 20, 2024

The above is out of date. See:

https://github.com/hooklift/gowsdl/blob/master/example/example.go

from gowsdl.

jjorissen52 avatar jjorissen52 commented on June 20, 2024

@chuyennm

type LoginRequest struct {
    XMLName xml.Name `xml:"http://entities login"`
    Username string `xml:"username,omitempty"`
    Password string `xml:"password,omitempty"`
    PartnerID string `xml:"partnerID,omitempty"`
 }

Go uses capitalization to indicate private and public fields in structs. If a field name is not capitalized, it is private, and thus not usable by methods external to your package.

from gowsdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.