Git Product home page Git Product logo

Comments (13)

fiorix avatar fiorix commented on August 21, 2024

Can you give an example?

from wsdl2go.

nlacey avatar nlacey commented on August 21, 2024

I'm sorry for how long this took me.
If you replace nick-name with nickname, in the included file, the problem will work.

problem_example_wsdl.txt

I messed around wtih wsdlgo/encoder.go so struct names wouldn't include the '-' character, which allowed your code to run.

from wsdl2go.

fiorix avatar fiorix commented on August 21, 2024

Alright, so this is mainly about removing - from function names and variables but keeping them in the XML tags? PR?

from wsdl2go.

nlacey avatar nlacey commented on August 21, 2024

correct, attached export.go that worked with example file,
encoder.txt

created cleanString function (currently removes '-' and ' ')
Not sure how complete it is, but it was able to convert the previously attached file thanks!

from wsdl2go.

fiorix avatar fiorix commented on August 21, 2024

Yeah we need to fix this. @flavioayra just reported the same problem, finding "-" and "." in type/op names.

from wsdl2go.

fiorix avatar fiorix commented on August 21, 2024

Should be good now.

from wsdl2go.

warroyo avatar warroyo commented on August 21, 2024

@fiorix i am still seeing this issue with "." in the name, was this added to fix "." or just "-"

here is an example file. it is from the F5 Networks WSDL. unfortunately they use "." all over the place.

for refrence here is the error

 generated bad code: 1182:16: expected type, found '.' (and 1 more errors)
    1180
 1181	// management.ResourceRecordPortType implements the ManagementResourceRecordPortType interface.
 1182	type management.ResourceRecordPortType struct {
 1183		cli *soap.Client
 1184	}
 1185

wsdl.txt

from wsdl2go.

fiorix avatar fiorix commented on August 21, 2024

I think I missed the "." in the regex that makes it a valid Go symbol:

var validGoSymbol = regexp.MustCompile(`[0-9_]*[^0-9a-zA-Z_]+`)

from wsdl2go.

warroyo avatar warroyo commented on August 21, 2024

@fiorix in this case the "." is actually invalid in the type name, i think that problem is that it is not using the validGoSymbol function when creating types

from wsdl2go.

fiorix avatar fiorix commented on August 21, 2024

PR?

from wsdl2go.

prologic avatar prologic commented on August 21, 2024

@fiorix I'm also seeing this as well.

For example:

$ wsdl2go < ParseAddress.wsdsl > ParseAddr.go
2022/10/03 12:04:06 generated bad code: 3:13: expected ';', found '-'
    1	// Code generated by wsdl2go. DO NOT EDIT.
    2
    3	package plsp-public
...

This WSDL comes from: https://information.qld.gov.au/service/Addressing/ValidationService/PLSplusPublic/soap?wsdl

from wsdl2go.

prologic avatar prologic commented on August 21, 2024

#47 fixes a bunch of bugs I found with generating type names, method names and so on. This resolves my problem as well as the one found in this issue. I'm not happy with the code, but it generated valid Go code finally 😅

from wsdl2go.

prologic avatar prologic commented on August 21, 2024

FWW I achieved much better results by using the wsdlgen cli utility found in this package:

from wsdl2go.

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.