Here i send the files corresponding to this part of our developement.
as you can see in catalina.out the exception is thrown. I work with
Jose that has askes you similar questions to this one. We think it
could be because the exception y correctly thrown, but it is catched
by Axis or tomcat or whatever.

thanks

On 4/19/06, Sal Campana <[EMAIL PROTECTED]> wrote:
> Alvaro Orus wrote:
>
> >Hi all,
> >
> >Im developing a wsdm service and i want to use custom WS-BaseFaults. I
> >have definded it in the wsdl and it seems to work until when i throw
> >the generated exception. In that moment i get the following response:
> >
> >HTTP/1.1 500 Error Interno del Servidor
> >
> >Content-Type: text/xml;charset=utf-8
> >
> >Date: Wed, 19 Apr 2006 11:15:59 GMT
> >
> >Server: Apache-Coyote/1.1
> >
> >Connection: close
> >
> >
> >
> ><?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
> >xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> >xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> > <soapenv:Body>
> >  <soapenv:Fault>
> >   <faultcode xmlns:ns1="http://xml.apache.org/axis/";>ns1:Server</faultcode>
> >   <faultstring>Server Error</faultstring>
> >   <detail>
> >    <ns2:stackTrace xmlns:ns2="http://xml.apache.org/axis/";>Server Error
> >        at 
> > org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473)
> >        at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> >        at 
> > org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
> >        at 
> > org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
> >        at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
> >        at 
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
> >        at 
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
> >        at 
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
> >        at 
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >        at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >        at 
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >        at 
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
> >        at 
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >        at 
> > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
> >        at 
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> >        at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >        at 
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >        at 
> > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
> >        at 
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
> >        at 
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >        at 
> > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
> >        at 
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> >        at 
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
> >        at 
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> >        at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >        at 
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >        at 
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
> >        at 
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >        at 
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >        at 
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >        at 
> > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
> >        at 
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
> >        at 
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
> >        at 
> > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> >        at 
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
> >        at java.lang.Thread.run(Thread.java:595)
> ></ns2:stackTrace>
> >    <ns3:hostname 
> > xmlns:ns3="http://xml.apache.org/axis/";>adapt05</ns3:hostname>
> >   </detail>
> >  </soapenv:Fault>
> > </soapenv:Body>
> ></soapenv:Envelope>
> >
> >And this is not the response i was expecting, furthermore i have tried
> >with the filesystem example of the apache web and i get the following
> >message that i think it is not right:
> >
> >   [echo] ========================== RESPONSE ============================
> >[soapClient] SOAP request failed with HTTP status: 500 Error Interno
> >del Servidor
> >[soapClient] <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
> >xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
> >xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> >[soapClient]  <soapenv:Body>
> >[soapClient]   <soapenv:Fault>
> >[soapClient]    <faultcode
> >xmlns:ns1="http://xml.apache.org/axis/";>ns1:Server</faultcode>
> >[soapClient]    <faultstring>Server Error</faultstring>
> >[soapClient]    <detail>
> >[soapClient]     <ns2:stackTrace
> >xmlns:ns2="http://xml.apache.org/axis/";>Server Error
> >[soapClient]    at
> >org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:473)
> >[soapClient]    at 
> >org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> >[soapClient]    at
> >org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
> >[soapClient]    at 
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
> >[soapClient]    at
> >org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
> >[soapClient]    at 
> >javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
> >[soapClient]    at
> >org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
> >[soapClient]    at
> >org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
> >[soapClient]    at
> >org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >[soapClient]    at
> >org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >[soapClient]    at
> >org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >[soapClient]    at
> >org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:445)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >[soapClient]    at
> >org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >[soapClient]    at
> >org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
> >[soapClient]    at
> >org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >[soapClient]    at
> >org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> >[soapClient]    at
> >org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >[soapClient]    at
> >org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >[soapClient]    at
> >org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
> >[soapClient]    at
> >org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
> >[soapClient]    at
> >org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
> >[soapClient]    at
> >org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
> >[soapClient]    at
> >org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
> >[soapClient]    at
> >org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)[soapClient]
> >   at 
> > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> >[soapClient]    at
> >org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
> >[soapClient]    at java.lang.Thread.run(Thread.java:595)
> >[soapClient] </ns2:stackTrace>
> >[soapClient]     <ns3:hostname
> >xmlns:ns3="http://xml.apache.org/axis/";>adapt05</ns3:hostname>
> >[soapClient]    </detail>
> >[soapClient]   </soapenv:Fault>
> >[soapClient]  </soapenv:Body>
> >[soapClient] </soapenv:Envelope>
> >
> >Is this a problem with this part of the implementation or is my fault?.
> >
> >thanks
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> Alvaro,
>
> Can you send the generated java file for the base fault?
>
> Are you sure your fault is being thrown?  I mean are you sure you
> reached that code?  I cannot tell much from the stacktrace that Axis has
> provided...
>
> Thanks!
>
> -Sal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
<?xml version="1.0"?>

