You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Shivani Sawhney <sh...@impetus.co.in> on 2007/07/19 12:26:29 UTC

Configuring security in client code for mule (uses axis)

Hi All,

 

I understand that I should be posting this query on mule forums first and
have done so but have got no help so far. Would appreciate any help from
Axis users.

 

I have successfully deployed a web service with ws-security on Axis2, but am
unable to deploy the same web service on Mule (ESB), which uses Axis
internally.

 

The security has been enabled on server side and client request gets an
error message which says, "WSDoAllReceiver: Request does not contain
required Security header". Can someone please tell me how to provide
client-config.xml to the client or set properties through
WSHandlerConstants? 

Following is the code I am using but still the security error.

 

 

package mule.client;

 

import java.util.Properties;

 

import org.apache.ws.security.WSConstants;

import org.apache.ws.security.handler.WSHandlerConstants;

import org.mule.extras.client.MuleClient;

import org.mule.umo.UMOException;

import org.mule.umo.UMOMessage;

 

public class MuleSpecificClient

{

    public static void main(String[] args)

    {

        Properties props = new Properties();

 

        // Action to perform : Signature

        props.setProperty(WSHandlerConstants.ACTION,
WSHandlerConstants.SIGNATURE);

 

        // User name to send

        props.setProperty(WSHandlerConstants.USER, "clientkeystore");

 

        // Password type : text or digest

        props.setProperty(WSHandlerConstants.PASSWORD_TYPE,
WSConstants.PASSWORD_DIGEST);

 

        // Callback used to retrive password for given user.

        props.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
"mule.util.PWCallback");

        //

        // // Configuration for accessing private key in keystore

        props.setProperty(WSHandlerConstants.SIG_PROP_FILE,
"out-signed-security.properties");

        //

        // // Set signature method to DirectReference

        props.setProperty(WSHandlerConstants.SIG_KEY_ID, "DirectReference");

        //

        //

        //

        //

        UMOMessage result = null;

        try

        {

            //

            MuleClient client = new MuleClient();

            //

            //

            result =
client.send("axis:http://localhost:8081/services/myWebService?method=echo",
"Inputgot", props);

            //

            System.out.println("Message Echoed is: " +
result.getPayload().toString());

            //

            //

        } catch (UMOException e)

        {

            System.out.println(e.getDetailedMessage());

            e.printStackTrace();

        }

 

    }

}

 

Sincerely, 

Shivani Sawhney 


RE: Configuring security in client code for mule (uses axis)

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Shivani,

I don't know Axis1. I've just warned you that Mule does not support
Axis2 (you mentioned it in your first post). 

Michele

