Tuesday, January 29, 2008

Issues with SOAP address location in EJB 3.0

I am deploying my EJB 3.0 application on 3 servers for right now; JBoss, GlassFish and Oracle Application Server.
I have a simple Stateless Session Bean with the appropriate WebService annotations.
When I deploy my application to these 3 servers, each one has a different WSDL URL.

The name and serviceName are as specified in the @WebService annotation.

@WebService(name="HelloManager", serviceName = "HelloManagerService", targetNamespace = "urn:HelloManagerService")

There is however some consistency between JBoss and Oracle. They use the following notation:

soap:address location="http://hostname:portname/earfilename/name"

For e.g:
soap:address location="http://localhost:8080/ejb3webservices/HelloManager"


GlassFish on the other hand, uses the following notation:

soap:address location="http://hostname:portname/servicename/name"

For e.g:
soap:address location="http://localhost:8484/HelloManagerService/HelloManager"


I am trying to use SOAP UI to test my web services once they are deployed using Ant.

I didn't see any reference in the EJB 3.0 spec regarding the WSDL location. Is this vendor specific? Is there any place where we can customize the WSDL?

Also, I don't see any configurable attribute in the documentation for the @WebService annotation.

10 comments:

  1. Is there a way to change the hostname to use the actual IP instead of "localhost"?

    ReplyDelete
  2. There is WebContext annotation for JBossWS.

    ReplyDelete
  3. I am not willing to add any annotations specific to an application server. I need my app to be portable across all these servers.

    ReplyDelete
  4. I have similar problem. Did you solve this?

    ReplyDelete
  5. Sorry, haven't found any solution as yet.

    ReplyDelete
  6. This is how you can change the webservice address location:


    BindingProvider portBP = (BindingProvider) mpPort;
    portBP.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://...");


    Love,

    Klaus

    ReplyDelete
  7. Any luck finding a solution for this yet?
    The BindingProvider option stated above is for the client afaik?

    Sebas

    ReplyDelete
  8. It should be fixed in the latest version of the EJB spec.

    ReplyDelete
  9. Hi, I have similar problem. Any solution?

    Thanks

    ReplyDelete