Title: Message
Thanks for the reply, Anne.
 
Unfortunately, the problem still occurs even if I comment out the xs:any instances, so that does not appear to be the cause of what I am seeing.

Derek
-----Original Message-----
From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 20, 2006 5:10 PM
To: axis-user@ws.apache.org; [EMAIL PROTECTED]
Subject: Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?

I suspect it's because you have xs:any in your schema. Since WSDL2Java doesn't know what will be in the message, it defaults to OMElement.

Anne

On 6/20/06, Derek <[EMAIL PROTECTED]> wrote:
I'm getting rather frustrated trying to use Axis2 to do something apparently
pretty basic.

Using the WSDL and schema below, and the given WSDL2Java command line, I get
XMLBeans classes generated.
However, the generated skeleton methods take parameters of type OMElement
and return a result of type OMElement, instead of using the generated
XMLBeans wrapper classes. Also, some of the code does not compile, trying to
call methods on OMElement that do not exists. I get no errors reported when
I run WSDL2Java, though.

Does anybody know what I might be doing wrong? This example seems only
slightly more complicated than the ones that exist in the Axis2 user's
guide.

Thanks in advance for any replies.

The WSDL:

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="FDefinitions"
   targetNamespace=" http://www.example.com/wsdl/2004-10-01/feu"
   xmlns:carshdr="http://www.example.com/wsdl/2004-10-01/cars"
   xmlns:carsfault=" http://www.example.com/wsdl/2006-06-13/carsfault"
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
   xmlns:tns=" http://www.example.com/wsdl/2004-10-01/feu"
   xmlns:feu="http://www.dummy-temp-address"
   xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:soapenc=" http://schemas.xmlsoap.org/soap/encoding/"
   xmlns="http://schemas.xmlsoap.org/wsdl/">

   <wsdl:types>
      <xs:schema>
         <xs:import namespace=" http://www.dummy-temp-address"
schemaLocation="FEU.xsd"/>
      </xs:schema>
      <xs:schema
targetNamespace=" http://www.example.com/wsdl/2004-10-01/feu">
         <xs:element name="full-event-updates">
            <xs:complexType>
               <xs:sequence>
                  <xs:element name="full-event-update"
type="feu:FullEventUpdate" minOccurs="0" maxOccurs="unbounded"/>
               </xs:sequence>
            </xs:complexType>
         </xs:element>
         <xs:element name="full-event-update" type="feu:FullEventUpdate"/>
         <xs:element name="return" type="xs:string"/>
      </xs:schema>
      <xs:schema
targetNamespace="http://www.example.com/wsdl/2004-10-01/cars ">
         <xs:element name="CPassword" type="xs:string"/>
         <xs:element name="CLogin" type="xs:string"/>
      </xs:schema>
      <xs:schema
targetNamespace="http://www.example.com/wsdl/2006-06-13/carsfault">
         <xs:element name="generalFault" type="xs:string"/>
      </xs:schema>
   </wsdl:types>

   <message name="FEvent">
      <part name="contents" element="tns:full-event-update"/>
   </message>

   <message name="FRecap">
      <part name="contents" element="tns:full-event-updates"/>
   </message>

   <message name="FResponse">
      <part name="return" element="tns:return"/>
   </message>

   <message name="CPassword">
      <part name="CPassword" element="carshdr:CPassword"/>
   </message>

   <message name="CLogin">
      <part name="CLogin" element="carshdr:CLogin"/>
   </message>

   <message name="GeneralFault">
      <part name="faultDetail" element="carsfault:generalFault"/>
   </message>

   <portType name="FPortType">
      <documentation>F Port Type</documentation>

      <operation name="acceptFEvent" parameterOrder="contents">
         <input name="acceptFEventRequest" message="tns:FEvent"/>
         <output name="acceptFEventResponse" message="tns:FResponse"/>
         <fault name="GeneralFault" message="tns:GeneralFault"/>
      </operation>

      <operation name="acceptFRecap" parameterOrder="contents">
         <input name="acceptFRecapRequest" message="tns:FRecap"/>
         <output name="acceptFRecapResponse" message="tns:FResponse"/>
         <fault name="GeneralFault" message="tns:GeneralFault"/>
      </operation>
   </portType>

   <binding name="FSoapBinding" type="tns:FPortType">
      <documentation>F Soap Binding</documentation>
      <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>

      <operation name="acceptFEvent">
         <soap:operation soapAction="acceptFEventAction"/>
         <input>
            <soap:header message="tns:CLogin" part="CLogin" use="literal"/>
            <soap:header message="tns:CPassword" part="CPassword"
