facebook

XFire plugin using XMLBeans

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #257741 Reply

    mannpr
    Member

    I need some guidence. I am trying to generate XMLBeans bindings using the XFire tools and I am not having any luck. I have a valid WSDL file and I am trying to generate my web service using a Contract First approach. I know the WSDL is valid because I can generate the service using AXIS2.

    Here is my question, do I need to generate the XMLBean first or does the myEclipse tooling generate the necessary XMLBeans for me. With AXIS, the XMLBeans are generated for me. I have generated the XMLBeans and placed the jar file in my classpath but that didn’t seem to work.

    Here is the Log file showing the error message I am getting when I simply have a WSDL and I try to generate the service using XMLBeans bindings:

    Error
    Mon Aug 28 11:00:55 MDT 2006
    Error generating services

    java.lang.NullPointerException
    at org.apache.xmlbeans.impl.common.QNameHelper.hexsafedir(QNameHelper.java:176)
    at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl.typeSystemForComponent(SchemaTypeLoaderImpl.java:249)
    at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl.findDocumentTypeRef(SchemaTypeLoaderImpl.java:430)
    at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.findDocumentType(SchemaTypeLoaderBase.java:129)
    at org.codehaus.xfire.gen.xmlbeans.XmlBeansSchemaSupport.getType(XmlBeansSchemaSupport.java:50)
    at org.codehaus.xfire.gen.xmlbeans.XmlBeansSchemaSupport.getType(XmlBeansSchemaSupport.java:24)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generateOperation(AbstractServiceGenerator.java:140)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:98)
    at org.codehaus.xfire.gen.jsr181.ServiceInterfaceGenerator.generate(ServiceInterfaceGenerator.java:43)
    at org.codehaus.xfire.gen.jsr181.AbstractServiceGenerator.generate(AbstractServiceGenerator.java:53)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:125)
    at com.genuitec.eclipse.ws.xfire.generator.WSGenJob.run(WSGenJob.java:59)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    Here is my environment:

    Windows XP – SP2,
    Eclipse 3.2
    MyEclipse 5.0.1 GA

    Any and all help would be greatly appreciated.

    #257757 Reply

    Riyad Kalla
    Member

    Are you having a problem trying to run the generated client, or are you saying the generation fails at some point? Also, is the WSDL file long, can you post it so I can reproduce the issue locally? (please wrap it on code blocks, button at bottom, so it retains it’s formatting)

    #257792 Reply

    mannpr
    Member

    I am getting an error trying to generate Java Code from this WSDL using XMLBeans bindings:

    
     <!--WSDL generated by thinktecture WSCF; version 0.6.6034.1-->
    <!--Tuesday, 29-08-2006 - 09:03 AM-->
    <definitions xmlns:tns="http://xfire.codehaus.org/webservice"
        xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:import0="http://xfire.codehaus.org/data"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PersonService"
        targetNamespace="http://xfire.codehaus.org/webservice"
        xmlns="http://schemas.xmlsoap.org/wsdl/">
        <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
            Person Service
        </wsdl:documentation>
        <types>
            <xs:schema attributeFormDefault="unqualified"
                elementFormDefault="qualified"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                targetNamespace="http://xfire.codehaus.org/data"
                xmlns="http://xfire.codehaus.org/data">
                <xs:element name="personRequest">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="id" type="xs:int" />
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="personResponse">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="person">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="id" type="xs:int" />
                                        <xs:element name="firstname"
                                            type="xs:string" />
                                        <xs:element name="lastname"
                                            type="xs:string" />
                                        <xs:element name="DOB"
                                            type="xs:date" />
                                        <xs:element name="height"
                                            type="xs:string" />
                                        <xs:element name="weight"
                                            type="xs:int" />
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:schema>
        </types>
        <message name="personIn">
            <wsdl:documentation
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
            <part name="messagePart" element="import0:personRequest" />
        </message>
        <message name="personOut">
            <wsdl:documentation
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
            <part name="messagePart" element="import0:personResponse" />
        </message>
        <portType name="PersonServiceInterface">
            <wsdl:documentation
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
                Person Service
            </wsdl:documentation>
            <operation name="person">
                <wsdl:documentation
                    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
                <input message="tns:personIn" />
                <output message="tns:personOut" />
            </operation>
        </portType>
        <binding name="PersonService" type="tns:PersonServiceInterface">
            <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
            <operation name="person">
                <soap:operation
                    soapAction="http://xfire.codehaus.org/webservice:personIn"
                    style="document" />
                <input>
                    <soap:body use="literal" />
                </input>
                <output>
                    <soap:body use="literal" />
                </output>
            </operation>
        </binding>
        <binding name="PersonServiceSoap12"
            type="tns:PersonServiceInterface">
            <soap12:binding
                transport="http://schemas.xmlsoap.org/soap/http" />
            <operation name="person">
                <soap12:operation
                    soapAction="http://xfire.codehaus.org/webservice:personIn"
                    style="document" />
                <input>
                    <soap12:body use="literal" />
                </input>
                <output>
                    <soap12:body use="literal" />
                </output>
            </operation>
        </binding>
        <service name="PersonServicePort">
            <port name="PersonServicePort" binding="tns:PersonService">
                <soap:address
                    location="http://localhost:8080/services/XFire1" />
            </port>
            <port name="PersonServiceSOAP12Port"
                binding="tns:PersonServiceSoap12">
                <soap12:address
                    location="http://localhost:8080/services/XFire1" />
            </port>
        </service>
    </definitions>
    
    
    #257886 Reply

    Riyad Kalla
    Member

    Sorry for the delayed response, we tested your example and it does seem to be a bug, we have filed the issue in our issue tracker to get fixed.

    #257910 Reply

    mannpr
    Member

    Thanks guys,

    Is there any way to track this issue – possibly find out when it may be fixed?

    #257930 Reply

    Riyad Kalla
    Member

    Not at this time, our issue tracker is internal because we use it to track more than just MyEclipse issues.

    #262850 Reply

    Mark Ricard
    Member

    We have the same exact NullPointerException with our WSDL when we try to import it in to create a client. Here is our WSDL:

    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="Service"
     targetNamespace="http://localhost:80/Service.wsdl"
     xmlns:tns="http://localhost:80/Service.wsdl"
     xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:IDSP="http://ns.adobe.com/InDesign/soap/"
     xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
     xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
     xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
     xmlns="http://schemas.xmlsoap.org/wsdl/">
    
    <types>
    
     <schema targetNamespace="http://ns.adobe.com/InDesign/soap/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:IDSP="http://ns.adobe.com/InDesign/soap/"
      xmlns="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="unqualified"
      attributeFormDefault="unqualified">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <simpleType name="Enumeration">
       <restriction base="xsd:long">
       </restriction>
      </simpleType>
      <simpleType name="Unit">
       <restriction base="xsd:double">
       </restriction>
      </simpleType>
      <complexType name="IDSP-ScriptArg">
       <sequence>
         <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
         <element name="value" type="xsd:string" minOccurs="1" maxOccurs="1"/>
       </sequence>
      </complexType>
      <complexType name="RunScriptParameters">
       <sequence>
         <element name="scriptText" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
         <element name="scriptLanguage" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
         <element name="scriptFile" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
         <element name="scriptArgs" type="IDSP:IDSP-ScriptArg" minOccurs="0" maxOccurs="unbounded"/>
       </sequence>
      </complexType>
      <complexType name="Data">
       <sequence>
         <element name="data" type="xsd:anyType" minOccurs="1" maxOccurs="1" nillable="false"/>
       </sequence>
      </complexType>
      <complexType name="List">
       <sequence>
        <element name="item" type="IDSP:Data" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
       </sequence>
      </complexType>
      <complexType name="Object">
       <sequence>
         <element name="specifierData" type="xsd:anyType" minOccurs="1" maxOccurs="1" nillable="false"/>
         <element name="objectType" type="xsd:unsignedLong" minOccurs="1" maxOccurs="1"/>
         <element name="specifierForm" type="xsd:unsignedLong" minOccurs="1" maxOccurs="1"/>
         <element name="start" type="IDSP:Object" minOccurs="0" maxOccurs="1" nillable="true"/>
         <element name="end" type="IDSP:Object" minOccurs="0" maxOccurs="1" nillable="true"/>
       </sequence>
      </complexType>
      <complexType name="ObjectList">
       <sequence>
        <element name="item" type="IDSP:Object" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
       </sequence>
      </complexType>
      <complexType name="Field">
       <sequence>
         <element name="id" type="xsd:unsignedLong" minOccurs="1" maxOccurs="1"/>
         <element name="data" type="IDSP:Data" minOccurs="0" maxOccurs="1" nillable="true"/>
       </sequence>
      </complexType>
      <complexType name="Record">
       <sequence>
        <element name="item" type="IDSP:Field" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
       </sequence>
      </complexType>
      <!-- operation request element -->
      <element name="RunScript">
       <complexType>
        <sequence>
         <element name="runScriptParameters" type="IDSP:RunScriptParameters" minOccurs="0" maxOccurs="1" nillable="true"/>
        </sequence>
       </complexType>
      </element>
      <!-- operation response element -->
      <element name="RunScriptResult">
       <complexType>
        <sequence>
         <element name="errorNumber" type="xsd:int" minOccurs="1" maxOccurs="1"/>
         <element name="errorString" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
         <element name="scriptResult" type="IDSP:Data" minOccurs="0" maxOccurs="1" nillable="true"/>
        </sequence>
       </complexType>
      </element>
     </schema>
    
    </types>
    
    <message name="RunScriptRequest">
     <part name="parameters" element="IDSP:RunScript"/>
    </message>
    
    <message name="RunScriptResult">
     <part name="parameters" element="IDSP:RunScriptResult"/>
    </message>
    
    <portType name="ServicePortType">
     <operation name="RunScript">
      <documentation>Service definition of function IDSP__RunScript</documentation>
      <input message="tns:RunScriptRequest"/>
      <output message="tns:RunScriptResult"/>
     </operation>
    </portType>
    
    <binding name="Service" type="tns:ServicePortType">
     <SOAP:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
     <operation name="RunScript">
      <SOAP:operation soapAction=""/>
      <input>
       <SOAP:body use="literal"/>
      </input>
      <output>
       <SOAP:body use="literal"/>
      </output>
     </operation>
    </binding>
    
    <service name="Service">
     <documentation>gSOAP 2.7.0c generated service definition</documentation>
     <port name="Service" binding="tns:Service">
      <SOAP:address location="http://localhost:80"/>
     </port>
    </service>
    
    </definitions>
    
    #262851 Reply

    Mark Ricard
    Member

    Has there been any progress on this bug?

    #262855 Reply

    Riyad Kalla
    Member

    Mark,
    Thank you for the example file. I’m adding it to the list of problomatic WSDL’s that the WS team is working on. I asked them for an update.

    #264443 Reply

    mannpr
    Member

    Hello,

    I started this thread back in August. I just loaded the latest version of MyEclipse and this problem is still there. Are you guys still planning on fixing this? If so, do you have a timeframe?

    Thanks

    #264562 Reply

    Brian Fernandes
    Moderator

    mannpr & Mark,

    I apologize for the late response. This issue has been isolated and fixed, the fix will be available in the upcoming 5.5M1 release which is due in a couple of weeks.
    To answer your initial question, MyEclipse will generate the XMLBeans for you and you don’t need to use an external tool to do this.

    If possible / convenient, the Web Services team would be interested in why you are using XMLBeans for binding instead of JAXB.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: XFire plugin using XMLBeans

You must be logged in to post in the forum log in