SAAJ and namespace

Hi,

I am having a problem in running SAAJ client for Axis running on Tomcat. My SAAJ code is as follows;

SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();

SOAPConnection connection = soapConnectionFactory.createConnection();

MessageFactory factory = MessageFactory.newInstance();

SOAPMessage message = factory.createMessage();

SOAPHeader header = message.getSOAPHeader();

SOAPBody body = message.getSOAPBody();

header.detachNode();

QName bodyName =new QName("http://localhost/axis2/services/SoapService",

"mymethod","m");

SOAPBodyElement bodyElement = body.addBodyElement(bodyName);

QName name =new QName("vinput");

SOAPElement symbol = bodyElement.addChildElement(name);

symbol.addTextNode("12667");

URL endpoint =new URL("http://localhost/axis2/services/SoapService/mymethod");

SOAPMessage sresponse = connection.call(message, endpoint);

connection.close();

However I am getting runtime errors like this;

SEVERE: Exception occurredwhile trying to invoke service method mymethod

org.apache.axis2.AxisFault: namespace mismatch require http://localhost/xsd found http://localhost/axis2/services/SoapService

at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:103)

at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)

at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)

at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(

My WEB-INF/services.xml is like this;

<service name="SoapService" scope="application">

<description>RME Soap Service</description>

<messageReceivers>

<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />

<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />

</messageReceivers>

<schema schemaNamespace="http://localhost/axis2/services/SoapService?xsd" />

<parameter name="ServiceClass">SoapService</parameter>

</service>

Could you tell me how this thing work? Especially how to specify namespace in different parts! This works fine if I use browser URLs!

Thanks in advance.

[3061 byte] By [jonathancreeka] at [2007-11-27 8:04:16]
# 1
I solved this problem. It was related to namespace!
jonathancreeka at 2007-7-12 19:46:38 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...