RE: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?
OK. I created the following: http://issues.apache.org/jira/browse/AXIS2-844 Thanks. Derek -Original Message- From: Davanum Srinivas [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 21, 2006 7:15 PM To: axis-user@ws.apache.org; [EMAIL PROTECTED] Subject: Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code? Yes, Please log a JIRA bug. thanks, dims On 6/21/06, Derek [EMAIL PROTECTED] wrote: Thanks for the suggestion, Robert. I tried downloading the June 21 nightly build of Axis, and that version of WSDL2Java did produce the same skeleton files for me that it did for you (the ones taking an XmlObject parameter, rather than OMObject as I was getting with the 1.0 release). I then tried to test your hypothesis about xs:any. I modified my XML schema to comment out the two xs:any tags. I then ran WSDL2Java and regenerated the files. I got the same generated skeleton files as before. After pounding my head against the keyboard vigorously for a while, I decided to start drastically simplifying the WSDL to try to find out what was going wrong. Eventually, I found a change that made the problem go away. I still don't understand why, though. One of my xs:schema declarations in my WSDL has the same namespace as the targetNamespace declared at the top of the WSDL file itself. It declares three elements: full-event-update, full-event-updates, and return, which are referenced in the FEvent, FRecap, and FResponse messages. When I change the WSDL so this schema is declared to instead have a different namespace from the WSDL targetNamespace, then the generated signature I get for my method is: /** * FEUServiceSkeletonInterface java skeleton interface for the axisService */ public interface FEUServiceSkeletonInterface { /** * Auto generated method signature * @param param0 */ public com.crc_corp.www.wsdl._2004_10_01.feu2.ReturnDocument acceptFEUEvent (com.crc_corp.www.wsdl._2004_10_01.feu2.FullEventUpdateDocumen t param0 ) ; } So it seems to be the case that if a message references an XML element declaration which is in the same namespace as the targetNamespace of the WSDL file itself, then the XMLBeans WSDL2Java code generator decides for mysterious reasons of its own to pass those messages as XmlObject instances instead of the types that should be generated for the messages. Why this should be so, I have no idea. There seems to be no documentation or warnigns of any such behavior that I can find in the Axis documentation, so I assume this is a bug. Should I file this in Jira? Derek -Original Message- From: robert lazarski [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 5:38 PM To: axis-user@ws.apache.org Subject: Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code? Oops, a little late here and I misread the method signature. Getting XmlObject instead of OMElement probably isn't what you were hoping for, so perhaps as Anne implied xs:any is the culprit. Do keep in mind the bug fixes in the xmlbeans code since the 1.0 release, however. Good luck, Robert http://www.braziloutsource.com/ On 6/20/06, robert lazarski [EMAIL PROTECTED] wrote: 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
RE: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?
Thanks for the suggestion, Robert. I tried downloading the June 21 nightly build of Axis, and that version of WSDL2Java did produce the same skeleton files for me that it did for you (the ones taking an XmlObject parameter, rather than OMObject as I was getting with the 1.0 release). I then tried to test your hypothesis about xs:any. I modified my XML schema to comment out the two xs:any tags. I then ran WSDL2Java and regenerated the files. I got the same generated skeleton files as before. After pounding my head against the keyboard vigorously for a while, I decided to start drastically simplifying the WSDL to try to find out what was going wrong. Eventually, I found a change that made the problem go away. I still don't understand why, though. One of my xs:schema declarations in my WSDL has the same namespace as the targetNamespace declared at the top of the WSDL file itself. It declares three elements: full-event-update, full-event-updates, and return, which are referenced in the FEvent, FRecap, and FResponse messages. When I change the WSDL so this schema is declared to instead have a different namespace from the WSDL targetNamespace, then the generated signature I get for my method is: /** * FEUServiceSkeletonInterface java skeleton interface for the axisService */ public interface FEUServiceSkeletonInterface { /** * Auto generated method signature * @param param0 */ public com.crc_corp.www.wsdl._2004_10_01.feu2.ReturnDocument acceptFEUEvent (com.crc_corp.www.wsdl._2004_10_01.feu2.FullEventUpdateDocument param0 ) ; } So it seems to be the case that if a message references an XML element declaration which is in the same namespace as the targetNamespace of the WSDL file itself, then the XMLBeans WSDL2Java code generator decides for mysterious reasons of its own to pass those messages as XmlObject instances instead of the types that should be generated for the messages. Why this should be so, I have no idea. There seems to be no documentation or warnigns of any such behavior that I can find in the Axis documentation, so I assume this is a bug. Should I file this in Jira? Derek -Original Message- From: robert lazarski [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 5:38 PM To: axis-user@ws.apache.org Subject: Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code? Oops, a little late here and I misread the method signature. Getting XmlObject instead of OMElement probably isn't what you were hoping for, so perhaps as Anne implied xs:any is the culprit. Do keep in mind the bug fixes in the xmlbeans code since the 1.0 release, however. Good luck, Robert http://www.braziloutsource.com/ On 6/20/06, robert lazarski [EMAIL PROTECTED] wrote: 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.GeneralFaul tDocument msg){ faultMessage = msg; } public com.example.www.wsdl._2006_06_13.carsfault.GeneralFaultDocument getFaultMessage(){ return
Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?
Yes, Please log a JIRA bug. thanks, dims On 6/21/06, Derek [EMAIL PROTECTED] wrote: Thanks for the suggestion, Robert. I tried downloading the June 21 nightly build of Axis, and that version of WSDL2Java did produce the same skeleton files for me that it did for you (the ones taking an XmlObject parameter, rather than OMObject as I was getting with the 1.0 release). I then tried to test your hypothesis about xs:any. I modified my XML schema to comment out the two xs:any tags. I then ran WSDL2Java and regenerated the files. I got the same generated skeleton files as before. After pounding my head against the keyboard vigorously for a while, I decided to start drastically simplifying the WSDL to try to find out what was going wrong. Eventually, I found a change that made the problem go away. I still don't understand why, though. One of my xs:schema declarations in my WSDL has the same namespace as the targetNamespace declared at the top of the WSDL file itself. It declares three elements: full-event-update, full-event-updates, and return, which are referenced in the FEvent, FRecap, and FResponse messages. When I change the WSDL so this schema is declared to instead have a different namespace from the WSDL targetNamespace, then the generated signature I get for my method is: /** * FEUServiceSkeletonInterface java skeleton interface for the axisService */ public interface FEUServiceSkeletonInterface { /** * Auto generated method signature * @param param0 */ public com.crc_corp.www.wsdl._2004_10_01.feu2.ReturnDocument acceptFEUEvent (com.crc_corp.www.wsdl._2004_10_01.feu2.FullEventUpdateDocument param0 ) ; } So it seems to be the case that if a message references an XML element declaration which is in the same namespace as the targetNamespace of the WSDL file itself, then the XMLBeans WSDL2Java code generator decides for mysterious reasons of its own to pass those messages as XmlObject instances instead of the types that should be generated for the messages. Why this should be so, I have no idea. There seems to be no documentation or warnigns of any such behavior that I can find in the Axis documentation, so I assume this is a bug. Should I file this in Jira? Derek -Original Message- From: robert lazarski [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 5:38 PM To: axis-user@ws.apache.org Subject: Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code? Oops, a little late here and I misread the method signature. Getting XmlObject instead of OMElement probably isn't what you were hoping for, so perhaps as Anne implied xs:any is the culprit. Do keep in mind the bug fixes in the xmlbeans code since the 1.0 release, however. Good luck, Robert http://www.braziloutsource.com/ On 6/20/06, robert lazarski [EMAIL PROTECTED] wrote: 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.GeneralFaul tDocument msg){ faultMessage = msg; } public com.example.www.wsdl._2006_06_13.carsfault.GeneralFaultDocument getFaultMessage
[Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?
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 documentationF 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 documentationF 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 documentationF 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;
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.AnneOn 6/20/06, Derek [EMAIL PROTECTED] wrote: I'm getting rather frustrated trying to use Axis2 to do something apparentlypretty basic.Using the WSDL and schema below, and the given WSDL2Java command line, I getXMLBeans classes generated.However, the generated skeleton methods take parameters of type OMElement and return a result of type OMElement, instead of using the generatedXMLBeans wrapper classes. Also, some of the code does not compile, trying tocall 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 onlyslightly more complicated than the ones that exist in the Axis2 user'sguide.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:typesxs:schema xs:import namespace= http://www.dummy-temp-addressschemaLocation=FEU.xsd//xs:schemaxs:schematargetNamespace= http://www.example.com/wsdl/2004-10-01/feu xs:element name=full-event-updatesxs:complexType xs:sequencexs: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:schemaxs:schematargetNamespace=http://www.example.com/wsdl/2004-10-01/cars xs:element name=CPassword type=xs:string/ xs:element name=CLogin type=xs:string//xs:schemaxs:schema targetNamespace=http://www.example.com/wsdl/2006-06-13/carsfault xs:element name=generalFault type=xs:string/ /xs:schema /wsdl:types message name=FEventpart name=contents element=tns:full-event-update/ /message message name=FRecappart name=contents element=tns:full-event-updates/ /message message name=FResponsepart name=return element=tns:return/ /message message name=CPasswordpart name=CPassword element=carshdr:CPassword/ /message message name=CLogin part name=CLogin element=carshdr:CLogin/ /message message name=GeneralFaultpart name=faultDetail element=carsfault:generalFault/ /message portType name=FPortTypedocumentationF Port Type/documentationoperation name=acceptFEvent parameterOrder=contents input name=acceptFEventRequest message=tns:FEvent/ output name=acceptFEventResponse message=tns:FResponse/ fault name=GeneralFault message=tns:GeneralFault/ /operationoperation 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:FPortTypedocumentationF Soap Binding/documentationsoap:binding style=document transport=http://schemas.xmlsoap.org/soap/http/operation name=acceptFEvent soap:operation soapAction=acceptFEventAction/ inputsoap:header message=tns:CLogin part=CLogin use=literal/soap:header message=tns:CPassword part=CPassword use=literal/soap:body use=literal/ /input outputsoap:body use=literal/ /output fault name=GeneralFaultsoap:fault name=GeneralFault use=literal/ /fault/operationoperation name=acceptFRecap soap:operation soapAction=acceptFRecapAction/ inputsoap:header message=tns:CLogin part=CLogin use=literal/ soap:header message=tns:CPassword part=CPassworduse=literal/soap:body use=literal/ /input output soap:body use=literal/ /output fault name=GeneralFaultsoap:fault name=GeneralFault use=literal/ /fault/operation /binding service name=FServicedocumentationF Web Service/documentationport name=FPort binding=tns:FSoapBinding soap:addresslocation=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/XMLSchemaxmlns: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=FullEventUpdatexs: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=EventReferencexs:sequence xs:element name=event-id
RE: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?
Title: Message Thanks for the reply, Anne. Unfortunately, the problem stilloccurs 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 PMTo: 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 apparentlypretty basic.Using the WSDL and schema below, and the given WSDL2Java command line, I getXMLBeans classes generated.However, the generated skeleton methods take parameters of type OMElement and return a result of type OMElement, instead of using the generatedXMLBeans wrapper classes. Also, some of the code does not compile, trying tocall 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 onlyslightly more complicated than the ones that exist in the Axis2 user'sguide.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:typesxs:schema xs:import namespace=" http://www.dummy-temp-address"schemaLocation="FEU.xsd"//xs:schemaxs:schematargetNamespace=" http://www.example.com/wsdl/2004-10-01/feu" xs:element name="full-event-updates"xs:complexType xs:sequencexs: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:schemaxs:schematargetNamespace="http://www.example.com/wsdl/2004-10-01/cars " xs:element name="CPassword" type="xs:string"/ xs:element name="CLogin" type="xs:string"//xs:schemaxs: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"documentationF Port Type/documentationoperation name="acceptFEvent" parameterOrder="contents" input name="acceptFEventRequest" message="tns:FEvent"/ output name="acceptFEventResponse" message="tns:FResponse"/ fault name="GeneralFault" message="tns:GeneralFault"/ /operationoperation 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"
Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?
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
Re: [Axis2] Why do I get service skeletons taking OMElement, and uncompilable code?
Oops, a little late here and I misread the method signature. Getting XmlObject instead of OMElement probably isn't what you were hoping for, so perhaps as Anne implied xs:any is the culprit. Do keep in mind the bug fixes in the xmlbeans code since the 1.0 release, however. Good luck, Robert http://www.braziloutsource.com/ On 6/20/06, robert lazarski [EMAIL PROTECTED] wrote: 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=