I have created One webservice using the JBossws tool
Tools I am using :
JBoss 4.0.5 GA Application Server
JBossws Class
and Ant to build and deploy the webservice on the AppServer
Interface is:
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface math extends Remote
{
public int add(int a,int b) throws RemoteException;
}
And My Class is
import java.rmi.RemoteException;
public class mathClass implements math{
public int add(int a, int b) throws RemoteException {
return a+b;
}
}
and I have created config.xml as well as web.xml and uploaded the webservice on the JBoss
Appplication server.
It will also displays the service when I am tying that using
http://localhost:8080/jbossws/services
but when I am creating a client using ther org.apache.axis api
My Client code is :
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Service;
import org.apache.axis.client.Call;
import org.apache.axis.encoding.XMLType;
public class MathClientAxis {
public MathClientAxis()
{
getData();
}
public void getData()
{
try {
Service service = new Service();
Call call = (Call) service.createCall();
String endpoint = "http://localhost:8080/mathservice/MathWs?WSDL";
call.setTargetEndpointAddress(endpoint);
call.setOperationName("add");
call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
call.setUseSOAPAction(false);
System.out.println(org.apache.axis.Constants.URI_SOAP11_ENC);
call.addParameter("int_1",XMLType.XSD_INT, ParameterMode.IN);
call.addParameter("int_2",XMLType.XSD_INT, ParameterMode.IN);
call.setReturnType(XMLType.XSD_INT);
Object temp;
temp = call.invoke(new Object[] {new Integer(4),new Integer(5)});
System.out.println("output"+temp); }
catch(Exception e) { e.printStackTrace(); } }
public static void main(String args[])
{
new MathClientAxis();
}
}
When I invoke the client it will display the following error:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Endpoint {http://math.ws.jboss.org/}mathPort does
not contain operation meta data for: add
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1480)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084468#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...