[jboss-user] [JBossWS] - Re: Using WSSecurityHandlerOutbound in a DII client

ShadenS do-not-reply at jboss.com
Sat Aug 5 10:36:25 EDT 2006


Uff.. I don't know how to adapt examples and suggestions to my source code :(

I have a DII client that works fine without ws-security (sure, also web service without ws-security).

Follow copy/paste my code...
maybe, you are some idea about how "transform" my DII client for contacting a "secure" webservice (ws-security, chapter 14).

In any case, I can deploy also dii client within AS if this solve problem :(


  | public void WhatTimeAccessDII()
  | 	{
  | 	     String endpoint = "http://notebook:8080/July-EjbWs-181/TimeBean";
  | 	     String qnameService = "WhatTimeService";
  | 	     String qnamePort = "ClockTime";
  | 		 String BODY_NAMESPACE_VALUE = "http://src/jaws";
  | 	     String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
  | 		 String NS_XSD = "http://www.w3.org/2001/XMLSchema";
  | 		 String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
  | 		 
  | 		 try {
  | 				ServiceFactory factory = ServiceFactory.newInstance();
  | 				Service service = factory.createService(new QName(qnameService));
  | 				
  | 				QName port = new QName(qnamePort);
  | 				
  | 				//create JAX-RPC Call using JAX-RPC Service's createCall() method.
  | 				Call call = service.createCall(port);
  | 				
  | 				// Configure your Call instance with its setter methods
  | 				call.setTargetEndpointAddress(endpoint);
  | 				call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
  | 				call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
  | 				call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);			
  | 				QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
  | 				call.setOperationName(new QName(BODY_NAMESPACE_VALUE, "whatTimeIsIt"));
  | 				call.setReturnType(QNAME_TYPE_STRING);
  | 				
  | 				call.addParameter("String_1", QNAME_TYPE_STRING, ParameterMode.IN);
  | 				String[] params = { "Dr. Emmet Brown " };
  | 				
  | 				// Invoke the WS operation using the JAX-RPC Call's invoke method
  | 				String result = (String) call.invoke(params);
  | 				
  | 				System.out.println(result);
  | 				
  | 			} catch (SOAPFaultException ex) {
  | 				System.out.println("Error about Soap messages.");
  | 				ex.printStackTrace();
  | 			} catch (RemoteException e) {
  | 				System.out.println("Errore sulla call.invoke");
  | 				e.printStackTrace();
  | 			} catch (ServiceException e) {
  | 				System.out.println("Errore sulla Service o createService");
  | 				e.printStackTrace();
  | 			}
  | 	}
  | 
How can I add to this client ws-security features? I follow jbossWS guide but I don't succeed. 
I repeat: in the worst of case, I can also deploy client into AS ;)

Heeeeeeeeeeeeeeeeeeeeeeeeeeeeelp!!

:_(




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963392#3963392

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963392



More information about the jboss-user mailing list