tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laird Nelson <ljnel...@gmail.com>
Subject Re: Web services deployment example?
Date Thu, 09 Apr 2009 14:06:54 GMT
I've boiled it down further (I know, everyone is thrilled!  :-)).

This works:
// Interface
@Remote // I decided to make this Remote; no particular reason
public interface SayHello {
  public String sayHello();
}

// Implementation
@Stateless(name="SayHello")
@WebService
public class SayHelloImpl implements SayHello {
  @WebMethod
  public String sayHello() {
    return "Hello!";
  }
}

// Test case
    final Properties properties = new Properties();
    properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
    properties.put("openejb.embedded.remotable", "true");
    this.context = new InitialContext(properties);
    assertNotNull(this.context);
    final Object o = this.context.lookup("SayHelloRemote");
    assertTrue(o instanceof SayHello);
    final SayHello sh = (SayHello)PortableRemoteObject.narrow(o,
SayHello.class);
    assertNotNull(sh);
    assertEquals("Hello!", sh.sayHello());

Now if I add the @WebService annotation to my SayHello interface like this:
@WebService(targetNamespace="http://foobar.net/wsdl")
...and do nothing else, the test case fails because suddenly
"SayHelloRemote" cannot be found.

Mind you, I'm only testing the SLSB functionality in here.

Why would adding the @WebService annotation to the interface be a problem?
If I'm out of OpenEJB land and into specification oddity land, do tell, but
I didn't see anything in the WS spec that would lead me to believe this is
illegal or should result in InitialContexts being empty.

Thanks,
Laird

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message