[
http://issues.apache.org/jira/browse/AXIS2-393?page=comments#action_12362829 ]
Juanda Zeng commented on AXIS2-393:
-----------------------------------
The above resolution will only work if the value of "targentNamespece" is given
by the user. Leaving it as "null" will cause NPE.
My preliminary testing also shows that there might be an error in the namespace
for the "binding" attribute of the <wsdl:port ...> section. In the same
org.apache.axis2.wsdl.java2wsdl.Java2WOM file line 99-100:
QName bindingName = new QName(targentNamespece, serviceName + "Binding"
, targetNamespecheprefix);
I think the ", targetNamespecheprefix);" part (line 100) needs to be changed
such that line 99-100 read:
QName bindingName = new QName(targentNamespece, serviceName + "Binding"
, "tns");
Perhaps I am missing something somewhere, but only by changing it to "tns" will
the generated WSDL be valid.
> "invalid QName prefix" exception when generating WSDL
> -----------------------------------------------------
>
> Key: AXIS2-393
> URL: http://issues.apache.org/jira/browse/AXIS2-393
> Project: Apache Axis 2.0 (Axis2)
> Type: Bug
> Components: wsdl
> Versions: 0.94
> Environment: Windows XP Pro, JBoss
> Reporter: Juanda Zeng
>
> In org.apache.axis2.wsdl.java2wsdl.Java2WOM rev. 366099, the
> "targentNamespece" and "targetNamespecheprefix" variables are not initialized
> with any value. When Java2WSDL instantiates Java2WOM, it also makes
> assumption that these 2 parameters are null.
> SUGGESTED RESOLUTION(S):
> --------------------------------------------------
> 1. Set the default values for the 2 variables (line 56 and 57 of Java2WOM):
> private String targentNamespece =
> SchemaGenerator.SCHEMA_TARGET_NAMESPACE;
> private String targetNamespecheprefix =
> SchemaGenerator.SCHEMA_NAMESPACE_PRFIX;
> 2. Add methods to allow Java2WSDL to accept "targetNamespace" and
> "targetNamespacePrefix" from users.
> Stack trace is as follows:
> ------------------------------------
> [JAM] Warning: You are running under a pre-1.5 JDK. JSR175-style source
> annotations will not be available
> java.lang.IllegalArgumentException: invalid QName prefix
> at javax.xml.namespace.QName.<init>(QName.java:81)
> at
> org.apache.axis2.wsdl.java2wsdl.Java2WOM.generateWOM(Java2WOM.java:99)
> at
> org.apache.axis2.wsdl.java2wsdl.Java2WSDL.generateWSDL(Java2WSDL.java:43)
> at test.Axis2Test.generateWsdl(Axis2Test.java:56)
> at test.Axis2Test.main(Axis2Test.java:170)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira