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

Unexpected character #106

Open
Massimo-B opened this issue Jul 11, 2017 · 1 comment
Open

Unexpected character #106

Massimo-B opened this issue Jul 11, 2017 · 1 comment

Comments

@Massimo-B
Copy link

We found an issue with a WSDL file that is referencing remote XSD code. While running in a proxied environment we use tsocks to connect:

tsocks ~/bin/kdwsdl2cpp -o Extensions.h Extensions.wsdl 
Warning: Definitions: unknown tag wsp:UsingPolicy
Warning: Definitions: unknown tag wsp:Policy
Warning: Definitions: unknown tag wsp:Policy
importing schema at http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader
Downloading 'http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader'
13:33:05 libtsocks(12842): Call to connect received on completed request 10
Download successful
Error[1:50] unexpected character
Warning: PortType: unknown tag wsp:Policy
Warning: Operation: unknown tag wsp:Policy
No service tag found in the wsdl file, generating one service per binding 
Converting 0 simple types 
Converting 0 complex types 

There are 2 issues, that do not seem to be proxy related:

Error[1:50] unexpected character
Is this error in the XSD or in the WSDL file? I can't see something in line 1, column 50.

No service tag found in the wsdl file
Do you need the WSDL for further investigation? There is actually no in the WSDL. I guess this is just a WSDL derived from a plain XSD as kdwsdl was not able to import XSD directly. Is a required in general just for defining data structures?

Kind regards,
Massimo

@dfaure-kdab
Copy link
Member

I strongly suggest that you make a one-time download of the XSD file(s) and adjust your WSDL to point to the file(s) locally, as I did in all unittests. This saves bandwidth usage and would also fix your problems with tsocks ;-)

The parse error "unexpected character" sounds like it's from the downloaded XSD, but I'd say, this isn't worth debugging, just have a local copy of the file.

"No service tag" is fine, as the line says, we're generating one automatically, so that shouldn't be a problem.

What might be a problem though, with this approach, is the code that strips out any data structures that aren't used by the WSDL. See Converter::cleanupUnusedTypes.
If you add a command-line option for kdwsdl2cpp to keep unused types (by skipping the call to cleanupUnusedTypes when that new option --keep-unused-types is set), I can merge that in.

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