Problema no deploy do Axis

0 respostas
EderBaum

Bem, Na verdade estou querendo fazer o deploy do Webservice no código e andei estudando o AdminClient.java do Axis e ele não parece complexo assim

http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/client/AdminClient.java?view=co

Então tenho oo seguinte código:

EightBall.java
package com.teste;

import java.util.Random;
import java.lang.Double;
import java.util.Date;

public class EightBall {
  static String answers[] = {"Yes.",
   "Outlook not so good.",
  // The other 17 answers were
  // removed for brevity.
   "Don't count on it."};
   
  public static String getAnswer() {
    return askQuestion("");
  }
  
  public static String askQuestion (String question) {
    java.util.Random r = new Random
      (new Date().getTime());
    java.lang.Double d = new Double
      ((r.nextDouble()*20)-1);
    return new String(answers[d.intValue()]);
  }  
 
}
DeployEightBall.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/ wsdd/providers/java">
  <service name="urn:EightBall"
      provider="java:RPC">
     <parameter name="className"  value="com.teste.EightBall"/>
     <parameter name="allowedMethods"  value="getAnswer askQuestion"/>
  </service>
</deployment>

e finalmente o código que uso para fazer o deploy

private void deploy() throws Exception {        
        org.apache.axis.client.AdminClient client = new org.apache.axis.client.AdminClient();        
        String url           = "-lhttp://localhost:8080/Axis/servlet/AxisServlet";        
        String xmlConfigFile = "E:\\java\\Axis\\build\\web\\WEB-INF\\classes\\DeployEightBall.wsdd";
        
        String args[] = new String[]{url, xmlConfigFile}; 
        client.process(args);        
    }

Rodo o TomCat, com axis e tudo na Boa. Mas quando rodo o servlet que publicaria o WebService tenho o seguinte erro:

Processing file E:\java\Axis\build\web\WEB-INF\classes\DeployEightBall.wsdd
AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.NoService
 faultSubcode: 
 faultString: The AXIS engine could not find a target service to invoke!  targetService is null
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}hostname:dev

O que está errado????

Criado 21 de março de 2007
Respostas 0
Participantes 1