I am using the code in samples/jaxrpc/hello as a template to build my
service.
In HelloClient, it uses the following code to get a service stub:

        String UrlString =
"http://localhost:8080/axis/services/HelloPort?wsdl";;
        String nameSpaceUri = "http://hello.jaxrpc.samples/";;
        String serviceName = "HelloWorld";
        String portName = "HelloPort";

        URL helloWsdlUrl = new URL(UrlString);
        ServiceFactory serviceFactory = ServiceFactory.newInstance();
        Service helloService = serviceFactory.createService(helloWsdlUrl,
                new QName(nameSpaceUri, serviceName));

        java.util.List list =
helloService.getHandlerRegistry().getHandlerChain(new QName(nameSpaceUri,
portName));
        list.add(new
javax.xml.rpc.handler.HandlerInfo(ClientHandler.class,null,null));

        Hello myProxy = (Hello) helloService.getPort(
                new QName(nameSpaceUri, portName),
                samples.jaxrpc.hello.Hello.class);  
 
According to the user guide, the client can get a service stub from the
locator,
under the section 'Services'.  When I followed the instruction and modified
the code to
make the following calls instead of the above snippet,

        HelloWorld service = new HelloWorldLocator();
        Hello myProxy      = service.getHelloPort();

When the call myProxy.sayHello(msg) is made, the first method, using
ServiceFactory, works fine.
But the second method, using the HelloWorldLocator, fails with the following
SOAP fault.
What is the problem?


Exception in thread "main" AxisFault
 faultCode: {http://xml.apache.org/axis/}HTTP
 faultSubcode:
 faultString: (404)/axis/Hello
 faultActor:
 faultNode:
 faultDetail:
        {}string: return code:  404
<html><head><title>Apache Tomcat/5.0.9 - Error
report</title&gt<style><!--H1
{fontfamily:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;fon
t-size:22px;} H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;fo
nt-size:16px;} H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;fo
nt-size:14px;} BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:525D76;} P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:
12px;}A {color : black;}HR {color : #525D76;}--></style>
</head><body><h1>HTTP Status 404 -
/axis/Hello</h1><HR size="1"
noshade><p><b>type</b> Status
report</p><p><b>message</b>
<u>/axis/Hello</u></p><p><b>description</b&
gt; <u>The requested resource (/axis/Hello) is not
available.</u></p><HR size="1"
noshade><h3>Apache
Tomcat/5.0.9</h3></body></html>

(404)/axis/Hello
        at
org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.j
ava:630)
        at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:128)

        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:71)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
        at org.apache.axis.client.Call.invoke(Call.java:2553)
        at org.apache.axis.client.Call.invoke(Call.java:2248)
        at org.apache.axis.client.Call.invoke(Call.java:2171)
        at org.apache.axis.client.Call.invoke(Call.java:1691)
....

<<attachment: winmail.dat>>

Reply via email to