<definitions name="InitDefinition"
             targetNamespace="http://tomas.org/wsdm/init";
             xmlns="http://schemas.xmlsoap.org/wsdl/";
             xmlns:tns="http://tomas.org/wsdm/init";
             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-ResourceProperties-1.2-draft-01.xsd";
             xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl";
             xmlns:wsrlw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.wsdl";
             xmlns:wsntw="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl";
             xmlns:muws-p2-wsdl="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.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-ResourceProperties-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"/>

   <import namespace="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.wsdl"; 
           location="../spec/wsn/WS-BaseNotification-1_2-Draft_01.wsdl"/>

   <import namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.wsdl"; 
           location="../spec/wsdm/MUWS-Part2-1_0.wsdl"/>

   <types>
      <schema elementFormDefault="qualified"
              targetNamespace="http://tomas.org/wsdm/init";
              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-draft-01.xsd";
              xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd";
              xmlns:muws-p1-xs="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd";
              xmlns:muws-p2-xs="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd";>

         <xsd:import namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-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.xsd"/>
 
         <xsd:import namespace="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"; 
                     schemaLocation="../spec/wsn/WS-BaseNotification-1_2-Draft_01.xsd"/>

         <xsd:import namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part1.xsd"; 
                     schemaLocation="../spec/wsdm/MUWS-Part1-1_0.xsd"/>

         <xsd:import namespace="http://docs.oasis-open.org/wsdm/2004/12/muws/wsdm-muws-part2.xsd"; 
                     schemaLocation="../spec/wsdm/MUWS-Part2-1_0.xsd"/>

         <!-- *** Add an element definition here for each of your custom resource properties *** -->
         <!-- *** e.g.: <element name="MyProperty" type="xsd:string" /> *** -->
         
         <element name="Operation" type="string"/>
         
         <!-- 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" />


                  <!-- *** If you wish to implement the wsnt:NotificationProducer portType,
                           uncomment the below three lines *** -->
                  <!--
                  <element ref="wsnt:Topic" maxOccurs="unbounded" /> 
                  <element ref="wsnt:FixedTopicSet" /> 
                  <element ref="wsnt:TopicExpressionDialects" maxOccurs="unbounded" />     
                  -->
                  
                  <!-- *** The ResourceId property is _required_ by the MUWS spec *** -->
		  <element ref="muws-p1-xs:ResourceId"/>
		  
		  <!-- *** If you wish to implement the MUWS ManageabilityCharacteristics capability,
                           uncomment the below line *** -->
	          <!--
	          <element ref="muws-p1-xs:ManageabilityCapability" minOccurs="0" maxOccurs="unbounded"/>
		  -->
		  
		  <!-- *** If you wish to implement the MUWS CorrelatableProperties capability,
                           uncomment the below line *** -->
                  <!--
		  <element ref="muws-p1-xs:CorrelatableProperties" minOccurs="0" maxOccurs="unbounded"/>
                  -->
                  
		  <!-- *** If you wish to implement the MUWS Description capability,
                           uncomment the below three lines *** -->		  
                  <!--
                  <element ref="muws-p2-xs:Caption" minOccurs="0" maxOccurs="unbounded"/>
                  <element ref="muws-p2-xs:Description" minOccurs="0" maxOccurs="unbounded"/>
                  <element ref="muws-p2-xs:Version" minOccurs="0"/>		  
                  -->
                  
		  <!-- *** If you wish to implement the MUWS OperationalStatus capability,
                           uncomment the below line *** -->		  

		  <element ref="muws-p2-xs:OperationalStatus"/>


		  <!-- *** If you wish to implement the MUWS Metrics capability,
                           uncomment the below line *** -->		                    					          
                  <!--
	          <element ref="muws-p2-xs:CurrentTime"/>
                  -->
                  
		  <!-- *** If you wish to implement the MUWS Relationships capability,
                           uncomment the below line *** -->		                    				
	          <!--
	          <element ref="muws-p2-xs:Relationship" minOccurs="0" maxOccurs="unbounded"/>
                  -->
                  		  		  			
                  <!-- *** Add an element ref here for each of the custom resource property elements you defined above *** -->
                  <!-- *** e.g.: <element ref="tns:MyProperty" /> (NOTE: default is minOccurs="1" and maxOccurs="1") *** -->
                  <!-- ***   or: <element ref="tns:MyOtherProperty" minOccurs="0" maxOccurs="unbounded" /> *** -->
                  
                  <!-- *** 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"/>
                  -->
				<element ref="tns:Operation" minOccurs="0" maxOccurs="unbounded"/>
               </sequence>
            </complexType>
         </element>
		<element name="RefreshResponseElement">
			<xsd:complexType>
				<xsd:sequence>
					<xsd:element name="service" type="string"></xsd:element>
					<xsd:element name="status" type="string"></xsd:element>
				</xsd:sequence>
			</xsd:complexType>
		</element>
         <!-- *** Add element definitions for custom request/response/fault types here *** -->         
           <element name="CreateRequestType" type="xsd:string"/>
           	
			<element name="CreateResponseType">
				<complexType />
			</element>
			
			<element name="DoOperationRequestType" type="xsd:string"/>
           	
			<element name="DoOperationResponseType" type="xsd:string">
			</element>
			
			<element name="RefreshRequestType">
				<complexType />
			</element>
						
			<element name="RefreshResponseType">
				<complexType>
					<sequence>
						<element ref="tns:RefreshResponseElement" minOccurs="0" maxOccurs="unbounded"/>
					</sequence>
				</complexType>
			</element>
			
			<element name="AddOperationRequestType" type="xsd:string">
			</element>
			
			<element name="AddOperationResponseType">
				<complexType />
			</element>			
			
			<element name="RemoveOperationRequestType" type="xsd:string">
			</element>
			
			<element name="RemoveOperationResponseType">
				<complexType />
			</element>
			
			<element name="ServiceBlacklistedFault">
			    <complexType>
	 				<complexContent>
				 	    <extension base="wsbf:BaseFaultType" />
				 	</complexContent>
			    </complexType>
        	 </element>
									
      </schema>
   </types>

   <!-- *** Add message definitions for custom request/response/fault types here *** -->         
   		<message name="CreateRequest">
     		<part name="CreateRequest" element="tns:CreateRequestType" />
	     </message>
	     
	     <message name="CreateResponse">
     		<part name="CreateResponse" element="tns:CreateResponseType" />
	     </message>
	     
	     <message name="DoOperationRequest">
     		<part name="DoOperationRequest" element="tns:DoOperationRequestType" />
	     </message>
	     
	     <message name="DoOperationResponse">
     		<part name="DoOperationResponse" element="tns:DoOperationResponseType" />
	     </message>
	     
	     <message name="RefreshRequest">
     		<part name="RefreshRequest" element="tns:RefreshRequestType" />
	     </message>
	     
	     <message name="RefreshResponse">
     		<part name="RefreshResponse" element="tns:RefreshResponseType" />
	     </message>
	     
	     <message name="AddOperationRequest">
     		<part name="AddOperationRequest" element="tns:AddOperationRequestType" />
	     </message>
	     
         <message name="AddOperationResponse">
     		<part name="AddOperationResponse" element="tns:AddOperationResponseType" />
	     </message>
	     
	     <message name="RemoveOperationRequest">
     		<part name="RemoveOperationRequest" element="tns:RemoveOperationRequestType" />
	     </message>
	     
         <message name="RemoveOperationResponse">
     		<part name="RemoveOperationResponse" element="tns:RemoveOperationResponseType" />
	     </message>
	     
	     <message name="ServiceBlacklistedFault">
	        <part name="ServiceBlacklistedFault" element="tns:ServiceBlacklistedFault"/>
	     </message>
	     
   <portType name="InitPortType" 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 WSNT NotificationProducer portType,
               uncomment the below two operation blocks *** -->
      <!--      
      <operation name="Subscribe">
         <input message="wsntw:SubscribeRequest" /> 
         <output message="wsntw:SubscribeResponse" /> 
         <fault name="ResourceUnknownFault" message="wsntw:ResourceUnknownFault" /> 
         <fault name="SubscribeCreationFailedFault" message="wsntw:SubscribeCreationFailedFault" /> 
         <fault name="TopicPathDialectUnknownFault" message="wsntw:TopicPathDialectUnknownFault" /> 
      </operation>
      
      <operation name="GetCurrentMessage">
         <input message="wsntw:GetCurrentMessageRequest" /> 
         <output message="wsntw:GetCurrentMessageResponse" /> 
         <fault name="ResourceUnknownFault" message="wsntw:ResourceUnknownFault" /> 
         <fault name="InvalidTopicExpressionFault" message="wsntw:InvalidTopicExpressionFault" /> 
         <fault name="TopicNotSupportedFault" message="wsntw:TopicNotSupportedFault" /> 
         <fault name="NoCurrentMessageOnTopicFault" message="wsntw:NoCurrentMessageOnTopicFault" /> 
      </operation>       
      -->

      <!-- *** If you wish to implement the WSNT NotificationConsumer portType,
               uncomment the below two operation blocks *** -->
      <!-- 
      <operation name="Notify">
         <input name="Notify" message="wsntw:Notify"/>
      </operation>
      -->  
      
      <!-- *** If you wish to implement the MUWS QueryRelationshipsByType operation,
               uncomment the below operation block *** -->
      <!--            
      <operation name="QueryRelationshipsByType">
         <input message="muws-p2-wsdl:QueryRelationshipsByTypeRequest"/>
         <output message="muws-p2-wsdl:QueryRelationshipsByTypeResponse"/>         
      </operation>      
      -->

      <!-- *** If you wish to implement the WS-MetadataExchange MetadataExchange portType,
               uncomment the below operation block *** -->
      <!--
      <operation name="GetMetadata" >
         <input message="mex:GetMetadataMsg"
                wsa04:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request"; />
         <output message="mex:GetMetadataResponseMsg"
                wsa04:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Response"; />
      </operation>
      <operation name="Get" >
         <input message="mex:GetMsg"
                wsa04:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/Get/Request"; />
         <output message="mex:GetResponseMsg"
                wsa04:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/Get/Response"; />
      </operation>
      -->
      
      <!-- *** Add an operation block here for each of your custom operations *** -->         
      <operation name="Create" >
         <input message="tns:CreateRequest"/>
         <output message="tns:CreateResponse"/>
         <fault  name="ServiceBlacklistedFault" message="tns:ServiceBlacklistedFault" />
      </operation>
      
      <operation name="DoOperation" >
         <input message="tns:DoOperationRequest"/>
         <output message="tns:DoOperationResponse"/>
      </operation>
      
      <operation name="Refresh" >
         <input message="tns:RefreshRequest"/>
         <output message="tns:RefreshResponse"/>
      </operation>
      
      <operation name="AddOperation" >
         <input message="tns:AddOperationRequest"/>
         <output message="tns:AddOperationResponse"/>
      </operation>
      
      <operation name="RemoveOperation" >
         <input message="tns:RemoveOperationRequest"/>
         <output message="tns:RemoveOperationResponse"/>
      </operation>
      
   </portType>

   <binding name="InitSoapHttpBinding" type="tns:InitPortType">

      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
   
      <operation name="GetResourceProperty">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="InvalidResourcePropertyQNameFault">
            <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
         </fault>
      </operation>

      <!-- *** If you wish to implement the WSRP GetMultipleResourceProperties portType,
               uncomment the below operation block *** -->

      <operation name="GetMultipleResourceProperties">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="InvalidResourcePropertyQNameFault">
            <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
         </fault>
      </operation>


      <!-- *** If you wish to implement the WSRP SetResourceProperties portType,
               uncomment the below operation block *** -->

      <operation name="SetResourceProperties">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="InvalidResourcePropertyQNameFault">
            <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
         </fault>
         <fault name="UnableToModifyResourcePropertyFault">
            <soap:fault name="UnableToModifyResourcePropertyFault" use="literal"/>
         </fault>
         <fault name="InvalidSetResourcePropertiesRequestContentFault">
            <soap:fault name="InvalidSetResourcePropertiesRequestContentFault" use="literal"/>
         </fault>
         <fault name="SetResourcePropertyRequestFailedFault">
            <soap:fault name="SetResourcePropertyRequestFailedFault" use="literal"/>
         </fault>
      </operation>


      <!-- *** If you wish to implement the WSRP QueryResourceProperties portType,
               uncomment the below operation block *** -->

      <operation name="QueryResourceProperties">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="InvalidResourcePropertyQNameFault">
            <soap:fault name="InvalidResourcePropertyQNameFault" use="literal"/>
         </fault>
         <fault name="UnknownQueryExpressionDialectFault">
            <soap:fault name="UnknownQueryExpressionDialectFault" use="literal"/>
         </fault>
         <fault name="InvalidQueryExpressionFault">
            <soap:fault name="InvalidQueryExpressionFault" use="literal"/>
         </fault>
         <fault name="QueryEvaluationErrorFault">
            <soap:fault name="QueryEvaluationErrorFault" use="literal"/>
         </fault>
      </operation>

      
      <!-- *** If you wish to implement the WSRL ImmediateResourceTermination portType,
               uncomment the below operation block *** -->

      <operation name="Destroy">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="ResourceNotDestroyedFault">
            <soap:fault name="ResourceNotDestroyedFault" use="literal"/>
         </fault>
      </operation>            

    
      <!-- *** If you wish to implement the WSRL ScheduledResourceTermination portType,
               uncomment the below operation block *** -->

      <operation name="SetTerminationTime">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="UnableToSetTerminationTimeFault">
            <soap:fault name="UnableToSetTerminationTimeFault" use="literal"/>
         </fault>
         <fault name="TerminationTimeChangeRejectedFault">
            <soap:fault name="TerminationTimeChangeRejectedFault" use="literal"/>
         </fault>
      </operation>


      <!-- *** If you wish to implement the WSNT NotificationProducer portType,
               uncomment the below two operation blocks *** -->
      <!--                
      <operation name="Subscribe">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="SubscribeCreationFailedFault">
            <soap:fault name="SubscribeCreationFailedFault" use="literal"/>
         </fault>
         <fault name="TopicPathDialectUnknownFault">
            <soap:fault name="TopicPathDialectUnknownFault" use="literal"/>
         </fault>         
      </operation>            
      <operation name="GetCurrentMessage">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ResourceUnknownFault">
            <soap:fault name="ResourceUnknownFault" use="literal"/>
         </fault>
         <fault name="InvalidTopicExpressionFault">
            <soap:fault name="InvalidTopicExpressionFault" use="literal"/>
         </fault>
         <fault name="TopicNotSupportedFault">
            <soap:fault name="TopicNotSupportedFault" use="literal"/>
         </fault>         
         <fault name="NoCurrentMessageOnTopicFault">
            <soap:fault name="NoCurrentMessageOnTopicFault" use="literal"/>
         </fault>         
      </operation>            
      -->

      <!-- *** If you wish to implement the WSNT NotificationConsumer portType,
               uncomment the below two operation blocks *** -->
      <!--                
      <operation name="Notify">
         <soap:operation style="document"/>      
         <input>
            <soap:body use="literal"/>         
         </input>
      </operation>
      -->      

      <!-- *** If you wish to implement the MUWS QueryRelationshipsByType operation,
               uncomment the below operation block *** -->
      <!--
      <operation name="QueryRelationshipsByType">
         <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>            
      -->
      
      <!-- *** If you wish to implement the WS-MetadataExchange MetadataExchange portType,
               uncomment the below operation block *** -->
      <!--
      <operation name="GetMetadata" >
      	 <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
      <operation name="Get" >
      	 <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
      -->      
      
      <!-- *** Add an operation block here for each of your custom operations *** -->         
      <operation name="Create" >
      	 <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
         <fault name="ServiceBlacklistedFault">
            <soap:fault name="ServiceBlacklistedFault" use="literal"/>
         </fault>
      </operation>
      
      <operation name="DoOperation" >
      	 <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
      
       <operation name="Refresh" >
      	 <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
      
      <operation name="AddOperation" >
      	 <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
      
      <operation name="RemoveOperation" >
      	 <soap:operation style="document"/>
         <input>
            <soap:body use="literal"/>
         </input>
         <output>
            <soap:body use="literal"/>
         </output>
      </operation>
      
   </binding>

   <service name="InitService">
      <!-- Note: the port name becomes the service name in the wsdd generated by Wsdl2Java -->
      <!-- *** Change the port name and the soap:address location below to reflect the desired endpoint URL *** -->
      <port name="InitPort" binding="tns:InitSoapHttpBinding">
         <!--  soap:address location="http://tomas.andago.com:8080/muse/services/InitPort"; /-->
         <soap:address location="http://adapt20:8080/muse/services/InitPort"; />
      </port>
   </service>

