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 "Sedambi, Gururaja" <gu...@lehman.com> on 2007/07/12 07:53:25 UTC

Problem in deploying axis in weblogic


> Hi,
> 
> I have written tradeDetail.java which has one service
> getTradeDetails(String input), we complied and placed in
> %TOMCAT_HOME%\webapps\axis\WEB-INF\classes folder.
> (WEB-INF\lib contains all the necessary libraries)
> Wrote following wsdd file 
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
> <service name="Trade" provider="java:document"> <parameter
> name="className" value="tradeDetail"/> <parameter
> name="allowedMethods" value="*"/> </service> </deployment> 
> We were able to access the WSDL file and also client program to access
> the service.
> Now, when we made a war file jar- cvf trade.war
> %TOMCAT_HOME%\webapps\axis\*
> We deployed the same war file in weblogic and when we try to access
> the WSDL we are getting the following error:
> And now... Some Services
> AXIS error
> Sorry, something seems to have gone wrong... here are the details:
> Fault - Could not find class for the service named: tradeDetail
> Hint: you may need to copy your class files/tree into the right
> location (which depends on the servlet system you are using).; nested
> exception is: 
> 	java.lang.ClassNotFoundException: Class bytes found but
> defineClass()failed for: 'tradeDetail'
> AxisFault
>  faultCode:
> {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
>  faultSubcode: 
>  faultString: Could not find class for the service named: tradeDetail
> Hint: you may need to copy your class files/tree into the right
> location (which depends on the servlet system you are using).; nested
> exception is: 
> 	java.lang.ClassNotFoundException: Class bytes found but
> defineClass()failed for: 'tradeDetail'
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}hostname:cfwlfdev05.lehman.com
> 
> Please let me know what should I do to complete the flow.
> 
> Regards,
> Gururaja
> 
> 
> 
>  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.

--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.



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


RE: Configuring Axis2 client

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

Thanks so much for your reply. 
I have been able to configure and run the Axis2 security with simple
configurations. Will try out the policy thing now. 
Thanks so much again.

Sincerely, 

Shivani Sawhney 

-----Original Message-----
From: Dimuthu [mailto:muthulee@apache.org] 
Sent: Thursday, July 12, 2007 4:09 PM
To: axis-user@ws.apache.org
Subject: Re: Configuring Axis2 client

Hi,

There are two ways to configure security - one method is to use simple
configurations and the other is to use Policy. Simple configurations are
being deprecated, so better to use Policy.

Policy samples are available in Rampart Distribution's sample/policy
directory. There are four samples.

Cheers,
Dimuthu

