You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by LavanyaKC <ck...@progress.com> on 2010/05/05 13:46:46 UTC

Codegen problem - Invalid target namespace

Hi,

I have the same issue as (https://issues.apache.org/jira/browse/AXIS2-3029)
with not using a target namespace in the schema element. And I would like to
know if there is a way to get rid of this by overriding generate method of
CodeGenerationEngine or someway to support these wsdls as they are critical
issues with this.

I took an initial look at the code and looks like the issue is in
WSDLValidatorExtension

Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException: Invalid
WSDL: The WSDL Types Schema does not define a targetNamespace in
org.apache.ws.commons.schema.XmlSchema@184738d[]
	at
org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension.engage(WSDLValidatorExtension.java:49)
	at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)

Not sure of this but why do we need a  s.getTargetNamespace() == null check
in the engage method of WSDLValidatorExtension as the wsdl is valid without
specifying the target namespace. This I guess will fix my issue but I didn’t
find an easy way to extend this and inject WSDLValidatorExtension in my
code.

Thanks for any help on this,
Lavanya. 

-- 
View this message in context: http://old.nabble.com/Codegen-problem---Invalid-target-namespace-tp28459767p28459767.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Codegen problem - Invalid target namespace

Posted by LavanyaKC <ck...@progress.com>.
Hi Amila,

Yes. But in my case I have only one import in the schema element. So it is
correct.

R2105  All xsd:schema elements contained in a wsdl:types element of a
DESCRIPTION MUST have a targetNamespace attribute with a valid and non-null
value, UNLESS the xsd:schema element has xsd:import and/or xsd:annotation as
its only child element(s).

So I guess, this needs a fix in code by WSDLValidationExtension where it
gets the includes (which actually gets the imports elements also) of the
schema element and validates for a targetnamespace. I fixed it for my code
by extending and disabling the check. Will this cause any issues for axis2
runtime as I tested this for my case and it worked fine.

Thanks,
Lavanya.



Amila Suriarachchi wrote:
> 
> please try with a nightly build[1].
> 
> however using schemas without targetnamespace is not recommended.
> 
> thanks,
> Amila.
> 
> [1]
> http://repository.apache.org/snapshots/org/apache/axis2/distribution/SNAPSHOT/
> [2]
> http://www.ws-i.org/Profiles/BasicProfile-1.1.html#Schema_targetNamespace_Structure
> 
> 
> On Wed, May 5, 2010 at 5:16 PM, LavanyaKC <ck...@progress.com> wrote:
> 
>>
>> Hi,
>>
>> I have the same issue as
>> (https://issues.apache.org/jira/browse/AXIS2-3029
>> )
>> with not using a target namespace in the schema element. And I would like
>> to
>> know if there is a way to get rid of this by overriding generate method
>> of
>> CodeGenerationEngine or someway to support these wsdls as they are
>> critical
>> issues with this.
>>
>> I took an initial look at the code and looks like the issue is in
>> WSDLValidatorExtension
>>
>> Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException: Invalid
>> WSDL: The WSDL Types Schema does not define a targetNamespace in
>> org.apache.ws.commons.schema.XmlSchema@184738d[]
>>        at
>>
>> org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension.engage(WSDLValidatorExtension.java:49)
>>        at
>>
>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
>>
>> Not sure of this but why do we need a  s.getTargetNamespace() == null
>> check
>> in the engage method of WSDLValidatorExtension as the wsdl is valid
>> without
>> specifying the target namespace. This I guess will fix my issue but I
>> didn’t
>> find an easy way to extend this and inject WSDLValidatorExtension in my
>> code.
>>
>> Thanks for any help on this,
>> Lavanya.
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Codegen-problem---Invalid-target-namespace-tp28459767p28459767.html
>> Sent from the Axis - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> 
> 
> -- 
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
> 
> 

-- 
View this message in context: http://old.nabble.com/Codegen-problem---Invalid-target-namespace-tp28459767p28507914.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Codegen problem - Invalid target namespace

Posted by Amila Suriarachchi <am...@gmail.com>.
please try with a nightly build[1].

however using schemas without targetnamespace is not recommended.

thanks,
Amila.

[1]
http://repository.apache.org/snapshots/org/apache/axis2/distribution/SNAPSHOT/
[2]
http://www.ws-i.org/Profiles/BasicProfile-1.1.html#Schema_targetNamespace_Structure


On Wed, May 5, 2010 at 5:16 PM, LavanyaKC <ck...@progress.com> wrote:

>
> Hi,
>
> I have the same issue as (https://issues.apache.org/jira/browse/AXIS2-3029
> )
> with not using a target namespace in the schema element. And I would like
> to
> know if there is a way to get rid of this by overriding generate method of
> CodeGenerationEngine or someway to support these wsdls as they are critical
> issues with this.
>
> I took an initial look at the code and looks like the issue is in
> WSDLValidatorExtension
>
> Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException: Invalid
> WSDL: The WSDL Types Schema does not define a targetNamespace in
> org.apache.ws.commons.schema.XmlSchema@184738d[]
>        at
>
> org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension.engage(WSDLValidatorExtension.java:49)
>        at
>
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
>
> Not sure of this but why do we need a  s.getTargetNamespace() == null check
> in the engage method of WSDLValidatorExtension as the wsdl is valid without
> specifying the target namespace. This I guess will fix my issue but I
> didn’t
> find an easy way to extend this and inject WSDLValidatorExtension in my
> code.
>
> Thanks for any help on this,
> Lavanya.
>
> --
> View this message in context:
> http://old.nabble.com/Codegen-problem---Invalid-target-namespace-tp28459767p28459767.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/