Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client decoder #103

Closed
AlexDias79 opened this issue Aug 4, 2018 · 2 comments
Closed

Client decoder #103

AlexDias79 opened this issue Aug 4, 2018 · 2 comments

Comments

@AlexDias79
Copy link

AlexDias79 commented Aug 4, 2018

Hello,

First of all congrats for this nice tool, you did a great job with it.

So, I came across some error and I'm not sure why but it seems to be related with the client doRoundTrip()

Unmarshling the byte array from resp.body (using ioutil.ReadAll(resp.Body) I can see the whole correct xml response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <HelloWorldResponse xmlns="http://localhost:8282/">
         <HelloWorldResult>Yey, it works</HelloWorldResult>
      </HelloWorldResponse>
   </soap:Body>
</soap:Envelope`

The marshalStructure.XMLName is just fine, so it did unmarshal correct. Thing is, the body didn't and i can't figure out why and how to correct that.
marshalStructure := struct {
	XMLName xml.Name `xml:"Envelope"`
	Body    Message  `xml:"Body"`
}{Body: out}

err = xml.NewDecoder(resp.Body).Decode(&marshalStructure)
fmt.Println(marshalStructure.XMLName) //<-- correct | {http://schemas.xmlsoap.org/soap/envelope/ Envelope}
fmt.Println(marshalStructure.Body) // <-- nil pointer | &{{<nil>}}
return err`

Any idea?

@fiorix
Copy link
Owner

fiorix commented Aug 8, 2018

Hmmmm I'm not sure what's going on here and this will need some manual investigation that unfortunately I don't have the time to do right now.

@fiorix
Copy link
Owner

fiorix commented Aug 8, 2018

Looks like dup of #90

@fiorix fiorix closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants