[JBossWS] - Re: JBossWS Tools Overview (wstools, wsprovide, wsconsume)
by kosmos
To make wsconsume, wstools & wsprovide work without installing to jboss i had to do following:
1. create WSCONSUME_CLASSPATH, JBOSS_HOME and JAVA_HOME enviroment variables
2. edit wsconcume.bat strings 34-52 from
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-xml-binding.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/wstx.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/activation.jar
| set …
[View More]WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/javassist.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/getopt.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-api.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxws.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-client.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
|
to
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jboss-xml-binding.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/wstx.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/activation.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/javassist.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/getopt.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jaxb-api.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/stax-api.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jaxb-impl.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jaxb-xjc.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jaxws-rt.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jaxws-tools.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jbossws-spi.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jbossall-client.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jboss-saaj.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jboss-jaxrpc.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jboss-jaxws.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/jbossws-client.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/log4j.jar
| set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/lib/mail.jar
|
(other *.bat in the same way)
P.S. Only after this NoClassDefFoundExeption disappeared
P.S.2. It's not good to use %WSCONSUME_CLASSPATH%, %WSPROVIDE_CLASSPATH%, %WSRUNCLIENT_CLASSPATH%, %WSTOOLS_CLASSPATH% variables, because all of them i have to create in the system enviroment! Mach better to use %WS_CLASSPATH% in all *.bat
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120414#4120414
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120414
[View Less]
17 years
[JBossWS] - Re: WSSE UsernameToken without HTTP basic auth?
by mikaeljl
Hi!
Thank you for the answer.
I have more questions though:
You are saying that:
"The Username token sent in the SOAP Message is the one used by the endpoint server/stack to authenticate the user who is performing this request."
Good, this is what I want, I want the user to be authenticated based on the UsernameToken.
However,I do not want to secure the servlet as such on http level. I do not want to use http basic authentication in addition to the UsernameToken.
As you can see in my …
[View More]previous posts I've been trying to set this up without successes. As soon as I remove the HTTP basic auth authentication I can no lnger retrieve the principal information using the standard API. I can see that the WSEE data is parsed because I can get the principal info using: org.jboss.security.SecurityAssociation.getPrincipal() but no authentication seems to take place.
Do you have any examples of UsernameToken without http basic auth where the user is athenticated based on the UsernameToken data? The example under /src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity will be using http basic auth since it is default. Will this example work if http basic auth is removed ???
There implementation of the server is simply doing
Principal principal = wsCtx.getUserPrincipal();
| log.info("getUsernameToken: " + principal);
| return principal.toString();
| But will this really work if http basic auth is not enabled?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120370#4120370
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120370
[View Less]
17 years
[JBossWS] - Re: WSSE UsernameToken without HTTP basic auth?
by mageshbk@jboss.com
JBoss webservices stack supports variety of endpoint deployment models:
1. Simple JDK5 POJOs that are wrapped in a war file.
2. EJB3 endpoints that are wrapped in a ejb jar file.
3. Servlet endpoints wrapped in a war file.
4. EJB2.1 endpoints using jar archive.
Now for the Servlet/POJO model endpoints the endpoints are secured for authentication using JAAS or any other means that is supported by Servlet specification. For EJB style endpoints the EJBs are secured for authentication …
[View More]according to the EJB2.1 or EJB3 specifications. Please read our UserGuide for more information
http://jbws.dyndns.org/mediawiki/index.php?title=JAX-WS_User_Guide#WS-Sec...
Basically Security on endpoints is done as above, and HTTP is a transport mechanism used to send your messages. It can be HTTP/HTTPS or whatever methodology you want to choose as. When you use HTTP the SOAP message is wrapped or sent across the wire using HTTP protocol.
By default when you send in the credentials:
| reqContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
| reqContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
|
the default authorization mechanism that is set from the client is AUTH_TYPE_BASIC. See org.jboss.ws.core.client.RemotingConnectionImpl
| // Get authentication type, default to BASIC authetication
| String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
| if (authType == null)
| authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
|
When it reaches the service endpoint in the server, this message is unwrapped from the HTTP or whatever protocol/transport mechanism you used and then supplied to the service endpoint after re-creating the SOAPMessage. The Username token sent in the SOAP Message is the one used by the endpoint server/stack to authenticate the user who is performing this request. This is called MessageLevel Security as defined by UsernameToken profile. If you see, Servlet endpoints can be configured with only basic or digest as per the specs of their deployment model. So setting AUTH_TYPE_WSSE is not and will not be applicable to the servlet deployment model unless you write your own customized implementation for it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120345#4120345
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120345
[View Less]
17 years
[JBossWS] - Adding application specific properties to the MessageContext
by kellenheller
I'm trying to add application specific properties to the MessageContext to retrieve either in my service via WebServiceContext or in a SoapMessageHandler via messageContext.
No matter how I try to retrieve them, the properties are always null:
Here's my test code:
Service service = getWebService( ); //works fine
| HaloImpl endPoint = service.getPort( HaloImpl.class );
|
| //setup custom properties in RequestContext
| BindingProvider bp = …
[View More](BindingProvider) endPoint;
| bp.getRequestContext( );
| Map<String,Object> context = bp.getRequestContext( );
| context.put( "prop1", "value1");
| context.put( "prop2", "value2");
|
| return (HaloImpl) bp;
Then I call the endpoint service, no problem.
In the handler:
public class HaloHandler implements SOAPHandler<SOAPMessageContext>
| {
|
| //@Override
| public boolean handleMessage( SOAPMessageContext msgContext )
| {
|
| try
| {
| String prop1 = (String) msgContext.get( "prop1" );
| String prop2 = (String) msgContext.get( "prop2" );
|
| } catch( Exception e )
| {
| throw new RuntimeException( e );
| }
|
| return true;
| }
The handler is configured on the server side via the @HandlerChain annotation, and it is being executed. However, prop1 and prop2 are always null, when they should have "value1" and "value2" respectively.
I've tried adding the WebServiceContext in the web service impl class like so:
@Resource
| WebServiceContext ctx;
|
| public HaloImpl( )
| {
|
| }
and then accessing the properties in a method when a service method is called:
private void validateProperties( )
| {
| MessageContext msg = ctx.getMessageContext( );
| if (msg != null){
|
| String prop1 = (String) msg.get( "prop1" );
| String prop2 = (String) msg.get( "prop2" );
| }
| }
but again, the properties are null.
Am I missing a setting? I've seen several examples in different implementations showing this is the way to access custom properties, but I can't seem to get this to work.
I am using Jboss 4.2.2 with the default jax-ws stack it came with in there ( v2.0.1.SP2 ).
Anybody have any ideas? Thanks guys :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120208#4120208
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120208
[View Less]
17 years
[JBossWS] - Re: Jsr181 typenamespace specification.
by richard.opalka@jboss.com
Here's example:
package org.mycompany.types;
|
| import javax.xml.bind.annotation.XmlAccessType;
| import javax.xml.bind.annotation.XmlAccessorType;
| import javax.xml.bind.annotation.XmlElement;
| import javax.xml.bind.annotation.XmlType;
|
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "SpamResult", namespace="http://mycompany.org/types", propOrder = {
| "email",
| "fromAddress",
| "mailDate",
| "complaintDate",
| "mailbox",
| "…
[View More]complainer",
| "xRext",
| "accountName"
| })
| public final class SpamResult
| {
| @XmlElement(required = true, nillable = true)
| protected String email;
| @XmlElement(required = true, nillable = true)
| protected String fromAddress;
| @XmlElement(required = true, nillable = true)
| protected String mailDate;
| @XmlElement(required = true, nillable = true)
| protected String complaintDate;
| @XmlElement(required = true, nillable = true)
| protected String mailbox;
| @XmlElement(required = true, nillable = true)
| protected String complainer;
| @XmlElement(required = true, nillable = true)
| protected String xRext;
| @XmlElement(required = true, nillable = true)
| protected String accountName;
|
| public SpamResult()
| {
| }
|
| public SpamResult(String email, String fromAddress, String mailDate, String complaintDate, String mailbox, String complainer, String xRext, String accountName)
| {
| this.email = email;
| this.fromAddress = fromAddress;
| this.mailDate = mailDate;
| this.complaintDate = complaintDate;
| this.mailbox = mailbox;
| this.complainer = complainer;
| this.xRext = xRext;
| this.accountName = accountName;
| }
|
| public String[] get()
| {
| return new String[] { email, fromAddress, mailDate, complaintDate, mailbox, complainer, xRext, accountName };
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120132#4120132
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120132
[View Less]
17 years