axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomaž Majerhold (JIRA) <j...@apache.org>
Subject [jira] Commented: (AXIS2-2088) wsdl2java JiBX code generator and -Ebindingfile option unavailable in ant task
Date Fri, 25 Feb 2011 14:43:46 GMT

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

Tomaž Majerhold commented on AXIS2-2088:
----------------------------------------

Affects Version/s: 1.5.4

I have the similar problem.

I have the similar problem, before I use ant, like this:

<target name="axis2-wsdl2java-jibx" depends="-prepare-axis2">
        <delete file="${basedir}/src/main/java/si/arnes/ozwizardlu/soap/OzwizardluStub.java"/>
        <delete file="${basedir}/src/main/java/si/arnes/ozwizardlu/soap/Ozwizardlu.java"/>
        <!-- make service classes -->
        <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
            <classpath refid="axis2.lib.dir"/>
            <arg value="-uri"/>
            <arg file="axis2/wsdl/OZWIZARD_LU.wsdl"/>
            <arg value="-p"/>
            <arg value="si.arnes.ozwizardlu.soap"/>
            <arg value="-Ebindingfile"/>
            <arg value="jibx/binding.xml"/>
            <arg value="-d"/>
            <arg value="jibx"/>
            <arg value="-s"/>
            <arg value="-uw"/>
            <arg value="-S"/>
            <arg value="./src"/>
        </java>
</target> 

But with this maven-plugin for 
<phase>generate-sources</phase>
<goals>
	<goal>wsdl2code</goal>
</goals> 

I can't figure it out, hove to achieve the same effect, my pom is:

<plugin>
  <groupId>org.apache.axis2</groupId>
  <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
  <version>1.5.4</version>
  <executions>
   <execution>
    <phase>generate-sources</phase>
    <goals>
     <goal>wsdl2code</goal>
    </goals>
    <configuration>
    <packageName>si.arnes.ozwizardlu.soap</packageName>                      
                                   
    <wsdlFile>src/main/resources/axis2/wsdl/OZWIZARD_LU.wsdl</wsdlFile>
    <namespaceURIs>
     <namespaceURI>
      <uri>http://arnes.si/ozwizard-lu</uri>             <packageName>si.arnes.ozwizardlu.soap</packageName>
                           		                            		                            		
     </namespaceURI>                            	
     <namespaceURI>
      <uri>http://www.w3.org/2001/XMLSchema</uri>
      <packageName>org.w3.www._2001.xmlschema</packageName>
     </namespaceURI>
     <namespaceURI>
       <uri>http://schemas.xmlsoap.org/wsdl/soap</uri>
       <packageName>org.xmlsoap.schemas.wsdl.soap</packageName>
     </namespaceURI>
     <namespaceURI>
      <uri>http://schemas.xmlsoap.org/wsdl</uri>
      <packageName>org.xmlsoap.schemas.wsdl</packageName>
     </namespaceURI>
    </namespaceURIs>
    <serviceName>ozwizardlu</serviceName
 <databindingName>jibx</databindingName>                                     
                                                                                         
                                                                                         
                                                                                         
  
    <options>
     <property>
       <name>bindingfile</name>
       <value>src/main/resources/axis2/jibx/binding.xml</value>              
             		
     </property>
     <property>
      <name>uri</name>
      <value>si.arnes.ozwizardlu.soap</value>                            		
     </property>
    </options>
  </configuration>
 </execution>
</executions>  			
</plugin> 

And I'm getting error:

