Hi there,
I'm trying to create a very simple Message style service in Axis 1.2.1
running in Tomcat 5.5.9 and JDK 1.5.0_04-b05 on Windows XP.
I have a simple class:
package com.xyz.testbed;
import javax.xml.soap.*;
public class CheckValue
{
public void foo(SOAPEnvelope req, SOAPEnvelope resp)
{
try
{
SOAPBody respbody = resp.getBody();
}
catch(Exception e) {}
}
}
with a deploy.wsdd that looks like:
<deployment name="test" xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<service name="Monkey" style="message">
<parameter name="className" value="com.xyz.testbed.CheckValue"/>
<parameter name="allowedMethods" value="foo"/>
</service>
</deployment>
I deploy it using the AdminClient and it reports everything is fine.
The server-config.wsdd has the following:
<service name="Monkey" provider="java:MSG" style="message"
use="literal">
<parameter name="allowedMethods" value="foo"/>
<parameter name="className"
value="com.hipaat.testbed.commands.CheckConsent"/>
</service>
However, when I try to invoke the service from a test client using:
SOAPConnection conn =
SOAPConnectionFactory.newInstance().createConnection();
SOAPMessage response = conn.call(smsg,
"http://localhost:8080/axis/services/Monkey");
// smsg is a SOAPMessage created from a string - this was taken from
samples.message.TestMsg
I get the following response:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
mlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.lang.reflect.InvocationTargetException</faultstring>
<detail><ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">workstation</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
I can invoke the sample.message.TestMsg no problem (I don't get a
response, but I think that's correct? Haven't run this using TCPMonitor
yet)
What does the InvocationTargetException usually indicate? I've tried
implementing my service as both:
public void foo(SOAPEnvelope req, SOAPEnvelope resp)
and
public void foo(SOAPEnvelope req, SOAPEnvelope resp) throws
javax.xml.soap.SOAPException
but both produce the same result.
Any thoughts?
Thanks in advance,
Andy
__________________________________________________________
Find your next car at http://autos.yahoo.ca