axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject cvs commit: ws-axis/java/samples/handler deploy.wsdd build.xml TestMimeHeaderHandler.java undeploy.wsdd
Date Fri, 12 Mar 2004 06:31:50 GMT
ias         2004/03/11 22:31:50

  Added:       java/samples/handler deploy.wsdd build.xml
                        TestMimeHeaderHandler.java undeploy.wsdd
  Log:
  Initial check-in.
  
  Revision  Changes    Path
  1.1                  ws-axis/java/samples/handler/deploy.wsdd
  
  Index: deploy.wsdd
  ===================================================================
  <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
   <service name="TestMimeHeaderService" provider="Handler">
   	<parameter name="handlerClass" value="samples.handler.TestMimeHeaderHandler"/>
   </service>
  </deployment>
  
  
  
  1.1                  ws-axis/java/samples/handler/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0" ?>
  <!DOCTYPE project [
          <!ENTITY properties SYSTEM "file:../../xmls/properties.xml">
          <!ENTITY paths  SYSTEM "file:../../xmls/path_refs.xml">
          <!ENTITY taskdefs SYSTEM "file:../../xmls/taskdefs.xml">
          <!ENTITY taskdefs_post_compile SYSTEM "file:../../xmls/taskdefs_post_compile.xml">
          <!ENTITY targets SYSTEM "file:../../xmls/targets.xml">
  ]>
  
  <!-- ===================================================================
  <description>
     Test/Sample Component file for Axis
  
  Notes:
     This is a build file for use with the Apache Ant build tool.
  
  Prerequisites:
  
     apache-ant from http://ant.apache.org
  
  Build Instructions:
     To compile
          ant compile
     To execute
          ant run
  
  Copyright:
    Copyright (c) 2002-2004 Apache Software Foundation.
  </description>
  ==================================================================== -->
  
  <project default="compile">
  <property name="axis.home" location="../.." />
  <property name="componentName" value="samples/handler" />
  
          &properties;
          &paths;
          &taskdefs;
  	&taskdefs_post_compile;
  	&targets;
  
  <target name="clean"/>
  
  <target name="copy" depends="setenv"/>
  
  <target name="compile" depends="copy">
  
    <copy todir="${build.dir}/work/samples/handler" overwrite="yes">
      <fileset dir="${axis.home}/samples/handler">
        <include name="*.wsdd"/>
      </fileset>
    </copy>
  
    <javac srcdir="${build.dir}/work" destdir="${build.dest}" debug="${debug}" nowarn="${nowarn}"
fork="${javac.fork}">
       <classpath refid="classpath" />
       <include name="samples/handler/**.java" />
    </javac>
  
    <javac srcdir="${axis.home}" destdir="${build.dest}" debug="${debug}" nowarn="${nowarn}"
fork="${javac.fork}">
      <classpath>
          <path refid="classpath"/>
      </classpath>
      <include name="samples/handler/**/*.java"/>
    </javac>
  </target>
  
  <target name="deploy"/>
  
  <target name="run"/>
  
  <target name="undeploy"/>
  
  </project>
  
  
  
  1.1                  ws-axis/java/samples/handler/TestMimeHeaderHandler.java
  
  Index: TestMimeHeaderHandler.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package samples.handler;
  
  import org.apache.axis.AxisFault;
  import org.apache.axis.Message;
  import org.apache.axis.MessageContext;
  import org.apache.axis.handlers.BasicHandler;
  
  public class TestMimeHeaderHandler extends BasicHandler {
  
  	public void invoke(MessageContext msgContext) throws AxisFault {
  		Message requestMessage = msgContext.getRequestMessage();
  		Message responseMessage = new Message(requestMessage.getSOAPEnvelope());
          String[] fooHeader = requestMessage.getMimeHeaders().getHeader("foo");
          if (fooHeader != null) {
              responseMessage.getMimeHeaders().addHeader("foo", fooHeader[0]);
          }
  		msgContext.setResponseMessage(responseMessage);
  	}
  }
  
  
  
  1.1                  ws-axis/java/samples/handler/undeploy.wsdd
  
  Index: undeploy.wsdd
  ===================================================================
  <undeployment xmlns="http://xml.apache.org/axis/wsdd/">
    <service name="TestMimeHeaderService"/>
  </undeployment>
  
  
  

Mime
View raw message