axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sumedha rubasinghe" <sumedh...@gmail.com>
Subject Re: Running SAAJ problem
Date Mon, 18 Jun 2007 05:21:31 GMT
Hi Joe,

Change the following line

QName bodyName = new
QName("http://localhost/axis2/services/SoapService","mymethod",
"m");
to
QName bodyName = new QName("http://localhost/xsd","mymethod", "m");

and it should work.


When calling a service from a client, you need to use the namespace
appearing in the wsdl. Check your wsdl. It must be having "
http://localhost/xsd".

/sumedha




On 6/18/07, Joe Nathan <jowen4077@yahoo.com> wrote:
>
>
> Hi,
>
> I am running Axis2 under Tomcat.
> I got a problem SAAJ client work.
> POJO SOAP class is, say, "SoapService", method is "mymethod".
> From a Tomcat servlet, it calls a SOAP service serviced under
> the same Tomcat instance. However I keep getting the following
> error message;
>
> ----------------------------------------------------------------------------------
> SEVERE: Exception occurred while trying to invoke service method input
> 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(
>
> --------------------------------------------------------------------------------------
>
> The SAAJ program part 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();
>
> ---------------------------------------------------------------------------------------
>
> Can you tell me what am I doing wrong?
> SOAP works if I try from web-browsers with the followin urls;
>
>     http://localhost/axis2/services/listServices
>     http://localhost/axis2/services/SoapService?wsdl
>     http://localhost/axis2/services/SoapService?xsd
>     http://localhost/axis2/services/SoapService/mymethod?vinput=15256
>
> Thanks in advance.
>
> Joe.
> --
> View this message in context:
> http://www.nabble.com/Running-SAAJ-problem-tf3937707.html#a11168244
> Sent from the Axis - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>

Mime
View raw message