</definitions>


package org.tomas.wsdm.init;

import org.apache.axis.AxisFault;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ws.resource.i18n.MessagesImpl;
import org.apache.ws.util.i18n.Messages;
import javax.xml.namespace.QName;
import org.apache.ws.resource.faults.AbstractBaseFaultException;
import org.apache.ws.resource.properties.NamespaceVersionHolder;

/**
 * An exception representing a ServiceBlacklistedFaultException WSRF base fault.
 * <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 class ServiceBlacklistedFaultException
        extends AbstractBaseFaultException
		//extends AxisFault
{

    private static final Messages MSG = MessagesImpl.getInstance();
    private static final Log LOG = LogFactory.getLog( ServiceBlacklistedFaultException.class );

    private QName m_name;

    /**
     * Constructs a new ServiceBlacklistedFaultException .
     *
     * @param namespaces
     * @param faultString 
     */
    public ServiceBlacklistedFaultException( NamespaceVersionHolder namespaces, String faultString )
    {
        super( namespaces, faultString );
    	//super( faultString );
        m_name = new QName( "http://tomas.org/wsdm/init";, "ServiceBlacklistedFaultException");        
    }
    
    /**
     * Returns the element name for this base fault.
     *
     * @return the element name for this base fault
     */
    public QName getBaseFaultName()
    {
        return m_name;
    }

}