On Thu, 2007-07-12 at 12:03 +0530, Shivani Sawhney wrote:
> Hi All,
> 
> I am really new to Axis and am using Axis2 1.2.
> 
> I have to use WS-Security on Axis2. I have deployed the service on server
> and enabled the service's security but do not know the exact steps to
> configure the client side for security. Am I supposed to configure a
client
> repository and configure axis2.xml for client too? If yes, then how
exactly
> is the security to be configured there?
> 
> 
> Can someone please guide me on the same or refer a tutorial or link on
> configuring the client of Axis2 or a sample web service with security
> enabled and all the xml sect required.
> 
> Any help will be most appreciated.
> 
> ------------------------------------------------
> Code:
> Services.xml
> 
> <service name="MyService" provider="java:RPC" style="document"
> 	use="literal">
> 
> 	<description>
> 		This is a sample Web Service with two operations, echo and
> ping.
> 	</description> 
> 
> 	<parameter name="ServiceClass" locked="false">
> 		userguide.example1.MyService
> 	</parameter>
> 
> 
> 	<parameter name="scope" value="application" />
> 	<parameter name="allowedMethods" value="echo" />
> 	<parameter name="allowedMethods" value="ping" />
> 
> 	<parameter name="OutflowSecurity">
> 		<action>
> 			<items>Timestamp Signature Encrypt</items>
> 			<user>serverKeystore</user>
> 			<passwordCallbackClass>
> 				userguide.example1.PWCallback
> 			</passwordCallbackClass>
> 			<signaturePropFile>
> 				out-server-signature.properties
> 			</signaturePropFile>
> 			<signatureKeyIdentifier>
> 				SKIKeyIdentifier
> 			</signatureKeyIdentifier>
> 			<encryptionKeyIdentifier>
> 				SKIKeyIdentifier
> 			</encryptionKeyIdentifier>
> 			<encryptionUser>serverKeystore</encryptionUser>
> 		</action>
> 	</parameter>
> 
> 	<parameter name="InflowSecurity">
> 		<action>
> 			<items>Encrypt Signature Timestamp</items>
> 			<passwordCallbackClass>
> 				userguide.example1.PWCallback
> 			</passwordCallbackClass>
> 			<signaturePropFile>
> 				in-server-signature.properties
> 			</signaturePropFile>
> 		</action>
> 	</parameter>
> 
> 	<operation name="echo">
> 		<messageReceiver
> 	
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
> 		<actionMapping>urn:echo</actionMapping>
> 	</operation>
> 
> 	<operation name="ping">
> 		<messageReceiver
> 	
> class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
> 		<actionMapping>urn:ping</actionMapping>
> 	</operation>
> 
> </service>
> 
> ------------------------------------------------
> in-server-signature.properties
> 
> 
> # Server trust store for checking/validating signatures of incoming
messages
>
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.cry
> pto.Merlin
> org.apache.ws.security.crypto.merlin.keystore.type=jks
> org.apache.ws.security.crypto.merlin.keystore.password=server
> org.apache.ws.security.crypto.merlin.alias.password=server
> org.apache.ws.security.crypto.merlin.keystore.alias=serverTrustStore
> org.apache.ws.security.crypto.merlin.file=C:/Documents and
> Settings/ssawhney/serverTrustStore.keystore
> 
> 
> ------------------------------------------------
> Client code:
> 
> public class PingClient
> {
>     private static EndpointReference targetEPR = new
> EndpointReference("http://localhost:8090/axis2/services/MyService");
> 
>     public static void main(String[] args)
>     {
>         try
>         {
>             ServiceClient serviceClient = new ServiceClient();
>             Options options = new Options();
>             OMElement payload = ClientUtil.getEchoOMElement();
>             Properties props = new Properties();
>             //
>             //
>             props.put(UsernameToken.PASSWORD_TYPE,
> WSConstants.PASSWORD_TEXT);
>             props.put(WSHandlerConstants.USER, "importedServerCert");
>             props.put(WSHandlerConstants.PW_CALLBACK_CLASS,
> "userguide.example1.PWCallback");
>             props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.TIMESTAMP);
>             props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.SIGNATURE);
>             props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.ENCRYPT);
>             props.setProperty(WSHandlerConstants.SIG_PROP_FILE,
> "out-client-signature.properties");
>             props.setProperty(WSHandlerConstants.SIG_KEY_ID,
> "SKIKeyIdentifier");
>             //
>             //
>             serviceClient.setOptions(options);
>             options.setTo(targetEPR);
>             options.setAction("urn:echo");
>             //
>             //            
>             OMElement result = serviceClient.sendReceive(payload);
>             //
>             //
>             /**
>              * We have to bock this thread untill we send the request ,
the
>              * problem is if we go out of the main thread , then request
> wont
>              * send ,so you have to wait some time :)
>              */
>             Thread.sleep(500);
>             //
>             //
>             System.out.println(result.getQName());
>             System.out.println(result);
>             //
>             // Iterate over the child elements to print what server has
sent
>             Iterator iterChildElements = result.getChildElements();
>             while (iterChildElements.hasNext())
>             {
>                 OMElement aChild = (OMElement) iterChildElements.next();
>                 System.out.println(aChild.getText());
>             }
> 
>         } catch (AxisFault axisFault)
>         {
>             axisFault.printStackTrace();
>         } catch (InterruptedException e)
>         {
>             e.printStackTrace();
>         }
>     }
> 
> }
> 
> --------------------------------------
> out-client-signature.properties
> 
> 
> # Server key store for adding signatures to outgoing messages
>
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.cry
> pto.Merlin
> org.apache.ws.security.crypto.merlin.keystore.type=jks
> org.apache.ws.security.crypto.merlin.keystore.password=client
> org.apache.ws.security.crypto.merlin.alias.password=client
> org.apache.ws.security.crypto.merlin.keystore.alias=importedServerCert
> org.apache.ws.security.crypto.merlin.file=C:/Documents and
> Settings/ssawhney/client.keystore
> 
> -------------------------------------
> 
> 
> 
> Regards, 
> 
> 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 Axis2 client

