Hi Jose, No, this is how the code was generated the first time...
Asaf Lahav VP R&D, Prima Grid LTD. Cellular: 972-54-4717955 Phone: 972-3-6540255 Fax: 972-3-6540254 -----Original Message----- From: José Antonio Sánchez [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 11:21 AM To: axis-user@ws.apache.org Subject: Re: WSRF WSDL2JAVA bug? Did you make a ant generate before putting the get method in the WSDL? Everytime you make an ant generate it overwrites the Abstract classes but not the Home, Resource and Service classes, so if you add a method after the first generation you have to add it by hand to this three files. 2006/2/14, Asaf Lahav <[EMAIL PROTECTED]>: > > > > Hi Jose, > > > > Here are both classes as they were generated by the ANT GENERATE command. > > As you can see, the AbstractCalculatorService has an abstract function by > the name "GET" which is not overridden by the CalculatorService class which > extends it. > > > > > > > > CalculatorService.java: > > > > package com.primagrid.resource.example.calculator; > > > > import org.apache.ws.resource.ResourceContext; > > import org.apache.xmlbeans.XmlObject; > > import org.apache.xmlbeans.XmlException; > > > > import javax.xml.rpc.JAXRPCException; > > > > /** > > * A Calculator service. > > * > > * This class is generated ONCE and never overwritten. > > * If there is a change to the WSDL, then the generated implemented > interfaces > > * representing the implemented portTypes will change, thus showing a > compile error to the > > * user. > > * <p /> > > * NOTE: This file is generated, but is meant to be modified. > > * It will NOT be overwritten by subsequent runs of Wsdl2Java. > > */ > > public class CalculatorService > > extends AbstractCalculatorService > > implements CalculatorCustomOperationsPortType > > { > > > > /** > > * Creates a new [EMAIL PROTECTED] CalculatorService } object. > > * > > * @param resourceContext DOCUMENT_ME > > */ > > public CalculatorService( ResourceContext resourceContext ) > > { > > super(resourceContext); > > init(); > > } > > > > > > public > com.primagrid.resource.example.calculator.ExecuteResponseDocument > execute( > com.primagrid.resource.example.calculator.ExecuteDocument > requestDoc ) throws > com.primagrid.resource.example.calculator.ExecuteFailedFaultException > > { > > > com.primagrid.resource.example.calculator.ExecuteResponseDocument > responseDocument = > com.primagrid.resource.example.calculator.ExecuteResponseDocument.Factory.ne wInstance(); > > > > > /** > > * TODO implement method and populate the response object > > * > > * For more information on working-with/populating the > XmlBean-generated types. > > * > > * See > http://xmlbeans.apache.org/documentation/tutorial_getstarted.html#Results+of +Compiling+the+Schema > > > */ > > return responseDocument; > > } > > > > > > } > > > > AbstractCalculatorService.java: > > > > > > package com.primagrid.resource.example.calculator; > > > > import org.apache.ws.resource.ResourceContext; > > import org.apache.ws.resource.handler.SoapMethodNameMap; > > import org.apache.ws.resource.handler.WsrfService; > > import org.apache.ws.resource.AbstractPortType; > > import > org.apache.ws.resource.handler.ServiceSoapMethodNameMap; > > import javax.xml.namespace.QName; > > > > /** > > * An abstract base class for the Calculator service. > > * <p /> > > * ***** WARNING ***** > > * This class is generated by Wsdl2Java and is NOT meant to be modified. > > * It will be overwritten by subsequent runs of Wsdl2Java. > > */ > > public abstract class AbstractCalculatorService extends AbstractPortType > > implements org.apache.ws.resource.handler.WsrfService, > org.apache.ws.resource.properties.v2004_06.porttype.QueryResourcePropertiesP ortType, > org.apache.ws.resource.properties.v2004_06.porttype.SetResourcePropertiesPor tType, > org.apache.ws.resource.properties.v2004_06.porttype.GetMultipleResourcePrope rtiesPortType, > org.apache.ws.resource.lifetime.v2004_06.porttype.ScheduledResourceTerminati onPortType, > org.apache.ws.resource.properties.v2004_06.porttype.GetResourcePropertyPortT ype, > org.apache.ws.resource.lifetime.v2004_06.porttype.ImmediateResourceTerminati onPortType, > org.apache.ws.resource.metadataexchange.v2004_09.porttype.MetadataExchangePo rtType > { > > > > public static final String TARGET_NSURI = > "http://www.primagrid.com/resource/example/calculator"; > > public static final String TARGET_NSPREFIX = "calculator"; > > > > /** > > * DOCUMENT_ME > > */ > > private ServiceSoapMethodNameMap m_methodNameMap; > > > > /** > > * DOCUMENT_ME > > */ > > private boolean m_isInitialized; > > > > public AbstractCalculatorService( ResourceContext resourceContext ) > > { > > super(resourceContext); > > } > > > > /** > > * DOCUMENT_ME > > * > > * @param requestQname DOCUMENT_ME > > * > > * @return DOCUMENT_ME > > */ > > public String getMethodName( QName requestQname ) > > { > > if ( !m_isInitialized ) > > { > > init( ); > > } > > > > return m_methodNameMap.getMethodName( requestQname ); > > } > > > > > > /** > > * DOCUMENT_ME > > * > > * @return DOCUMENT_ME > > */ > > public final SoapMethodNameMap getMethodNameMap( ) > > { > > return m_methodNameMap; > > } > > > > /** > > * DOCUMENT_ME > > */ > > public void init( ) > > { > > m_methodNameMap = new ServiceSoapMethodNameMap( getResourceContext( > ) ); > > m_methodNameMap.addMapping( > javax.xml.namespace.QName.valueOf("{http://www.primagrid.com/resource/exampl e/calculator}Execute") > , "execute" ); > > m_isInitialized = true; > > } > > > > > > /** > > * DOCUMENT_ME > > * > > * @return DOCUMENT_ME > > */ > > protected final boolean isInitialized( ) > > { > > return m_isInitialized; > > } > > > > /** > > * DOCUMENT_ME > > * > > * @param requestDoc DOCUMENT_ME > > * > > * @return DOCUMENT_ME > > */ > > public > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryRes ourcePropertiesResponseDocument > queryResourceProperties( > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryRes ourcePropertiesDocument > requestDoc ) > > > > { > > return new > org.apache.ws.resource.properties.v2004_06.porttype.impl.QueryResourceProper tiesPortTypeImpl( > getResourceContext( ) ).queryResourceProperties( requestDoc ); > > } > > /** > > * DOCUMENT_ME > > * > > * @param requestDoc DOCUMENT_ME > > * > > * @return DOCUMENT_ME > > */ > > public > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResou rcePropertiesResponseDocument > setResourceProperties( > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.SetResou rcePropertiesDocument > requestDoc ) > > { > > return new > org.apache.ws.resource.properties.v2004_06.porttype.impl.SetResourceProperti esPortTypeImpl( > getResourceContext( ) ).setResourceProperties( requestDoc ); > > } > > > > /** > > * @see > org.apache.ws.resource.properties.v2004_06.porttype.GetMultipleResourcePrope rtiesPortType#getMultipleResourceProperties > > */ > > public > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMulti pleResourcePropertiesResponseDocument > getMultipleResourceProperties( > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetMulti pleResourcePropertiesDocument > requestDoc ) > > { > > return new > org.apache.ws.resource.properties.v2004_06.porttype.impl.GetMultipleResource PropertiesPortTypeImpl( > getResourceContext( ) ).getMultipleResourceProperties( > requestDoc ); > > } > > > > /** > > * DOCUMENT_ME > > * > > * @param requestDoc DOCUMENT_ME > > * > > * @return DOCUMENT_ME > > */ > > public > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.SetTermina tionTimeResponseDocument > setTerminationTime( > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.SetTermina tionTimeDocument > requestDoc ) > > { > > return new > org.apache.ws.resource.lifetime.v2004_06.porttype.impl.ScheduledResourceTerm inationPortTypeImpl( > getResourceContext( ) ).setTerminationTime( requestDoc ); > > } > > /** > > * @see > > */ > > public > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResou rcePropertyResponseDocument > getResourceProperty( > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.GetResou rcePropertyDocument > requestDoc ) > > { > > return new > org.apache.ws.resource.properties.v2004_06.porttype.impl.GetResourceProperty PortTypeImpl( > getResourceContext( ) ).getResourceProperty( requestDoc ); > > } > > > > /** > > * DOCUMENT_ME > > * > > * @param requestDoc DOCUMENT_ME > > * > > * @return DOCUMENT_ME > > */ > > public > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyRes ponseDocument > destroy( > org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyDoc ument > requestDoc ) > > { > > return new > org.apache.ws.resource.lifetime.v2004_06.porttype.impl.ImmediateResourceTerm inationPortTypeImpl( > getResourceContext( ) ).destroy( requestDoc ); > > } > > > > > > public > org.xmlsoap.schemas.ws.x2004.x09.mex.MetadataDocument > getMetadata(org.xmlsoap.schemas.ws.x2004.x09.mex.GetMetadataDocument > request) > > { > > return new > org.apache.ws.resource.metadataexchange.v2004_09.porttype.impl.MetadataExcha ngePortTypeImpl( > getResourceContext( ) ).getMetadata( request); > > } > > > > public abstract > org.xmlsoap.schemas.ws.x2004.x09.mex.AnyXmlType get(); > > > > } > > > > > Asaf Lahav > > VP R&D, Prima Grid LTD. > > Cellular: 972-54-4717955 > > Phone: 972-3-6540255 > > Fax: 972-3-6540254 > > > > ________________________________ > > > From: José Antonio Sánchez [mailto:[EMAIL PROTECTED] > Sent: Tuesday, February 14, 2006 12:01 AM > To: axis-user@ws.apache.org > Subject: Re: WSRF WSDL2JAVA bug? > > > > > Could you post your CalculatorService.java file? > > > 2006/2/13, Asaf Lahav < [EMAIL PROTECTED]>: > > > Hi all, > > > > Another problem I encountered using the WSDL2JAVA utility provided by the > WSRF project is that after the process ends, the SERVICE class is not > properly generated. > > As you can see from the WSDL file I have a "get" operation defined both > under the BINDING element and under the PORTTYPE element. > > For some reason the CalculatorService service class generated which inherits > from an abstract class AbstractCalculatorService doesn't override the "get" > function (which is abstract and has to be overridden). > > > > <?xml version="1.0"?> > > > > <definitions name="CalculatorDefinition" > > > targetNamespace="http://www.primagrid.com/resource/example/calculator" > > xmlns="http://schemas.xmlsoap.org/wsdl/" > > > xmlns:tns="http://www.primagrid.com/resource/example/calculator" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > > > xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperti es-1.2-draft-01.xsd > " > > > xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourcePropert ies-1.2-draft-01.wsdl > " > > > xmlns:wsrlw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetim e-1.2-draft-01.wsdl > " > > > xmlns:mex="http://schemas.xmlsoap.org/ws/2004/09/mex" > > > xmlns:wsa04="http://schemas.xmlsoap.org/ws/2004/08/addressing"> > > > > <import > namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourcePropertie s-1.2-draft-01.wsdl > " > > > location="../spec/wsrf/WS-ResourceProperties-1_2-Draft_01.wsdl"/> > > > > <import > namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime- 1.2-draft-01.wsdl > " > > > location="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.wsdl"/> > > > > <import > namespace="http://schemas.xmlsoap.org/ws/2004/09/mex" > > > location="../spec/wsx/WS-MetadataExchange-2004_09.wsdl"/> > > > > <types> > > <schema elementFormDefault="qualified" > > > targetNamespace="http://www.primagrid.com/resource/example/calculator" > > xmlns="http://www.w3.org/2001/XMLSchema" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > xmlns:wsrl="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime -1.2-draft-01.xsd > " > > > xmlns:wsbf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-d raft-01.xsd > "> > > > > <xsd:import > namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-dr aft-01.xsd > " > > > schemaLocation="../spec/wsrf/WS-BaseFaults-1_2-Draft_01.xsd"/> > > > > <xsd:import > namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime- 1.2-draft-01.xsd > " > > > schemaLocation="../spec/wsrf/WS-ResourceLifetime-1_2-Draft_01.xsd"/> > > > > <!-- *** Add your custom resource property element definitions here > *** --> > > > > <element name="LeftSide" > type="xsd:int"/> > > <element name="RightSide" > type="xsd:int"/> > > <element name="Result" type="xsd:int"/> > > > > <!-- Resource Properties Document Schema --> > > <element name="ResourceProperties"> > > <complexType> > > <sequence> > > > > <!-- *** If you wish to implement the > wsrl:ScheduledResourceTermination portType, > > uncomment the below two lines *** --> > > > > <element ref="wsrl:CurrentTime" /> > > <element ref="wsrl:TerminationTime" /> > > > > > > <!-- *** Add element refs for each of your custom resource > property elements here *** --> > > <element > ref="tns:LeftSide"/> > > <element > ref="tns:RightSide"/> > > <element > ref="tns:Result"/> > > > > <!-- *** Uncomment the below any element if you want to > permit resource property elements > > with arbitrary names (not generally recommended) > *** --> > > <!-- > > <any minOccurs="0" maxOccurs="unbounded" > namespace="##other" processContents="lax" /> > > --> > > > > </sequence> > > </complexType> > > </element> > > > > <!-- *** Add element definitions for custom request/response/fault > types here *** --> > > <element name="Execute"> > > <complexType /> > > </element> > > <element name="ExecuteResponse"> > > <complexType /> > > </element> > > <element name="ExecuteFailedFault"> > > <complexType> > > <complexContent> > > <extension > base="wsbf:BaseFaultType" /> > > </complexContent> > > </complexType> > > </element> > > > > </schema> > > </types> > > > > <!-- *** Add message definitions for custom request/response/fault types > here *** --> > > > > <message name="ExecuteRequest"> > > <part name="ExecuteRequest" element="tns:Execute"/> > > </message> > > > > <message name="ExecuteResponse"> > > <part name="ExecuteResponse" > element="tns:ExecuteResponse"/> > > </message> > > > > <message name="ExecuteFailedFault"> > > <part name="ExecuteFailedFault" > element="tns:ExecuteFailedFault"/> > > </message> > > > > > > > > <portType name="CalculatorPortType" > wsrp:ResourceProperties="tns:ResourceProperties"> > > > > <operation name="GetResourceProperty"> > > <input name="GetResourcePropertyRequest" > message="wsrpw:GetResourcePropertyRequest"/> > > <output name="GetResourcePropertyResponse" > message="wsrpw:GetResourcePropertyResponse"/> > > <fault name="ResourceUnknownFault" > message="wsrpw:ResourceUnknownFault"/> > > <fault name="InvalidResourcePropertyQNameFault" > message="wsrpw:InvalidResourcePropertyQNameFault"/> > > </operation> > > > > <!-- *** If you wish to implement the WSRP > GetMultipleResourceProperties portType, > > uncomment the below operation block *** --> > > > > <operation name="GetMultipleResourceProperties"> > > <input > name="GetMultipleResourcePropertiesRequest" > message="wsrpw:GetMultipleResourcePropertiesRequest"/> > > <output > name="GetMultipleResourcePropertiesResponse" > message="wsrpw:GetMultipleResourcePropertiesResponse"/> > > <fault name="ResourceUnknownFault" > message="wsrpw:ResourceUnknownFault"/> > > <fault name="InvalidResourcePropertyQNameFault" > message="wsrpw:InvalidResourcePropertyQNameFault"/> > > </operation> > > > > > > <!-- *** If you wish to implement the WSRP SetResourceProperties > portType, > > uncomment the below operation block *** --> > > > > <operation name="SetResourceProperties"> > > <input name="SetResourcePropertiesRequest" > message="wsrpw:SetResourcePropertiesRequest"/> > > <output name="SetResourcePropertiesResponse" > message="wsrpw:SetResourcePropertiesResponse"/> > > <fault name="ResourceUnknownFault" > message="wsrpw:ResourceUnknownFault"/> > > <fault name="InvalidResourcePropertyQNameFault" > message="wsrpw:InvalidResourcePropertyQNameFault"/> > > <fault > name="InvalidSetResourcePropertiesRequestContentFault" > message="wsrpw:InvalidSetResourcePropertiesRequestContentFault"/> > > <fault name="UnableToModifyResourcePropertyFault" > message="wsrpw:UnableToModifyResourcePropertyFault"/> > > <fault > name="SetResourcePropertyRequestFailedFault" > message="wsrpw:SetResourcePropertyRequestFailedFault"/> > > </operation> > > > > > > <!-- *** If you wish to implement the WSRP QueryResourceProperties > portType, > > uncomment the below operation block *** --> > > > > <operation name="QueryResourceProperties"> > > <input name="QueryResourcePropertiesRequest" > message="wsrpw:QueryResourcePropertiesRequest"/> > > <output name="QueryResourcePropertiesResponse" > message="wsrpw:QueryResourcePropertiesResponse"/> > > <fault name="ResourceUnknownFault" > message="wsrpw:ResourceUnknownFault"/> > > <fault name="InvalidResourcePropertyQNameFault" > message="wsrpw:InvalidResourcePropertyQNameFault"/> > > <fault name="UnknownQueryExpressionDialectFault" > message="wsrpw:UnknownQueryExpressionDialectFault"/> > > <fault name="InvalidQueryExpressionFault" > message="wsrpw:InvalidQueryExpressionFault"/> > > <fault name="QueryEvaluationErrorFault" > message="wsrpw:QueryEvaluationErrorFault"/> > > </operation> > > > > > > <!-- *** If you wish to implement the WSRL > ImmediateResourceTermination portType, > > uncomment the below operation block *** --> > > > > <operation name="Destroy"> > > <input message="wsrlw:DestroyRequest"/> > > <output message="wsrlw:DestroyResponse"/> > > <fault name="ResourceUnknownFault" > message="wsrlw:ResourceUnknownFault"/> > > <fault name="ResourceNotDestroyedFault" > message="wsrlw:ResourceNotDestroyedFault"/> > > </operation> > > > > > > <!-- *** If you wish to implement the WSRL > ScheduledResourceTermination portType, > > uncomment the below operation block *** --> > > > > <operation name="SetTerminationTime"> > > <input message="wsrlw:SetTerminationTimeRequest"/> > > <output > message="wsrlw:SetTerminationTimeResponse"/> > > <fault name="ResourceUnknownFault" > message="wsrlw:ResourceUnknownFault"/> > > <fault name="UnableToSetTerminationTimeFault" > message="wsrlw:UnableToSetTerminationTimeFault"/> > > <fault name="TerminationTimeChangeRejectedFault" > message="wsrlw:TerminationTimeChangeRejectedFault"/> > > </operation> > > > > > > <!-- *** If you wish to implement the WS-MetadataExchange > MetadataExchange portType, > > &nb... > > [Mensaje recortado] -- Saludos. José Antonio Sánchez