package org.tomas.wsdm.init;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Iterator;
import java.util.Map;
import java.util.Vector;

import org.apache.ws.resource.ResourceContext;
import org.apache.ws.resource.ResourceException;
import org.apache.ws.resource.ResourceUnknownException;
import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyDocument;
import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceLifetime12Draft01.DestroyResponseDocument;
import org.tomas.wsdm.init.RefreshResponseElementDocument.RefreshResponseElement;
import org.tomas.wsdm.init.RefreshResponseTypeDocument.RefreshResponseType;

/**
 * A InitPort 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 InitPortService
   extends AbstractInitPortService 
   implements InitPortCustomOperationsPortType
{
   
      
   /**
    * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
    */
   public static final org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl SPEC_NAMESPACE_SET = new org.apache.ws.muws.v1_0.impl.WsdmNamespaceVersionHolderImpl();
    
   /**
    * Creates a new [EMAIL PROTECTED] InitPortService } object.
    *
    * @param resourceContext DOCUMENT_ME
    */
   public InitPortService( ResourceContext resourceContext )
   {
      super(resourceContext);
      init();
      
      org.tomas.wsdm.init.CreateRequestTypeDocument requestDoc = CreateRequestTypeDocument.Factory.newInstance();
      requestDoc.setCreateRequestType("ssh");
      System.out
			.println("*******************************************************");
      System.out.println(requestDoc);
      System.out
		.println("*******************************************************");
   }
   
      /**
    * Returns a collection of Spec Namespaces associated with this Service
    *
    * @return A NamespaceVersionHolder impl which represents the collection of spec namespaces 
    *         associated with this service.
    */
   protected org.apache.ws.resource.properties.NamespaceVersionHolder getNamespaceSet()
   {
      return SPEC_NAMESPACE_SET;
   }
   
      
   public org.tomas.wsdm.init.DoOperationResponseTypeDocument doOperation( org.tomas.wsdm.init.DoOperationRequestTypeDocument requestDoc )
   {              
     	org.tomas.wsdm.init.DoOperationResponseTypeDocument responseDocument = org.tomas.wsdm.init.DoOperationResponseTypeDocument.Factory.newInstance();	
     	
     	/**
     	 * 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     	 
     	 */
     	String sResp;
     	InitPortResource myResource = (InitPortResource)this.getResource();
     	String op = requestDoc.getDoOperationRequestType().toString();
     	
     	sResp = myResource.doOperation(op);
     	responseDocument.setDoOperationResponseType(sResp);
     	return responseDocument;
   }
   
   
      
   public org.tomas.wsdm.init.CreateResponseTypeDocument create( org.tomas.wsdm.init.CreateRequestTypeDocument requestDoc ) throws ServiceBlacklistedFaultException
   {              
     	org.tomas.wsdm.init.CreateResponseTypeDocument responseDocument = org.tomas.wsdm.init.CreateResponseTypeDocument.Factory.newInstance();	
     	InitPortHome myResourceHome = (InitPortHome) this.getResourceContext().getResourceHome();
    	
     		
     		Vector blackList = readBlacklist();
     		String createId = requestDoc.getCreateRequestType();
     		
     		if (!blackList.contains(createId))
     		{
     			try {
					myResourceHome.createResource(createId);					
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
     		}
     		else {
     			System.out
						.println("******************** I'm going to throw the exception ************************************************");
     			throw new ServiceBlacklistedFaultException(getNamespaceSet(),"Service /etc/init.d/"+createId+" is blacklisted");
     			
     		}
     		System.out
			.println("******************** Service created ****************************************************************");

     	/**
     	 * 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;
   }
   
  
public RefreshResponseTypeDocument refresh(RefreshRequestTypeDocument requestDoc) {
	org.tomas.wsdm.init.RefreshResponseTypeDocument responseDocument = org.tomas.wsdm.init.RefreshResponseTypeDocument.Factory.newInstance();	
 	
 	/**
 	 * 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     	 
 	 */
	Vector listHostServices = null; 
	InitPortResource myResource = (InitPortResource) this.getResource();
	listHostServices = myResource.getServices();
	InitPortHome myResourceHome = (InitPortHome) this.getResourceContext().getResourceHome();
	Map mapServices = myResourceHome.getResourceMap();
	Iterator registeredServices = mapServices.keySet().iterator();
	registeredServices.next();
	/*String regService = null;
	while (registeredServices.hasNext()){
		regService = (String) registeredServices.next();		
		if ((!listHostServices.contains(regService)) && (!regService.equals("Init")))
		{System.out.println("A ver que esta pasando aqui con el remove!!! "+regService);
			try {
				myResourceHome.remove(regService);
			} catch (ResourceUnknownException e) {
				// TODO Auto-generated catch block
				System.out.println("fallo en InitPortService 1.1");
				e.printStackTrace();
			} catch (ResourceException e) {
				// TODO Auto-generated catch block
				System.out.println("fallo en InitPortService 1.2");
				e.printStackTrace();
			} catch (Exception e){
				e.printStackTrace();
			}
			
		}
	}*/
	
	Vector blackList = readBlacklist();
	
	int i;
	String hostService = null;
	for (i=0;i<listHostServices.size();i++){
		hostService = (String)listHostServices.get(i);
	 /// Crear el servicio sólo si no está en el blacklist.
	 if ((!mapServices.containsKey(hostService)) && (!blackList.contains(hostService))) {
		 try {			
			myResourceHome.createResource(hostService);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			System.out.println("fallo en InitPortService 2");
			e.printStackTrace();
		}
	 }
	 /// Si el servicio estaba creado y ahora está en el blacklist, borrarlo.
	 if ((mapServices.containsKey(hostService)) && (blackList.contains(hostService)))
	 {
		 try {
			myResourceHome.remove(hostService);
		} catch (ResourceUnknownException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ResourceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	 }
	 
   }
	
	mapServices = myResourceHome.getResourceMap();
	registeredServices = mapServices.keySet().iterator();
	///// Eliminar de la lista devuelta los servicios que estén en el blacklist
	
	registeredServices.next();
	
	String regService = null;
	RefreshResponseType resp = responseDocument.addNewRefreshResponseType();  
	while (registeredServices.hasNext()){
		regService = (String) registeredServices.next();
		
			RefreshResponseElement elem = resp.addNewRefreshResponseElement();
			elem.setService(regService);
			if (listHostServices.contains(regService)) {
				elem.setStatus(org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus.AVAILABLE.toString());
			}
			else {
				elem.setStatus(org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.OperationalStatusDocument.OperationalStatus.UNAVAILABLE.toString());
			}
		
	}
	
	
	return responseDocument;
}

public RemoveOperationResponseTypeDocument removeOperation(RemoveOperationRequestTypeDocument requestDoc) {
	// TODO Auto-generated method stub
	org.tomas.wsdm.init.RemoveOperationResponseTypeDocument responseDocument = org.tomas.wsdm.init.RemoveOperationResponseTypeDocument.Factory.newInstance();
	String op = requestDoc.getRemoveOperationRequestType().toString();
	InitPortResource myResource = (InitPortResource) this.getResource();	
	myResource.removeOperation(op);
	return responseDocument;
}

public AddOperationResponseTypeDocument addOperation(AddOperationRequestTypeDocument requestDoc) {
	// TODO Auto-generated method stub
	org.tomas.wsdm.init.AddOperationResponseTypeDocument responseDocument = org.tomas.wsdm.init.AddOperationResponseTypeDocument.Factory.newInstance();
	String op = requestDoc.getAddOperationRequestType().toString();
	InitPortResource myResource = (InitPortResource) this.getResource();
	myResource.addOperation(op);
	return responseDocument;
}


public DestroyResponseDocument destroy(DestroyDocument requestDoc) {
	// TODO Auto-generated method stub
	String id = new String();
	try {
		id = (String) this.getResourceContext().getResource().getID();
	} catch (ResourceException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	if (id.equals("Init"))
		return DestroyResponseDocument.Factory.newInstance();
	else
		return super.destroy(requestDoc);
}

private Vector readBlacklist()
{
	Vector blackList = new Vector();

		try {
			FileInputStream blackListFile = new FileInputStream("/etc/wsdm/InitService/Blacklist");	
			BufferedReader blackListData = new BufferedReader(new InputStreamReader(blackListFile));
			String linea = new String();
			while ((linea = blackListData.readLine()) != null)
				blackList.add(linea.trim());
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}

	System.out.println("Contenido de BlackList:");
	for (int i=0;i<blackList.size();i++)
		System.out.println(blackList.elementAt(i));
	return blackList;
}
      
}


Attachment: catalina.out
Description: Binary data

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

Reply via email to