Posted by Dimuthu <mu...@apache.org>.
Hi,

There are two ways to configure security - one method is to use simple
configurations and the other is to use Policy. Simple configurations are
being deprecated, so better to use Policy.

Policy samples are available in Rampart Distribution's sample/policy
directory. There are four samples.

Cheers,
Dimuthu

On Thu, 2007-07-12 at 12:03 +0530, Shivani Sawhney wrote:
> Hi All,
> 
> I am really new to Axis and am using Axis2 1.2.
> 
> I have to use WS-Security on Axis2. I have deployed the service on server
> and enabled the service's security but do not know the exact steps to
> configure the client side for security. Am I supposed to configure a client
> repository and configure axis2.xml for client too? If yes, then how exactly
> is the security to be configured there?
> 
> 
> Can someone please guide me on the same or refer a tutorial or link on
> configuring the client of Axis2 or a sample web service with security
> enabled and all the xml sect required.
> 
> Any help will be most appreciated.
> 
> ------------------------------------------------
> Code:
> Services.xml
> 
> <service name="MyService" provider="java:RPC" style="document"
> 	use="literal">
> 
> 	<description>
> 		This is a sample Web Service with two operations, echo and
> ping.
> 	</description> 
> 
> 	<parameter name="ServiceClass" locked="false">
> 		userguide.example1.MyService
> 	</parameter>
> 
> 
> 	<parameter name="scope" value="application" />
> 	<parameter name="allowedMethods" value="echo" />
> 	<parameter name="allowedMethods" value="ping" />
> 
> 	<parameter name="OutflowSecurity">
> 		<action>
> 			<items>Timestamp Signature Encrypt</items>
> 			<user>serverKeystore</user>
> 			<passwordCallbackClass>
> 				userguide.example1.PWCallback
> 			</passwordCallbackClass>
> 			<signaturePropFile>
> 				out-server-signature.properties
> 			</signaturePropFile>
> 			<signatureKeyIdentifier>
> 				SKIKeyIdentifier
> 			</signatureKeyIdentifier>
> 			<encryptionKeyIdentifier>
> 				SKIKeyIdentifier
> 			</encryptionKeyIdentifier>
> 			<encryptionUser>serverKeystore</encryptionUser>
> 		</action>
> 	</parameter>
> 
> 	<parameter name="InflowSecurity">
> 		<action>
> 			<items>Encrypt Signature Timestamp</items>
> 			<passwordCallbackClass>
> 				userguide.example1.PWCallback
> 			</passwordCallbackClass>
> 			<signaturePropFile>
> 				in-server-signature.properties
> 			</signaturePropFile>
> 		</action>
> 	</parameter>
> 
> 	<operation name="echo">
> 		<messageReceiver
> 	
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
> 		<actionMapping>urn:echo</actionMapping>
> 	</operation>
> 
> 	<operation name="ping">
> 		<messageReceiver
> 	
> class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
> 		<actionMapping>urn:ping</actionMapping>
> 	</operation>
> 
> </service>
> 
> ------------------------------------------------
> in-server-signature.properties
> 
> 
> # Server trust store for checking/validating signatures of incoming messages
> org.apache.ws.security.crypto.provider=org.apache.ws.security.components.cry
> pto.Merlin
> org.apache.ws.security.crypto.merlin.keystore.type=jks
> org.apache.ws.security.crypto.merlin.keystore.password=server
> org.apache.ws.security.crypto.merlin.alias.password=server
> org.apache.ws.security.crypto.merlin.keystore.alias=serverTrustStore
> org.apache.ws.security.crypto.merlin.file=C:/Documents and
> Settings/ssawhney/serverTrustStore.keystore
> 
> 
> ------------------------------------------------
> Client code:
> 
> public class PingClient
> {
>     private static EndpointReference targetEPR = new
> EndpointReference("http://localhost:8090/axis2/services/MyService");
> 
>     public static void main(String[] args)
>     {
>         try
>         {
>             ServiceClient serviceClient = new ServiceClient();
>             Options options = new Options();
>             OMElement payload = ClientUtil.getEchoOMElement();
>             Properties props = new Properties();
>             //
>             //
>             props.put(UsernameToken.PASSWORD_TYPE,
> WSConstants.PASSWORD_TEXT);
>             props.put(WSHandlerConstants.USER, "importedServerCert");
>             props.put(WSHandlerConstants.PW_CALLBACK_CLASS,
> "userguide.example1.PWCallback");
>             props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.TIMESTAMP);
>             props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.SIGNATURE);
>             props.setProperty(WSHandlerConstants.ACTION,
> WSHandlerConstants.ENCRYPT);
>             props.setProperty(WSHandlerConstants.SIG_PROP_FILE,
> "out-client-signature.properties");
>             props.setProperty(WSHandlerConstants.SIG_KEY_ID,
> "SKIKeyIdentifier");
>             //
>             //
>             serviceClient.setOptions(options);
>             options.setTo(targetEPR);
>             options.setAction("urn:echo");
>             //
>             //            
>             OMElement result = serviceClient.sendReceive(payload);
>             //
>             //
>             /**
>              * We have to bock this thread untill we send the request , the
>              * problem is if we go out of the main thread , then request
> wont
>              * send ,so you have to wait some time :)
>              */
>             Thread.sleep(500);
>             //
>             //
>             System.out.println(result.getQName());
>             System.out.println(result);
>             //
>             // Iterate over the child elements to print what server has sent
>             Iterator iterChildElements = result.getChildElements();
>             while (iterChildElements.hasNext())
>             {
>                 OMElement aChild = (OMElement) iterChildElements.next();
>                 System.out.println(aChild.getText());
>             }
> 
>         } catch (AxisFault axisFault)
>         {
>             axisFault.printStackTrace();
>         } catch (InterruptedException e)
>         {
>             e.printStackTrace();
>         }
>     }
> 
> }
> 
> --------------------------------------
> out-client-signature.properties
> 
> 
> # Server key store for adding signatures to outgoing messages
> org.apache.ws.security.crypto.provider=org.apache.ws.security.components.cry
> pto.Merlin
> org.apache.ws.security.crypto.merlin.keystore.type=jks
> org.apache.ws.security.crypto.merlin.keystore.password=client
> org.apache.ws.security.crypto.merlin.alias.password=client
> org.apache.ws.security.crypto.merlin.keystore.alias=importedServerCert
> org.apache.ws.security.crypto.merlin.file=C:/Documents and
> Settings/ssawhney/client.keystore
> 
> -------------------------------------
> 
> 
> 
> Regards, 
> 
> 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


