Lukman
Lukman

Reputation: 19164

EJB web service endpoint URLs changed when upgraded from Glassfish 3.0 to Glassfish 3.1.2

The development team I'm currently working with is planning to upgrade the Glassfish server application running on the server from version 3.0 (Sun Glassfish) to version 3.1.2 (Oracle Glassfish), and encountered an issue where the EJB web service endpoint URLs changed from:

http://serverip:port/PROJECT_NAME/primeRequestTTService

To:

http://serverip:port/primeRequestTTService/primeRequestTT

Upon days of Googling, I found out that the latter URL is currently the standard construction of EJB endpoint while since I found nothing on the former, I assume it was Sun Glassfish non-standard method of constructing the endpoint URLs.

The code excerpt as below:

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebService;

@WebService(serviceName = "primeRequestTTService", portName = "primeRequestTTSoap", wsdlLocation = "WEB-INF/wsdl/primeRequestTT/primeListTT.wsdl")
@Stateless
public class primeRequestTT {
    @EJB

I tried to set PROJECT_NAME as the serviceName attribute but end up with http://serverip:port/PROJECT_NAME/primeRequestTT instead.

The question: Other than modifying all the EJB web service class names to have "Service" prefixes, how do I modify this web service application project to maintain the previous endpoint construction while I upgrade the Glassfish to version 3.1.2? I'm looking for "configuration file" type of solution. I already tried glassfish-web.xml and it does not work.

Upvotes: 0

Views: 372

Answers (1)

Pejal Hebat
Pejal Hebat

Reputation: 116

Lukman,

You have to include 'name' parameter into your @WebService annotation:

@WebService(serviceName = "primeRequestTTService", portName = "primeRequestTTSoap", name= "primeRequestTT")

So, your will end up as follows:

http://localhost:8080/primeRequestTTService/primeRequestTT

Upvotes: 1

Related Questions