To add to what Anne said, you're using a version of axis from May 05,
2006 . While that may be the official 1.0 release, there were several
important bugs fixed for xmlbeans after that.
The good news is that this is the code that I was able to produce from
the latest nightly:
/**
* FServiceSkeleton.java
*
* This file was auto-generated from WSDL
* by the Apache Axis2 version: SNAPSHOT Jun 20, 2006 (11:24:21 GMT+00:00)
*/
package org.simple.endpoint;
/**
* FServiceSkeleton java skeleton for the axisService
*/
public class FServiceSkeleton{
/**
* Auto generated method signature
* @param param0
*/
public org.apache.xmlbeans.XmlObject acceptFEvent
(org.apache.xmlbeans.XmlObject param0 )
throws org.simple.endpoint.FServiceSkeleton.GeneralFaultException{
//Todo fill this with the necessary business logic
throw new java.lang.UnsupportedOperationException();
}
/**
* Auto generated method signature
* @param param4
*/
public org.apache.xmlbeans.XmlObject acceptFRecap
(org.apache.xmlbeans.XmlObject param4 )
throws org.simple.endpoint.FServiceSkeleton.GeneralFaultException{
//Todo fill this with the necessary business logic
throw new java.lang.UnsupportedOperationException();
}
public static class GeneralFaultException extends
java.rmi.RemoteException{
private
com.example.www.wsdl._2006_06_13.carsfault.GeneralFaultDocument
faultMessage;
public void
setFaultMessage(com.example.www.wsdl._2006_06_13.carsfault.GeneralFaultDocument
msg){
faultMessage = msg;
}
public
com.example.www.wsdl._2006_06_13.carsfault.GeneralFaultDocument
getFaultMessage(){
return faultMessage;
}
}
}
This is the ant task I used to do it:
<target name="wsdl2java" depends="clean,prepare">
<delete dir="output" />
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="axis.classpath"/>
<arg value="-d"/>
<arg value="xmlbeans"/>
<arg value="-uri"/>
<!--
<arg file="wsdl/simple.wsdl"/>
-->
<arg file="wsdl/ahelp.wsdl"/>
<arg value="-ss"/>
<arg value="-g"/>
<arg value="-sd"/>
<arg value="-o"/>
<arg file="output"/>
<arg value="-p"/>
<arg value="org.simple.endpoint"/>
</java>
<!-- Move the schema folder to classpath-->
<move todir="${build.classes}">
<fileset dir="output/resources">
<include name="*schema*/**/*.class"/>
<include name="*schema*/**/*.xsb"/>
</fileset>
</move>
</target>
HTH,
Robert
http://www.braziloutsource.com/
On 6/20/06, Anne Thomas Manes <[EMAIL PROTECTED]> wrote:
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]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]