Skip to content

Commit

Permalink
A little exploration before starting to generate code
Browse files Browse the repository at this point in the history
  • Loading branch information
c4milo committed Dec 28, 2013
1 parent 53ef487 commit 5c5b836
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions gowsdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ func (g *GoWsdl) unmarshal() error {
}

func (g *GoWsdl) resolveXsdExternals(schema *XsdSchema, url *url.URL) error {

for _, incl := range schema.Includes {
location, err := url.Parse(incl.SchemaLocation)
if err != nil {
Expand Down Expand Up @@ -215,34 +214,29 @@ func (g *GoWsdl) resolveXsdExternals(schema *XsdSchema, url *url.URL) error {
g.resolvedXsdExternals[schemaName] = true
}

// for _, imp := range schema.Imports {

// }
return nil
}

func (g *GoWsdl) genTypes() ([]byte, error) {
//element > complexType

totalAdts := 0
for _, schema := range g.wsdl.Types.Schemas {
embed := 0
refcount := 0
for _, el := range schema.Elements {
if el.Type != "" {
embed++
} else {
refcount++
if el.Type == "" {
log.Printf("%s -> %#v\n\n", strings.TrimSuffix(el.ComplexType.Name, "Type"), el.ComplexType.Sequence)
totalAdts++
}
}

// log.Printf("embedded types: %d\n", embed)
// log.Printf("referenced types: %d\n", refcount)
// for _, element := range schema.Elements {
// g.logger.Printf("Type: %s\n", element.Name)
// }

for _, complexType := range schema.ComplexTypes {
log.Printf("%s -> %#v\n\n", strings.TrimSuffix(complexType.Name, "Type"), complexType.Sequence)
totalAdts++
}
}

log.Printf("Abstract data types: %d\n", totalAdts)
log.Printf("Total schemas: %#d\n\n", len(g.wsdl.Types.Schemas))

return nil, nil
}

Expand Down

0 comments on commit 5c5b836

Please sign in to comment.