I didn't see anything obviously wrong with the ear structure you described
so I've added an example of calling a secured EJB through a secured
rpcrouter using the Apache 2.2 soap version to the jbosstest module. I
see the authenticated web principal passed to the secured EJB. Here
is sample output:

[Default] User 'jduke' authenticated.
[Default] =============================================
[Default] In TemplateProvider.locate()
[Default] URI: urn:jbosstest/ejbs/SecuredEJB
[Default] DD.ServiceClass: org.apache.soap.providers.StatelessEJBProvider
[Default] DD.ProviderClass: null
[Default] Call.MethodName: echo
[Default] User 'jduke' authenticated.
[Default] =============================================
[Default] In TemplateProvider.invoke()
[Default] StatelessSessionBean.ejbCreate() called
[Default] StatelessSessionBean.echo, arg=Hello
[Default] StatelessSessionBean.echo, callerPrincipal=jduke

based on this client:

import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
import org.apache.soap.transport.SOAPTransport;
import org.apache.soap.transport.http.SOAPHTTPConnection;

public class soapejb
{
  public static void main (String[] args) throws Exception
  {
    URL url = new URL("http://localhost:8080/jbosstest/restricted/soap/rpcrouter";);

    // Build the call.
    SOAPHTTPConnection http = new SOAPHTTPConnection();
    http.setUserName("jduke");
    http.setPassword("theduke");
    Call call = new Call ();
    call.setSOAPTransport(http);
    call.setTargetObjectURI ("urn:jbosstest/ejbs/SecuredEJB");
    call.setMethodName("echo");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector();
    params.addElement (new Parameter("arg", String.class, "Hello", null));
    call.setParams (params);

    Response resp = call.invoke (/* router URL */ url, /* actionURI */ "" );

    // Check the response.
    if( resp.generatedFault() )
    {
      Fault fault = resp.getFault();
      System.out.println("Ouch, the call failed: ");
      System.out.println("  Fault Code   = " + fault.getFaultCode ());  
      System.out.println("  Fault String = " + fault.getFaultString ());
    }
    else
    {
      Parameter result = resp.getReturnValue();
      System.out.println("Result = "+result);
    }
  }
}

Get the jbosstest module code from sourceforge and see how the jbosstest-web.ear
differs from what you have. If you can't find the issue submit a bug report to
sourceforge that includes a sample ear demonstrating the problem.


----- Original Message ----- 
From: "Nick Taylor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 25, 2001 4:32 AM
Subject: RE: [JBoss-user] JAAS problem


> Scott,
> i've packaged my app into an ear as follows but still get the
> "Authentication exception, principal=null" exception when my web component
> tries to invoke a bean method. The web component is seeing the
> users.properties and roles.properties files as it authenticates me according
> to those files with no problems.
> 



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to