No mapping defined for element {http://arnes.si/ozwizard-lu}sifrantVmesAddToUsmerTPRequest
--> this is only in WSDL and not in binding.xml


binding.xml:

<binding force-classes="true" xmlns:tns="http://arnes.si/ozwizard-lu">

  <namespace uri="http://arnes.si/ozwizard-lu" default="elements"/>
  
  <mapping abstract="true" class="si.arnes.ozwizardlu.soap.transfer.OpuUser" type-name="tns:arisUser">
   	<value name="username" field="username" get-method="getUsername" set-method="setUsername"
usage="optional"/>
   	<value name="uid" field="uid" get-method="getUid" set-method="setUid" usage="optional"/>
       
    <value name="gid" field="gid" get-method="getGid" set-method="setGid" usage="optional"/>
           
    <value name="grupa" field="grupa" get-method="getGrupa" set-method="setGrupa" usage="optional"/>
  
    <value name="ime" field="ime" get-method="getIme" set-method="setIme" usage="optional"/>
    <value name="priimek" field="priimek" get-method="getPriimek" set-method="setPriimek"
usage="optional"/>            
  </mapping>


So my questions are:

 - how to define flags like in ant task, is it possible?
 - how to suppress this element {http://arnes.si/ozwizard-lu} or is this ok
 - how to achieve, that the only element's in binding.xml (tns) are mapped from WSDL(xsd:complexType),
not all requets and response elements in WSDL
 - do I need to do pre-compile with jibx or what




> wsdl2java  JiBX code generator and -Ebindingfile option unavailable in ant task
> -------------------------------------------------------------------------------
>
>                 Key: AXIS2-2088
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2088
>             Project: Axis2
>          Issue Type: Bug
>          Components: codegen
>    Affects Versions: 1.1.1
>         Environment: Windows XP SP2, jre 1.5 update 10, and 1.7.0
>            Reporter: Jorge Fernández
>            Assignee: Dennis Sosnoski
>         Attachments: LoginServiceJiBX.wsdl, ReturnWebLoginElement.java, WebLoginElement.java,
binding.xml, build.xml, new_binding.xml
>
>
> First the little question:  is there any way for passing the -Ebindingfile in the ant
task of wsdl2java? because I didn't find it.
> The big one: I'm having a problem with wsdl2java code generation. I'm trying JiBX databinding
in wrapped mode. I've got my objects defined, my wsdl definition of the service and  I made
my binding definition manually. I also made an ant task, following the steps of the jibx tutorial.
I generated the binding definition with JiBX tools.
> This is the problem:
> When I use the ant task for compiling the binding definition with the build.xml, everything
seems to go alright. After that, I would have to type some code for running the service and
that's why I decided to use wsdl2java.  When I use wsdl2java for code generation I get this
error:
> I use the command like this:
> wsdl2java -uri LoginServiceJiBX.wsdl -o src\ -p loginjibx -ss -sd -d jibx -g -sn LoginServiceJiBX
-pn LoginEndpointPort -ns2p http://login=login,http://www.w3.org/2001/XMLSchema=org.w3.www._2001.xmlschema,http://login/types=login.types,http:/
> /schemas.xmlsoap.org/wsdl/soap=org.xmlsoap.schemas.wsdl.soap,http://schemas.xmls
> oap.org/wsdl=org.xmlsoap.schemas.wsdl -ssi -Ebindingfile binding.xml
> This is the trace:
> Using AXIS2_HOME:   D:\Programas\PFC\axis2-1.1.1
> Using JAVA_HOME:    D:\Programas\Java\jdk1.5.0_09
> Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException
> : java.lang.NullPointerException
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener
> ationEngine.java:224)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.NullPointerException
>         at org.jibx.runtime.impl.StAXReaderWrapper.getNamespace(StAXReaderWrappe
> r.java:455)
>         at org.jibx.runtime.impl.UnmarshallingContext.getNamespaceUri(Unmarshall
> ingContext.java:3125)
>         at org.jibx.runtime.QName.deserialize(QName.java:234)
>         at org.jibx.binding.model.MappingElement.setQualifiedTypeName(MappingEle
> ment.java:261)
>         at org.jibx.binding.model.MappingElement.JiBX_binding_unmarshalAttr_5_0(
> MappingElement.java)
>         at org.jibx.binding.model.JiBX_bindingMappingElement_access.unmarshal()
>         at org.jibx.binding.model.BindingElement.JiBX_binding_unmarshal_3_0(Bind
> ingElement.java)
>         at org.jibx.binding.model.JiBX_bindingBindingElement_access.unmarshal()
>         at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unmarshal
> lingContext.java:2538)
>         at org.jibx.binding.model.BindingElement.readBinding(BindingElement.java
> :609)
>         at org.jibx.binding.model.BindingElement.readBinding(BindingElement.java
> :625)
>         at org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtil
> ity.java:240)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExte
> nsion.java:74)
>         at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener
> ationEngine.java:177)
>         ... 2 more
> I made it also in unwrapped mode and there was no problem with that.

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

       

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


Mime
View raw message