On Thu, 2007-07-19 at 18:55 +0530, Shivani Sawhney wrote:
> Hi Michele,
> 
> Thanks for your response.
> 
> I understand that Mule supports Axis1 but am I doing something in my code
> that is not supported on Axis1? Don't know how that should affect my code.
> Can you please suggest...
> 
> Sincerely, 
> 
> Shivani Sawhney 
> 
> Phone: +91-120-4363300 x 2624
> 
> -----Original Message-----
> From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk] 
> Sent: Thursday, July 19, 2007 4:40 PM
> To: axis-user@ws.apache.org
> Subject: Re: Configuring security in client code for mule (uses axis)
> 
> Shivani,
> 
> to my knowledge Mule has an Axis1 connector only [1].
> 
> Michele
> 
> [1] http://mule.mulesource.org/jira/browse/MULE-566
> 
> On Thu, 2007-07-19 at 15:56 +0530, Shivani Sawhney wrote:
> > Hi All,
> > 
> >  
> > 
> > I understand that I should be posting this query on mule forums first
> > and have done so but have got no help so far. Would appreciate any
> > help from Axis users.
> > 
> >  
> > 
> > I have successfully deployed a web service with ws-security on Axis2,
> > but am unable to deploy the same web service on Mule (ESB), which uses
> > Axis internally.
> > 
> >  
> > 
> > The security has been enabled on server side and client request gets
> > an error message which says, "WSDoAllReceiver: Request does not
> > contain required Security header". Can someone please tell me how to
> > provide client-config.xml to the client or set properties through
> > WSHandlerConstants? 
> > 
> > Following is the code I am using but still the security error.
> > 
> >  
> > 
> >  
> > 
> > package mule.client;
> > 
> >  
> > 
> > import java.util.Properties;
> > 
> >  
> > 
> > import org.apache.ws.security.WSConstants;
> > 
> > import org.apache.ws.security.handler.WSHandlerConstants;
> > 
> > import org.mule.extras.client.MuleClient;
> > 
> > import org.mule.umo.UMOException;
> > 
> > import org.mule.umo.UMOMessage;
> > 
> >  
> > 
> > public class MuleSpecificClient
> > 
> > {
> > 
> >     public static void main(String[] args)
> > 
> >     {
> > 
> >         Properties props = new Properties();
> > 
> >  
> > 
> >         // Action to perform : Signature
> > 
> >         props.setProperty(WSHandlerConstants.ACTION,
> > WSHandlerConstants.SIGNATURE);
> > 
> >  
> > 
> >         // User name to send
> > 
> >         props.setProperty(WSHandlerConstants.USER, "clientkeystore");
> > 
> >  
> > 
> >         // Password type : text or digest
> > 
> >         props.setProperty(WSHandlerConstants.PASSWORD_TYPE,
> > WSConstants.PASSWORD_DIGEST);
> > 
> >  
> > 
> >         // Callback used to retrive password for given user.
> > 
> >         props.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
> > "mule.util.PWCallback");
> > 
> >         //
> > 
> >         // // Configuration for accessing private key in keystore
> > 
> >         props.setProperty(WSHandlerConstants.SIG_PROP_FILE,
> > "out-signed-security.properties");
> > 
> >         //
> > 
> >         // // Set signature method to DirectReference
> > 
> >         props.setProperty(WSHandlerConstants.SIG_KEY_ID,
> > "DirectReference");
> > 
> >         //
> > 
> >         //
> > 
> >         //
> > 
> >         //
> > 
> >         UMOMessage result = null;
> > 
> >         try
> > 
> >         {
> > 
> >             //
> > 
> >             MuleClient client = new MuleClient();
> > 
> >             //
> > 
> >             //
> > 
> >             result =
> >
> client.send("axis:http://localhost:8081/services/myWebService?method=echo",
> "Inputgot", props);
> > 
> >             //
> > 
> >             System.out.println("Message Echoed is: " +
> > result.getPayload().toString());
> > 
> >             //
> > 
> >             //
> > 
> >         } catch (UMOException e)
> > 
> >         {
> > 
> >             System.out.println(e.getDetailedMessage());
> > 
> >             e.printStackTrace();
> > 
> >         }
> > 
> >  
> > 
> >     }
> > 
> > }
> > 
> >  
> > 
> > Sincerely, 
> > 
> > Shivani Sawhney 
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Configuring security in client code for mule (uses axis)

Posted by Shivani Sawhney <sh...@impetus.co.in>.
Hi Michele,

Thanks for your response.

I understand that Mule supports Axis1 but am I doing something in my code
that is not supported on Axis1? Don't know how that should affect my code.
Can you please suggest...

Sincerely, 

Shivani Sawhney 

Phone: +91-120-4363300 x 2624

-----Original Message-----
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk] 
Sent: Thursday, July 19, 2007 4:40 PM
To: axis-user@ws.apache.org
Subject: Re: Configuring security in client code for mule (uses axis)

Shivani,

to my knowledge Mule has an Axis1 connector only [1].

Michele

[1] http://mule.mulesource.org/jira/browse/MULE-566

On Thu, 2007-07-19 at 15:56 +0530, Shivani Sawhney wrote:
> Hi All,
> 
>  
> 
> I understand that I should be posting this query on mule forums first
> and have done so but have got no help so far. Would appreciate any
> help from Axis users.
> 
>  
> 
> I have successfully deployed a web service with ws-security on Axis2,
> but am unable to deploy the same web service on Mule (ESB), which uses
> Axis internally.
> 
>  
> 
> The security has been enabled on server side and client request gets
> an error message which says, "WSDoAllReceiver: Request does not
> contain required Security header". Can someone please tell me how to
> provide client-config.xml to the client or set properties through
> WSHandlerConstants? 
> 
> Following is the code I am using but still the security error.
> 
>  
> 
>  
> 
> package mule.client;
> 
>  
> 
> import java.util.Properties;
> 
>  
> 
> import org.apache.ws.security.WSConstants;
> 
> import org.apache.ws.security.handler.WSHandlerConstants;
> 
> import org.mule.extras.client.MuleClient;
> 
> import org.mule.umo.UMOException;
> 
> import org.mule.umo.UMOMessage;
> 
>  
> 
> public class MuleSpecificClient
> 
> {
> 
>     public static void main(String[] args)
> 
>     {
> 
>         Properties props = new Properties();
> 
>  
> 
>         // Action to perform : Signature
> 
>         props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.SIGNATURE);
> 
>  
> 
>         // User name to send
> 
>         props.setProperty(WSHandlerConstants.USER, "clientkeystore");
> 
>  
> 
>         // Password type : text or digest
> 
>         props.setProperty(WSHandlerConstants.PASSWORD_TYPE,
> WSConstants.PASSWORD_DIGEST);
> 
>  
> 
>         // Callback used to retrive password for given user.
> 
>         props.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
> "mule.util.PWCallback");
> 
>         //
> 
>         // // Configuration for accessing private key in keystore
> 
>         props.setProperty(WSHandlerConstants.SIG_PROP_FILE,
> "out-signed-security.properties");
> 
>         //
> 
>         // // Set signature method to DirectReference
> 
>         props.setProperty(WSHandlerConstants.SIG_KEY_ID,
> "DirectReference");
> 
>         //
> 
>         //
> 
>         //
> 
>         //
> 
>         UMOMessage result = null;
> 
>         try
> 
>         {
> 
>             //
> 
>             MuleClient client = new MuleClient();
> 
>             //
> 
>             //
> 
>             result =
>
client.send("axis:http://localhost:8081/services/myWebService?method=echo",
"Inputgot", props);
> 
>             //
> 
>             System.out.println("Message Echoed is: " +
> result.getPayload().toString());
> 
>             //
> 
>             //
> 
>         } catch (UMOException e)
> 
>         {
> 
>             System.out.println(e.getDetailedMessage());
> 
>             e.printStackTrace();
> 
>         }
> 
>  
> 
>     }
> 
> }
> 
>  
> 
> Sincerely, 
> 
> Shivani Sawhney 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Configuring security in client code for mule (uses axis)

Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Shivani,

