[ 
https://issues.apache.org/jira/browse/AXIS2-5083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059360#comment-13059360
 ] 

Erwin Liem commented on AXIS2-5083:
-----------------------------------

Thanks for your answer. I made some changes in my schema, so that 
targetNamespace within xsd and the xmlns:crm1 in WSDL are now removed.

***************wsdl*************
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:crm="http://ABC"; 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="crmWS" 
targetNamespace="http://ABC";>
   <wsdl:types>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
targetNamespace="http://ABC";>
         <xsd:include schemaLocation="singleTypes.xsd"/>
         <xsd:complexType name="request">
            <xsd:sequence>
               <xsd:element ref="crm:companyName" minOccurs="0" maxOccurs="1"/>
...

***************xsd*************
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
   <!-- common header elements -->
   <xsd:element name="customerID" type="xsd:integer"/>
   <xsd:element name="customerUserID" type="xsd:string"/>
   .....



With this change Axis1 still can generate the stub, while Axis2 (v 1.5.5) still 
give me error messages:

Exception in thread "main" 
org.apache.axis2.wsdl.codegen.CodeGenerationException: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
        at 
org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:53)
        at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
        ... 2 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at 
org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50)
        ... 3 more
Caused by: org.apache.axis2.schema.SchemaCompilationException: 
java.lang.NullPointerException
        at 
org.apache.axis2.schema.SchemaCompiler.compile(SchemaCompiler.java:289)
        at 
org.apache.axis2.schema.ExtensionUtility.invoke(ExtensionUtility.java:103)
        ... 8 more
Caused by: java.lang.NullPointerException
        at 
org.apache.axis2.schema.SchemaCompiler.isComponetExists(SchemaCompiler.java:2723)

After searching in JIRA, I found such a problem in [AXIS2-1026] and it is said, 
WSDL2Java should never throw a NullPointerException. If it is sent invalid 
data, it should always throw an exception containing an informative error 
message instead. But that posting is from 2006 and the bug should had fixed 
already. f.y.i. I downloaded my Axis2 in 2011.

Do you have any idea? Maybe you can still help me.

> XmlSchemaException: problem with target namespace
> -------------------------------------------------
>
>                 Key: AXIS2-5083
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5083
>             Project: Axis2
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.5.5
>         Environment: java version "1.6.0_22"
> OpenJDK Runtime Environment (IcedTea6 1.10.2) (6b22-1.10.2-0ubuntu1~11.04.1)
> OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
> Linux C-3PO 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 
> x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Erwin Liem
>
> I currently have a WSDL and want to have the client stub based on Axis2. But 
> Axis2 cannot generate it, because of the conflict of the target namespaces:
> [ERROR] org.apache.ws.commons.schema.XmlSchemaException: An included schema 
> was announced to have the default target namespace or the target namespace 
> http://ABC, but has the target namespace http://EFG
> But it is very strange, since Axis1.4 generates the stub without errors. I 
> also use SoapUI 3.6.1 and with this tool I don't get error either. Maybe the 
> snippet below could help to illustrate how my WSDL (rpc/literal) + schema 
> look like:
> ***************wsdl*************
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <wsdl:definitions xmlns:crm1="http://DEF"; xmlns:crm="http://ABC"; 
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="crmWS" 
> targetNamespace="http://ABC";>
>    <wsdl:types>
>       <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> targetNamespace="http://ABC";>
>          <xsd:include schemaLocation="singleTypes.xsd"/>
>          <xsd:complexType name="request">
>             <xsd:sequence>
>                <xsd:element ref="crm1:companyName" minOccurs="0" 
> maxOccurs="1"/>
> ...
> ***************xsd*************
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> targetNamespace="http://DEF";>
>    <!-- common header elements -->
>    <xsd:element name="customerID" type="xsd:integer"/>
>    <xsd:element name="customerUserID" type="xsd:string"/>
>    .....
> I've been facing this problem since days and still have found no solution. 
> Can anybody help me?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to