use="literal"/>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="GeneralFault">
            <soap:fault name="GeneralFault" use="literal"/>
         </fault>
      </operation>

      <operation name="acceptFRecap">
         <soap:operation soapAction="acceptFRecapAction"/>
         <input>
            <soap:header message="tns:CLogin" part="CLogin" use="literal"/>
            <soap:header message="tns:CPassword" part="CPassword"
use="literal"/>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="GeneralFault">
            <soap:fault name="GeneralFault" use="literal"/>
         </fault>
      </operation>
   </binding>

   <service name="FService">
      <documentation>F Web Service</documentation>
      <port name="FPort" binding="tns:FSoapBinding">
         <soap:address
location="http://localhost:8080/axis/services/FService"/>
      </port>
   </service>
</definitions>

The schema:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema targetNamespace="http://www.dummy-temp-address"
           xmlns=" http://www.dummy-temp-address"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"

xmlns:cars=" http://www.crc-corp.com/schemas/cars/schema_annotation"

           elementFormDefault="unqualified"
           attributeFormDefault="unqualified"
           version="DRAFT">

   <xs:element name="full-event-update" type="FullEventUpdate"/>

   <xs:complexType name="FullEventUpdate">
      <xs:sequence>
         <xs:element name="message-header" type="MessageHeader"/>
         <xs:element name="event-reference" type="EventReference"/>
         <xs:any/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="MessageHeader">
      <xs:sequence>
         <xs:any/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="EventReference">
      <xs:sequence>
         <xs:element name="event-id" type="xs:string"/>
         <xs:element name="update" type="xs:unsignedInt"/>
         <xs:element name="response-plan-id" type="xs:string"
minOccurs="0"/>
      </xs:sequence>
   </xs:complexType>
</xs:schema>



The WSDL command line:

   WSDL2Java --databinding-method xmlbeans
             --uri FEUImport.wsdl
             --server-side
             --generate-all
             --service-description
             --output generatedSrc
             --package crc.feuimport.wsdl2java

The skeleton interface that is getting generated:


    /**
     * FEUServiceSkeletonInterface.java
     *

       * This file was auto-generated from WSDL
     * by the Apache Axis2 version: 1.0 May 05, 2006 (12:31:13 IST)
     */
    package crc.feuimport.wsdl2java;
    /**
     *  FServiceSkeletonInterface java skeleton interface for the
axisService
     */
    public interface FServiceSkeletonInterface {


        /**
         * Auto generated method signature

          * @param param0

         */
        public  org.apache.axiom.om.OMElement acceptFEURecap
                  (org.apache.axiom.om.OMElement param0 )

           throws
crc.feuimport.wsdl2java.FServiceSkeleton.GeneralFaultException;


        /**
         * Auto generated method signature

          * @param param4

         */
        public  org.apache.axiom.om.OMElement acceptFEUEvent
                  (org.apache.axiom.om.OMElement param4 )

           throws
crc.feuimport.wsdl2java.FServiceSkeleton.GeneralFaultException ;

    }

The following code appears in the generated
FServiceMessageReceiverInOut.java, which will not compile because there is
no such method as
newXMLStreamReader() on OMObject:

                private   org.apache.axiom.om.OMElement
toOM(org.apache.axiom.om.OMElement param, boolean optimizeContent){
                org.apache.axiom.om.impl.builder.StAXOMBuilder builder = new
org.apache.axiom.om.impl.builder.StAXOMBuilder
                (org.apache.axiom.om.OMAbstractFactory.getOMFactory(),new
org.apache.axis2.util.StreamWrapper(param.newXMLStreamReader())) ;
                 org.apache.axiom.om.OMElement documentElement =
builder.getDocumentElement ();



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to