Published on WSO2 Oxygen Tank (http://wso2.org)

Urgent - Invoking a web service from Javascript Mashup

By Shency
Created 2008-03-06 01:28

Hi,

      I am very new to WSO2 stack. I was trying the following scenario

1) Created a  simple web service and deployed in WSAS. The service simply takes an input string and prints back "hi"+ the input string. I tested it through the WSAS console and is working fine.

I could also generate WSDL 1.1 using the WSAS tool

2) Now want to invoke the WSAS service from a mashup. For that I have created a mashup in the WSO2 mashup server which has the following code

function toString(){
    //TODO: Add function code here
    // greet operation 
    var greetReturn = 'initial';
    var version = new WSRequest();
    var options = new Array();
    options.useSOAP = 1.1;
    options.useWSA = 1.0;
    options.action = "urn:greet";
    request = "<greet/>";
    try {    
        version.open(options,"http://10.226.106.68:9762/services/MyService [1]", false);        version.send(request);     
        greetReturn = version.responseE4X;
    } catch (e) {   
        print(e);
    }
    return greetReturn;
}

When I try invoking this mashup using the Try option, The request is reaching the WSAS server but gives the following error

ROR [2008-03-06 14:28:04,483]  Exception occurred while trying to invoke service method greet
g.apache.axis2.AxisFault: namespace mismatch require http://com [2] found none
      at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:172)
      at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
      at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
      at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:148)
      at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
      at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:121)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.wso2.adminui.AdminUIServletFilter.doFilter(AdminUIServletFilter.java:142)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)

What am I doing wrong here?

Find attached the WSDL file generated for the WSAS service.

Please help

Thanks Shency

 

 


Source URL:
http://wso2.org/forum/thread/3317