Details
Description
After generating XMLBeans based stubs for our JIRA installation noticed errors in the generated code. Such as:
–
public JiraSoapServiceServiceClient() {
create0();
Endpoint jirasoapservice-v2EP = service0 .addEndpoint(new QName("http://.../jira/rpc/soap/jirasoapservice-v2", "jirasoapservice-v2"), new QName("http:/..../jira/rpc/soap/jirasoapservice-v2", "jirasoapservice-v2SoapBinding"), "http://.../jira/rpc/soap/jirasoapservice-v2");
endpoints.put(new QName("http:/.../jira/rpc/soap/jirasoapservice-v2", "jirasoapservice-v2"), jirasoapservice-v2EP);
–
Where the endpoint ends up with an embedded dash.
I assume the Endpoint var is taking it's name from the location or targetNamespace in the WSDL. Presumably the var generation needs to verify that it can use WSDL identifier directly as a java var.
Can be reproduced with the Codehaus jira's wsdl
Consider this WSDL fragment:
The service name of "example-service" causes the code generator to fail at startup. When the service name taken care of (e.g. by using underscores), the code generator will do its magic, but the port name causes Java variable and method names with an embedded '-' sign to be generated, resulting in noncompileable code such as quoted in the original comment.