Title: [WSS4J 1.5] WS-Security Help Client-Server Configuration

Hi All,

I've a problem with the client of a WS Security application

I've created a web service that receive a string and return other string, I've changed deploy.wsdd of my server in order to receive binary security token the file deploy.wsdd is this:

<!-- Use this file to deploy some handlers/chains and services      -->
<!-- Two ways to do this:                                           -->
<!--   java org.apache.axis.client.AdminClient deploy.wsdd          -->
<!--      after the axis server is running                          -->
<!-- or                                                             -->
<!--   java org.apache.axis.utils.Admin client|server deploy.wsdd   -->
<!--      from the same directory that the Axis engine runs         -->

<deployment
    xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <!-- Services from PerformWSService WSDL service -->

  <service name="PerformWService" provider="java:RPC" style="rpc" use="encoded">
      <parameter name="wsdlTargetNamespace" value="urn:PerformWService"/>
      <parameter name="wsdlServiceElement" value="PerformWSService"/>
      <parameter name="wsdlServicePort" value="PerformWService"/>
      <parameter name="className" value="PerformWS.PerformWServiceSoapBindingSkeleton"/>
      <parameter name="wsdlPortType" value="PerformWS"/>
      <parameter name="typeMappingVersion" value="1.2"/>
      <parameter name="allowedMethods" value="*"/>
      <parameter name="scope" value="Session"/>
<responseFlow>
   <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver" >
     <parameter name="user" value="hermann"/>
     <parameter name="passwordCallbackClass" value="1234567890"/>
     <parameter name="action" value="Signature"/>
     <parameter name="signaturePropFile"
value="cryptoReceiver.properties" />
   </handler>
</responseFlow>
  </service>
</deployment>


The file cryptoReceiver is this:
org.apache.ws.security.crypto.merlin.file=cacerts.jks
org.apache.ws.security.crypto.merlin.keystore.type=JKS
org.apache.ws.security.crypto.merlin.keystore.password=1234567890


So that it receive a binary security token, I add cryptoReceiver.properties and my keystore file in the package of my service tomcat/webapps/axis/WEB-INF/classes/PerformWS

Now the problem is the client that is integrated in a jsp application

I've in PerformWeb\WEB-INF\classes\stub of my tomcat application a class that call my service, in the package "stub" where I located my class and the class for locate the service, the file client-config.wsdd and the keystore pkcs12.

client-config.wssd:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  <transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
   <globalConfiguration>
<requestFlow>
   <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
     <parameter name="user" value="hermann"/>
     <parameter name="passwordCallbackClass" value="1234567890"/>
     <parameter name="action" value="Signature"/>
     <parameter name="signatureKeyIdentifier" value="DirectReference" />
     <parameter name="signaturePropFile" value="cryptoSender.properties" />
   </handler>
</requestFlow>
</globalConfiguration >
</deployment>

cryptoSender.properties:
org.apache.ws.security.crypto.merlin.file=x509pri.p12
org.apache.ws.security.crypto.merlin.keystore.type=PKCS12
org.apache.ws.security.crypto.merlin.keystore.password=1234567890

the class is this:

package stub;
import java.util.*;
import org.apache.axis.EngineConfiguration;
import org.apache.axis.configuration.FileProvider;

public class Chiamata
{

        String host="143.225.250.102";
        String usr="viola";
        String pass="giallo";
        String com;
        String ritorno;

        public Chiamata(String h,String u,String p,String c)
        {
                host=h;
                usr=u;
                pass=p;
                com=c;
        }
        public String getString()
        {
                 try{
                       
                        ritorno="Nel try ";
                        EngineConfiguration config = new FileProvider("client-config.wsdd");
                        PerformWSServiceLocator l=new PerformWSServiceLocator(config);
                         ritorno=ritorno+"creato il locator ";
                         PerformWServiceSoapBindingStub stub =(PerformWServiceSoapBindingStub) l.getPerformWService();
                         ritorno=ritorno+"creato lo stub ";
                         ritorno=stub.outputStr(host,usr,pass,com);
                        
                 }catch (Exception e)
                 { ritorno=ritorno+"Si solleva una RemoteException";}
                 return ritorno;
         }


How I Can read the file client-config.wsdd? if I use this method in the class It's return null

Perhaps I've to specify some other things or I have some error in the component of my applicaion?

Please help me to resolve this big problem.

Thank You.

Reply via email to