to my knowledge Mule has an Axis1 connector only [1].

Michele

[1] http://mule.mulesource.org/jira/browse/MULE-566

On Thu, 2007-07-19 at 15:56 +0530, Shivani Sawhney wrote:
> Hi All,
> 
>  
> 
> I understand that I should be posting this query on mule forums first
> and have done so but have got no help so far. Would appreciate any
> help from Axis users.
> 
>  
> 
> I have successfully deployed a web service with ws-security on Axis2,
> but am unable to deploy the same web service on Mule (ESB), which uses
> Axis internally.
> 
>  
> 
> The security has been enabled on server side and client request gets
> an error message which says, "WSDoAllReceiver: Request does not
> contain required Security header". Can someone please tell me how to
> provide client-config.xml to the client or set properties through
> WSHandlerConstants? 
> 
> Following is the code I am using but still the security error.
> 
>  
> 
>  
> 
> package mule.client;
> 
>  
> 
> import java.util.Properties;
> 
>  
> 
> import org.apache.ws.security.WSConstants;
> 
> import org.apache.ws.security.handler.WSHandlerConstants;
> 
> import org.mule.extras.client.MuleClient;
> 
> import org.mule.umo.UMOException;
> 
> import org.mule.umo.UMOMessage;
> 
>  
> 
> public class MuleSpecificClient
> 
> {
> 
>     public static void main(String[] args)
> 
>     {
> 
>         Properties props = new Properties();
> 
>  
> 
>         // Action to perform : Signature
> 
>         props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.SIGNATURE);
> 
>  
> 
>         // User name to send
> 
>         props.setProperty(WSHandlerConstants.USER, "clientkeystore");
> 
>  
> 
>         // Password type : text or digest
> 
>         props.setProperty(WSHandlerConstants.PASSWORD_TYPE,
> WSConstants.PASSWORD_DIGEST);
> 
>  
> 
>         // Callback used to retrive password for given user.
> 
>         props.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
> "mule.util.PWCallback");
> 
>         //
> 
>         // // Configuration for accessing private key in keystore
> 
>         props.setProperty(WSHandlerConstants.SIG_PROP_FILE,
> "out-signed-security.properties");
> 
>         //
> 
>         // // Set signature method to DirectReference
> 
>         props.setProperty(WSHandlerConstants.SIG_KEY_ID,
> "DirectReference");
> 
>         //
> 
>         //
> 
>         //
> 
>         //
> 
>         UMOMessage result = null;
> 
>         try
> 
>         {
> 
>             //
> 
>             MuleClient client = new MuleClient();
> 
>             //
> 
>             //
> 
>             result =
> client.send("axis:http://localhost:8081/services/myWebService?method=echo", "Inputgot", props);
> 
>             //
> 
>             System.out.println("Message Echoed is: " +
> result.getPayload().toString());
> 
>             //
> 
>             //
> 
>         } catch (UMOException e)
> 
>         {
> 
>             System.out.println(e.getDetailedMessage());
> 
>             e.printStackTrace();
> 
>         }
> 
>  
> 
>     }
> 
> }
> 
>  
> 
> Sincerely, 
> 
> Shivani Sawhney 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org