Hi,

I am trying to access a secured web service running on JBoss5 on
different machine. I am trying to access this web service through my
GWT application but getting following exception:-

java.rmi.RemoteException: This service requires <wsse:Security>, which
is missing.
        at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:524)
        at
com.test.src.server.GreetingServiceImpl.greetServer(GreetingServiceImpl.java:
59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
562)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
188)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
224)
        at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
362)
        at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
729)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
        at
org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:
49)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
        at org.mortbay.jetty.Server.handle(Server.java:324)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
        at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:843)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
395)
        at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:488)


My Impl class is :-

public class GreetingServiceImpl extends RemoteServiceServlet
implements
                GreetingService {
        static String qservice =  "SalesTaxService";
        static String qport =  "SalesTaxPort";

        static String BODY_NAMESPACE_VALUE= "http://ws.jbia.org/";;
        static String ENCODING_STYLE_PROPERTY =
"javax.xml.rpc.encodingstyle.namespace.uri";

        static String NS_XSD = "http://www.w3.org/2001/XMLSchema";;

        static String URI_ENCODING = "http://schemas.xmlsoap.org/soap/
encoding/";
        public String greetServer(String input) {
                String serverInfo = getServletContext().getServerInfo();
                /*String userAgent = getThreadLocalRequest().getHeader("User-
Agent");
                return "Hello, " + input + "!<br><br>I am running " + serverInfo
                                + ".<br><br>It looks like you are using:<br>" + 
userAgent;*/
                String result1 = null;
                   try
                   {
                         String target_endpoint = 
"http://10.164.139.149:8080/salestax/tax?
wsdl";

                      ServiceFactory factory  = ServiceFactory.newInstance();
                      Service service = factory.createService(new 
QName(qservice));

                      QName port = new QName(qport);
                      Call call = service.createCall(port);

                      call.setTargetEndpointAddress(target_endpoint);

                      call.setProperty(Call.SOAPACTION_USE_PROPERTY, new
Boolean(true));
                      call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");

                      call.setProperty(Call.ENCODINGSTYLE_URI_PROPERTY,
URI_ENCODING);

                      call.setOperationName(new QName(BODY_NAMESPACE_VALUE,
"getRate"));

                      QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
                      call.setReturnType(QNAME_TYPE_STRING);

                      call.addParameter("arg0",
QNAME_TYPE_STRING,ParameterMode.IN);

                      String[]params1 = {serverInfo};

                      result1 = (String)call.invoke(params1);
                      //System.out.println(result1);

                   }
                   catch (Exception e)
                   {
                      e.printStackTrace();
                   }
                   return result1;

        }
}

Please provide some help.

Thanks,
Dilshad Amar

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to