You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Li Bing <bi...@asu.edu> on 2002/03/30 11:17:14 UTC

Don't Know How to Use Custom Deployment

Dear all,

I am trying to learn how to use custom deployment. I did that as follows, but I failed.

The following necessary files are stored in my working directory, for example, $HOME/temp.

GreetingService.java
AxisClient.java
deploy.wsdd

Then I run the following script,

java org.apache.axis.client.AdminClient deploy.wsdd

Should I copy some files to $TOMCAT_HOME/webapps/axis before that? If the parameter needed by GreetingService.java is an Object, I need to add <beanMapping> into the deploy.wsdd. Should I copy the Object to $TOMCAT_HOME/webapps/axis?

I don't know how to do that.

Thanks so much!
Li Bing
                        _.--"""--._
                      .'       '-. `.
                   __/__    (-.   `\ \
                  /o `o \      \    \ \
                 _\__.__/ ))    |    | ;
            .--;"               |    |  \
           (    `)              |    |   \
          _|`---' .'      _,   _|    |    `\
        '`_\  \     '_,.-';_.-`\|     \     \_
        .'  '--'---;`  / /     |\     |_..--' \
                   \'-'.'     .--'.__/    __.-;
                    `"`      (___...---''`     \
                             _/_                \
                            /ASU\ libing@asu.edu
                            \___/ 480-965-9038(L), 602-743-9767(C)
                            http://www.public.asu.edu/~libing

beanMapping and typeMapping placement in WSDD

Posted by Mark Volkmann <vo...@charter.net>.
Simple yes and no answers will do. I'm guessing the answer to both these questions is yes, but I want to make sure.

Are beanMapping and typeMapping elements allowed both inside and outside service elements?

When inside a service element, does that imply that they are only used for the containing service?

Re: Where the Hell is the greetingService.log?

Posted by Li Bing <bi...@asu.edu>.
Dear Mark,

Sorry to bother you again! I don't know why I got stuck again whwen tring to run the sample of SOAP Attachment. Do you have the book, Professional Java Web Services? I am now following the book to learn Web Services.

In the part of Axis, it says it is possible to send a SOAP message with attachments. Similar to past experiences, I didn't find any configurations errors exited on my system. But it doesn't work. The exception is as follows,

[libing@enpc1932 SOAPAttachments]$ run.sh
java.lang.NullPointerException
 at org.apache.axis.encoding.JAFDataHandlerSerializer.serialize(JAFDataHandlerSerializer.java:87)
 at org.apache.axis.encoding.TypeMappingRegistry.serialize(TypeMappingRegistry.java:275)
 at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:417)
 at org.apache.axis.encoding.SerializationContext.outputMultiRefs(SerializationContext.java:442)
 at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:357)
 at org.apache.axis.message.MessageElement.output(MessageElement.java:448)
 at org.apache.axis.SOAPPart.getAsString(SOAPPart.java:329)
 at org.apache.axis.SOAPPart.getAsBytes(SOAPPart.java:272)
 at org.apache.axis.Message.getContentLength(Message.java:293)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:354)
 at org.apache.axis.SimpleTargetedChain.invoke(SimpleTargetedChain.java:104)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:178)
 at org.apache.axis.client.Call.invoke(Call.java:1254)
 at org.apache.axis.client.Call.invoke(Call.java:1113)
 at org.apache.axis.client.Call.invoke(Call.java:1043)
 at org.apache.axis.client.Call.invoke(Call.java:676)
 at AxisClient3.main(AxisClient3.java:43)
Can't convert 3 to Bytes
java.lang.NullPointerException
[libing@enpc1932 SOAPAttachments]$


The service code, client code, deploy.wsdd and attachment (user.properties) are attached.

Thanks so much for your help!
Li Bing
  ----- Original Message ----- 
  From: Mark Volkmann 
  To: axis-user@xml.apache.org 
  Sent: Saturday, March 30, 2002 10:01 PM
  Subject: Re: Where the Hell is the greetingService.log?


  If it works like LogHandler, you'll find the log file in the bin directory of your server.
  If you're using Tomcat, check in $TOMCAT_HOME/bin.
  It took me a while to figure that out too!
    ----- Original Message ----- 
    From: Li Bing 
    To: axis-user@xml.apache.org 
    Cc: volkmann2@charter.net ; Li Bing 
    Sent: Saturday, March 30, 2002 4:51 PM
    Subject: Where the Hell is the greetingService.log?


    Dear all,

    After solving the previous problem, I keep on learning the Axis. This time I try to add handlers to the GreetingService.

    A handler program is designed. It is EventRecorder.java which record the number of times that the greeting service has been called. A log file, greetingService.log, is generated. The new deploy.wsdd is registered successfully and I copy it GreetingService.class and EventRecorder.class to $TOMCAT_HOME/webapps/axis/WEB-INF/classes. Then, I run a client that invoke the GreetingService.class several times. Unfortunately, I can't find where the greetingService.log is! By the way, the $TOMCAT_HOME/webapps/axis/WEB-INF/server-config.wsdd is modified, i.e., the tag, <parameter name="enableRemoteAdmin" value="true"/>.

    Anyone could give me some help? Thanks so much in advance!
    Li Bing

Re: Where the Hell is the greetingService.log?

Posted by Mark Volkmann <vo...@charter.net>.
If it works like LogHandler, you'll find the log file in the bin directory of your server.
If you're using Tomcat, check in $TOMCAT_HOME/bin.
It took me a while to figure that out too!
  ----- Original Message ----- 
  From: Li Bing 
  To: axis-user@xml.apache.org 
  Cc: volkmann2@charter.net ; Li Bing 
  Sent: Saturday, March 30, 2002 4:51 PM
  Subject: Where the Hell is the greetingService.log?


  Dear all,

  After solving the previous problem, I keep on learning the Axis. This time I try to add handlers to the GreetingService.

  A handler program is designed. It is EventRecorder.java which record the number of times that the greeting service has been called. A log file, greetingService.log, is generated. The new deploy.wsdd is registered successfully and I copy it GreetingService.class and EventRecorder.class to $TOMCAT_HOME/webapps/axis/WEB-INF/classes. Then, I run a client that invoke the GreetingService.class several times. Unfortunately, I can't find where the greetingService.log is! By the way, the $TOMCAT_HOME/webapps/axis/WEB-INF/server-config.wsdd is modified, i.e., the tag, <parameter name="enableRemoteAdmin" value="true"/>.

  Anyone could give me some help? Thanks so much in advance!
  Li Bing

Where the Hell is the greetingService.log?

Posted by Li Bing <bi...@asu.edu>.
Dear all,

After solving the previous problem, I keep on learning the Axis. This time I try to add handlers to the GreetingService.

A handler program is designed. It is EventRecorder.java which record the number of times that the greeting service has been called. A log file, greetingService.log, is generated. The new deploy.wsdd is registered successfully and I copy it GreetingService.class and EventRecorder.class to $TOMCAT_HOME/webapps/axis/WEB-INF/classes. Then, I run a client that invoke the GreetingService.class several times. Unfortunately, I can't find where the greetingService.log is! By the way, the $TOMCAT_HOME/webapps/axis/WEB-INF/server-config.wsdd is modified, i.e., the tag, <parameter name="enableRemoteAdmin" value="true"/>.

Anyone could give me some help? Thanks so much in advance!
Li Bing
  ----- Original Message ----- 
  From: Mark Volkmann 
  To: axis-user@xml.apache.org 
  Sent: Saturday, March 30, 2002 7:01 AM
  Subject: Re: Don't Know How to Use Custom Deployment


  I stumbled across the same thing. You need to copy all .class files your web service will need to $TOMCAT_HOME/webapps/axis/WEB-INF/classes with the appropriate package hierarchy of directories below that and any .jar files needed to $TOMCAT_HOME/webapps/axis/WEB-INF/lib. The user's guide doesn't mention this.

  If you're using Ant, create a deploy target that copies the files to where they need to be and runs AdminClient. Here's an example target with some of the properties it uses.

    <property environment="env"/>
    <property name="build.dir" value="classes"/>
    <property name="package" value="com.ociweb.cardealer"/>
    <property name="package.dir" value="com/ociweb/cardealer"/>
    <property name="src.dir" value="src"/>
    <property name="service.name" value="CarQuote"/>
    <property name="server.path" value="axis/servlet/AxisServlet/${service.name}"/>

    <target name="deploy" depends="compile"
            description="deploys the service to Tomcat">
      <copy todir="${env.TOMCAT_HOME}/webapps/axis/WEB-INF/classes" >
        <fileset dir="${build.dir}">
          <exclude name="**/*Client.class"/>
        </fileset>
      </copy>
      <echo>Tomcat must be running!</echo>
      <java classname="org.apache.axis.client.AdminClient"
            classpathref="classpath" fork="yes">
        <arg line="${src.dir}/${package.dir}/deploy.wsdd"/>
      </java>
      <echo>See WSDL at http://${server.host}:${server.port}/${server.path}?wsdl</echo>
    </target>

    ----- Original Message ----- 
    From: Li Bing 
    To: AXIS-USER 
    Cc: Li Bing 
    Sent: Saturday, March 30, 2002 4:17 AM
    Subject: Don't Know How to Use Custom Deployment


    Dear all,

    I am trying to learn how to use custom deployment. I did that as follows, but I failed.

    The following necessary files are stored in my working directory, for example, $HOME/temp.

    GreetingService.java
    AxisClient.java
    deploy.wsdd

    Then I run the following script,

    java org.apache.axis.client.AdminClient deploy.wsdd

    Should I copy some files to $TOMCAT_HOME/webapps/axis before that? If the parameter needed by GreetingService.java is an Object, I need to add <beanMapping> into the deploy.wsdd. Should I copy the Object to $TOMCAT_HOME/webapps/axis?

    I don't know how to do that.

    Thanks so much!
    Li Bing
                            _.--"""--._
                          .'       '-. `.
                       __/__    (-.   `\ \
                      /o `o \      \    \ \
                     _\__.__/ ))    |    | ;
                .--;"               |    |  \
               (    `)              |    |   \
              _|`---' .'      _,   _|    |    `\
            '`_\  \     '_,.-';_.-`\|     \     \_
            .'  '--'---;`  / /     |\     |_..--' \
                       \'-'.'     .--'.__/    __.-;
                        `"`      (___...---''`     \
                                 _/_                \
                                /ASU\ libing@asu.edu
                                \___/ 480-965-9038(L), 602-743-9767(C)
                                http://www.public.asu.edu/~libing

Re: Don't Know How to Use Custom Deployment

Posted by Li Bing <bi...@asu.edu>.
Thanks so much!
  ----- Original Message ----- 
  From: Mark Volkmann 
  To: axis-user@xml.apache.org 
  Sent: Saturday, March 30, 2002 7:01 AM
  Subject: Re: Don't Know How to Use Custom Deployment


  I stumbled across the same thing. You need to copy all .class files your web service will need to $TOMCAT_HOME/webapps/axis/WEB-INF/classes with the appropriate package hierarchy of directories below that and any .jar files needed to $TOMCAT_HOME/webapps/axis/WEB-INF/lib. The user's guide doesn't mention this.

  If you're using Ant, create a deploy target that copies the files to where they need to be and runs AdminClient. Here's an example target with some of the properties it uses.

    <property environment="env"/>
    <property name="build.dir" value="classes"/>
    <property name="package" value="com.ociweb.cardealer"/>
    <property name="package.dir" value="com/ociweb/cardealer"/>
    <property name="src.dir" value="src"/>
    <property name="service.name" value="CarQuote"/>
    <property name="server.path" value="axis/servlet/AxisServlet/${service.name}"/>

    <target name="deploy" depends="compile"
            description="deploys the service to Tomcat">
      <copy todir="${env.TOMCAT_HOME}/webapps/axis/WEB-INF/classes" >
        <fileset dir="${build.dir}">
          <exclude name="**/*Client.class"/>
        </fileset>
      </copy>
      <echo>Tomcat must be running!</echo>
      <java classname="org.apache.axis.client.AdminClient"
            classpathref="classpath" fork="yes">
        <arg line="${src.dir}/${package.dir}/deploy.wsdd"/>
      </java>
      <echo>See WSDL at http://${server.host}:${server.port}/${server.path}?wsdl</echo>
    </target>

    ----- Original Message ----- 
    From: Li Bing 
    To: AXIS-USER 
    Cc: Li Bing 
    Sent: Saturday, March 30, 2002 4:17 AM
    Subject: Don't Know How to Use Custom Deployment


    Dear all,

    I am trying to learn how to use custom deployment. I did that as follows, but I failed.

    The following necessary files are stored in my working directory, for example, $HOME/temp.

    GreetingService.java
    AxisClient.java
    deploy.wsdd

    Then I run the following script,

    java org.apache.axis.client.AdminClient deploy.wsdd

    Should I copy some files to $TOMCAT_HOME/webapps/axis before that? If the parameter needed by GreetingService.java is an Object, I need to add <beanMapping> into the deploy.wsdd. Should I copy the Object to $TOMCAT_HOME/webapps/axis?

    I don't know how to do that.

    Thanks so much!
    Li Bing
                            _.--"""--._
                          .'       '-. `.
                       __/__    (-.   `\ \
                      /o `o \      \    \ \
                     _\__.__/ ))    |    | ;
                .--;"               |    |  \
               (    `)              |    |   \
              _|`---' .'      _,   _|    |    `\
            '`_\  \     '_,.-';_.-`\|     \     \_
            .'  '--'---;`  / /     |\     |_..--' \
                       \'-'.'     .--'.__/    __.-;
                        `"`      (___...---''`     \
                                 _/_                \
                                /ASU\ libing@asu.edu
                                \___/ 480-965-9038(L), 602-743-9767(C)
                                http://www.public.asu.edu/~libing

Re: Don't Know How to Use Custom Deployment

Posted by Mark Volkmann <vo...@charter.net>.
I stumbled across the same thing. You need to copy all .class files your web service will need to $TOMCAT_HOME/webapps/axis/WEB-INF/classes with the appropriate package hierarchy of directories below that and any .jar files needed to $TOMCAT_HOME/webapps/axis/WEB-INF/lib. The user's guide doesn't mention this.

If you're using Ant, create a deploy target that copies the files to where they need to be and runs AdminClient. Here's an example target with some of the properties it uses.

  <property environment="env"/>
  <property name="build.dir" value="classes"/>
  <property name="package" value="com.ociweb.cardealer"/>
  <property name="package.dir" value="com/ociweb/cardealer"/>
  <property name="src.dir" value="src"/>
  <property name="service.name" value="CarQuote"/>
  <property name="server.path" value="axis/servlet/AxisServlet/${service.name}"/>

  <target name="deploy" depends="compile"
          description="deploys the service to Tomcat">
    <copy todir="${env.TOMCAT_HOME}/webapps/axis/WEB-INF/classes" >
      <fileset dir="${build.dir}">
        <exclude name="**/*Client.class"/>
      </fileset>
    </copy>
    <echo>Tomcat must be running!</echo>
    <java classname="org.apache.axis.client.AdminClient"
          classpathref="classpath" fork="yes">
      <arg line="${src.dir}/${package.dir}/deploy.wsdd"/>
    </java>
    <echo>See WSDL at http://${server.host}:${server.port}/${server.path}?wsdl</echo>
  </target>

  ----- Original Message ----- 
  From: Li Bing 
  To: AXIS-USER 
  Cc: Li Bing 
  Sent: Saturday, March 30, 2002 4:17 AM
  Subject: Don't Know How to Use Custom Deployment


  Dear all,

  I am trying to learn how to use custom deployment. I did that as follows, but I failed.

  The following necessary files are stored in my working directory, for example, $HOME/temp.

  GreetingService.java
  AxisClient.java
  deploy.wsdd

  Then I run the following script,

  java org.apache.axis.client.AdminClient deploy.wsdd

  Should I copy some files to $TOMCAT_HOME/webapps/axis before that? If the parameter needed by GreetingService.java is an Object, I need to add <beanMapping> into the deploy.wsdd. Should I copy the Object to $TOMCAT_HOME/webapps/axis?

  I don't know how to do that.

  Thanks so much!
  Li Bing
                          _.--"""--._
                        .'       '-. `.
                     __/__    (-.   `\ \
                    /o `o \      \    \ \
                   _\__.__/ ))    |    | ;
              .--;"               |    |  \
             (    `)              |    |   \
            _|`---' .'      _,   _|    |    `\
          '`_\  \     '_,.-';_.-`\|     \     \_
          .'  '--'---;`  / /     |\     |_..--' \
                     \'-'.'     .--'.__/    __.-;
                      `"`      (___...---''`     \
                               _/_                \
                              /ASU\ libing@asu.edu
                              \___/ 480-965-9038(L), 602-743-9767(C)
                              http://www.public.asu.edu/~libing