0 Replies Latest reply on Sep 27, 2007 5:00 AM by C B

    JBossWS and Axis2

    C B Newbie

      Hello,

      First of all, i would apologize for my bad english.

      I'm trying to generate a JBossWS client from the sample "Version" service of Axis2 but I have errors.
      I'm using :
      - JBoss AS 4.2.1 with jbossws-native-2.0.1.GA
      - Axis2 1.3

      I'm running this command line :

      <JBOSS421_DIR>\bin> wsconsume http://localhost:8085/axis2/services/Version?wsdl
      


      And I obtains this error :
      parsing WSDL...
      
      [ERROR] A class/interface with the same name "sample.axisversion.Exception" is a
      lready in use. Use a class customization to resolve this conflict.
       line 11 of http://localhost:8085/axis2/services/Version?wsdl
      
      [ERROR] (Relevant to above error) another "Exception" is generated from here.
       line 6 of http://localhost:8085/axis2/services/Version?wsdl
      
      [ERROR] Two declarations cause a collision in the ObjectFactory class.
       line 11 of http://localhost:8085/axis2/services/Version?wsdl
      
      [ERROR] (Related to above error) This is the other declaration.
       line 6 of http://localhost:8085/axis2/services/Version?wsdl
      
      [ERROR] Two declarations cause a collision in the ObjectFactory class.
       line 14 of http://localhost:8085/axis2/services/Version?wsdl
      
      [ERROR] (Related to above error) This is the other declaration.
       line 8 of http://localhost:8085/axis2/services/Version?wsdl
      


      This is the Version.wsdl :
      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
      xmlns:ns0="http://axisversion.sample"
      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
      xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
      xmlns:ns1="http://org.apache.axis2/xsd"
      xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      targetNamespace="http://axisversion.sample">
       <wsdl:documentation>Version</wsdl:documentation>
       <wsdl:types>
       <xs:schema xmlns:ns="http://axisversion.sample" attributeFormDefault="qualified"
      elementFormDefault="qualified" targetNamespace="http://axisversion.sample">
       <xs:complexType name="Exception">
       <xs:sequence>
       <xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType"/>
       </xs:sequence>
       </xs:complexType>
       <xs:element name="Exception">
       <xs:complexType>
       <xs:sequence>
       <xs:element minOccurs="0" name="Exception" nillable="true" type="ns:Exception"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="getVersionResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       </xs:schema>
       </wsdl:types>
       <wsdl:message name="getVersionRequest"/>
       <wsdl:message name="getVersionResponse">
       <wsdl:part name="parameters" element="ns0:getVersionResponse"/>
       </wsdl:message>
       <wsdl:message name="Exception">
       <wsdl:part name="parameters" element="ns0:Exception"/>
       </wsdl:message>
       <wsdl:portType name="VersionPortType">
       <wsdl:operation name="getVersion">
       <wsdl:input message="ns0:getVersionRequest" wsaw:Action="urn:getVersion"/>
       <wsdl:output message="ns0:getVersionResponse" wsaw:Action="urn:getVersionResponse"/>
       <wsdl:fault message="ns0:Exception" name="Exception" wsaw:Action="urn:getVersionException"/>
       </wsdl:operation>
       </wsdl:portType>
       <wsdl:binding name="VersionSOAP11Binding" type="ns0:VersionPortType">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
       <wsdl:operation name="getVersion">
       <soap:operation soapAction="urn:getVersion" style="document"/>
       <wsdl:input>
       <soap:body use="literal"/>
       </wsdl:input>
       <wsdl:output>
       <soap:body use="literal"/>
       </wsdl:output>
       <wsdl:fault name="Exception">
       <soap:fault use="literal" name="Exception"/>
       </wsdl:fault>
       </wsdl:operation>
       </wsdl:binding>
       <wsdl:binding name="VersionSOAP12Binding" type="ns0:VersionPortType">
       <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
       <wsdl:operation name="getVersion">
       <soap12:operation soapAction="urn:getVersion" style="document"/>
       <wsdl:input>
       <soap12:body use="literal"/>
       </wsdl:input>
       <wsdl:output>
       <soap12:body use="literal"/>
       </wsdl:output>
       <wsdl:fault name="Exception">
       <soap12:fault use="literal" name="Exception"/>
       </wsdl:fault>
       </wsdl:operation>
       </wsdl:binding>
       <wsdl:binding name="VersionHttpBinding" type="ns0:VersionPortType">
       <http:binding verb="POST"/>
       <wsdl:operation name="getVersion">
       <http:operation location="Version/getVersion"/>
       <wsdl:input>
       <mime:content type="text/xml" part="getVersion"/>
       </wsdl:input>
       <wsdl:output>
       <mime:content type="text/xml" part="getVersion"/>
       </wsdl:output>
       </wsdl:operation>
       </wsdl:binding>
       <wsdl:service name="Version">
       <wsdl:port name="VersionSOAP11port_http" binding="ns0:VersionSOAP11Binding">
       <soap:address location="http://localhost:8085/axis2/services/Version"/>
       </wsdl:port>
       <wsdl:port name="VersionSOAP12port_http" binding="ns0:VersionSOAP12Binding">
       <soap12:address location="http://localhost:8085/axis2/services/Version"/>
       </wsdl:port>
       <wsdl:port name="VersionHttpport" binding="ns0:VersionHttpBinding">
       <http:address location="http://localhost:8085/axis2/services/Version"/>
       </wsdl:port>
       </wsdl:service>
      </wsdl:definitions>
      



      Is it possible to use JBossWS to invoke an Axis2 WebService ?
      If yes, is it possible to use @WebServiceRef to point on a Axis2 WebService ?

      Example :
      @Stateless
      @WebService
      public class MyService implements IMyService
      {
       @WebServiceRef(name="Version", wsdlLocation="http://localhost:8085/axis2/services/Version?wsdl")
       private Service axisService;
      
       @WebMethod
       public String myMethod()
       {
       ...
       }
       ...
      }
      


      Any help will be appreciate