... for some reason this didn't go out yesterday, so here it is.

Hello Daniel,

What I see is your target endpoint doesn't need urn: . It should be :

http://localhost:8080/axis/services/HelloService2
You should be able to put this url in a web browser and get a message
from axis ... btw, add ?wsdl to this url to get the wsdl.
Also, your QName should be simply QName("HelloService2", "sayHello").

Your statement about your xml parser bothers me too ... it should find
the xml parser in $CATALINA_HOME/common/endorsed ... this is
tomcat's(and all webapps) default xml parser. You can alternatively add
the two jars in the tomcat directory to your axis/web-inf/lib directory.

Mark


Daniel Elenius wrote:

Hi!

I'm trying to deploy a simple "hello world" webapp with axis (1.1RC2)
and tomcat (4.1.18). I've managed to get the example webapps, like the
stock example, working, and happyaxis is happy, except that it says:

XML Parser Location: Null

I get a
(500)Internal Server Error

when I try to run my own service. I've really tried to understand this,
searched the mailing list archives etc, but I can't see what I'm doing
differently from the other examples that makes it not work. Can someone
tell me what I'm doing wrong?


My deploy.wsdd file looks like this:

------
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="urn:HelloService2" provider="java:RPC" >
<parameter name="className" value="HelloService2"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>
-----

And I have copied HelloService2.class to
$CATALINA_HOME/webapps/axis/WEB-INF/classes

The HelloService2.java file looks like this:

----
import java.io.*;
import java.net.*;
import java.util.*;

public class HelloService2 {

private static int counter = 0;

public static String sayHello( String message ) {

System.out.println("In HelloService2:sayhello()");
return "How is it going buddy! - " + message + " Called " +
++counter + " times";
}
}
----

And the client that tries to call it like this:

----
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;

public class HelloClientHTTP {
public static void main(String [] args) {
try {

String endpoint =
"http://localhost:8080/axis/services/urn:HelloService2";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );

call.setOperationName(new QName("FunServices:HelloService",
"sayHello"));
System.out.println("Trying to invoke SOAP service...");
String res = (String)call.invoke(new Object[] { "Hey Axis server!"
} );
System.out.println(res);
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
----

Reply via email to