Configuring Axis2 client

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

I am really new to Axis and am using Axis2 1.2.

I have to use WS-Security on Axis2. I have deployed the service on server
and enabled the service's security but do not know the exact steps to
configure the client side for security. Am I supposed to configure a client
repository and configure axis2.xml for client too? If yes, then how exactly
is the security to be configured there?


Can someone please guide me on the same or refer a tutorial or link on
configuring the client of Axis2 or a sample web service with security
enabled and all the xml sect required.

Any help will be most appreciated.

------------------------------------------------
Code:
Services.xml

<service name="MyService" provider="java:RPC" style="document"
	use="literal">

	<description>
		This is a sample Web Service with two operations, echo and
ping.
	</description> 

	<parameter name="ServiceClass" locked="false">
		userguide.example1.MyService
	</parameter>


	<parameter name="scope" value="application" />
	<parameter name="allowedMethods" value="echo" />
	<parameter name="allowedMethods" value="ping" />

	<parameter name="OutflowSecurity">
		<action>
			<items>Timestamp Signature Encrypt</items>
			<user>serverKeystore</user>
			<passwordCallbackClass>
				userguide.example1.PWCallback
			</passwordCallbackClass>
			<signaturePropFile>
				out-server-signature.properties
			</signaturePropFile>
			<signatureKeyIdentifier>
				SKIKeyIdentifier
			</signatureKeyIdentifier>
			<encryptionKeyIdentifier>
				SKIKeyIdentifier
			</encryptionKeyIdentifier>
			<encryptionUser>serverKeystore</encryptionUser>
		</action>
	</parameter>

	<parameter name="InflowSecurity">
		<action>
			<items>Encrypt Signature Timestamp</items>
			<passwordCallbackClass>
				userguide.example1.PWCallback
			</passwordCallbackClass>
			<signaturePropFile>
				in-server-signature.properties
			</signaturePropFile>
		</action>
	</parameter>

	<operation name="echo">
		<messageReceiver
	
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
		<actionMapping>urn:echo</actionMapping>
	</operation>

	<operation name="ping">
		<messageReceiver
	
class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver" />
		<actionMapping>urn:ping</actionMapping>
	</operation>

</service>

------------------------------------------------
in-server-signature.properties


# Server trust store for checking/validating signatures of incoming messages
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.cry
pto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=server
org.apache.ws.security.crypto.merlin.alias.password=server
org.apache.ws.security.crypto.merlin.keystore.alias=serverTrustStore
org.apache.ws.security.crypto.merlin.file=C:/Documents and
Settings/ssawhney/serverTrustStore.keystore


------------------------------------------------
Client code:

public class PingClient
{
    private static EndpointReference targetEPR = new
EndpointReference("http://localhost:8090/axis2/services/MyService");

    public static void main(String[] args)
    {
        try
        {
            ServiceClient serviceClient = new ServiceClient();
            Options options = new Options();
            OMElement payload = ClientUtil.getEchoOMElement();
            Properties props = new Properties();
            //
            //
            props.put(UsernameToken.PASSWORD_TYPE,
WSConstants.PASSWORD_TEXT);
            props.put(WSHandlerConstants.USER, "importedServerCert");
            props.put(WSHandlerConstants.PW_CALLBACK_CLASS,
"userguide.example1.PWCallback");
            props.setProperty(WSHandlerConstants.ACTION,
WSHandlerConstants.TIMESTAMP);
            props.setProperty(WSHandlerConstants.ACTION,
WSHandlerConstants.SIGNATURE);
            props.setProperty(WSHandlerConstants.ACTION,
WSHandlerConstants.ENCRYPT);
            props.setProperty(WSHandlerConstants.SIG_PROP_FILE,
"out-client-signature.properties");
            props.setProperty(WSHandlerConstants.SIG_KEY_ID,
"SKIKeyIdentifier");
            //
            //
            serviceClient.setOptions(options);
            options.setTo(targetEPR);
            options.setAction("urn:echo");
            //
            //            
            OMElement result = serviceClient.sendReceive(payload);
            //
            //
            /**
             * We have to bock this thread untill we send the request , the
             * problem is if we go out of the main thread , then request
wont
             * send ,so you have to wait some time :)
             */
            Thread.sleep(500);
            //
            //
            System.out.println(result.getQName());
            System.out.println(result);
            //
            // Iterate over the child elements to print what server has sent
            Iterator iterChildElements = result.getChildElements();
            while (iterChildElements.hasNext())
            {
                OMElement aChild = (OMElement) iterChildElements.next();
                System.out.println(aChild.getText());
            }

        } catch (AxisFault axisFault)
        {
            axisFault.printStackTrace();
        } catch (InterruptedException e)
        {
            e.printStackTrace();
        }
    }

}

--------------------------------------
out-client-signature.properties


# Server key store for adding signatures to outgoing messages
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.cry
pto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=client
org.apache.ws.security.crypto.merlin.alias.password=client
org.apache.ws.security.crypto.merlin.keystore.alias=importedServerCert
org.apache.ws.security.crypto.merlin.file=C:/Documents and
Settings/ssawhney/client.keystore

-------------------------------------



Regards, 

Shivani Sawhney 


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