After doing a better job of reading the CXF documentation, I found out
what I was doing wrong, the Service Name is set using the serviceName
attribute of the @Webservice annotation. The name attribute which I was
trying to use is for the wsdl:portType.

 

name - Specifies the name of the service interface. This property is
mapped to the name attribute of the wsdl:portType element that defines
the service's interface in a WSDL contract. The default is to
appendPortType to the name of the implementation class.

 

serviceName - Specifies the name of the published service. This property
is mapped to the name attribute of the wsdl:service element that defines
the published service. The default is to use the name of the service's
implementation class. Note: Not allowed on the SEI

 

Regards,

Rick Cromer

________________________________

From: keith chapman [mailto:[email protected]] 
Sent: Wednesday, February 18, 2009 12:20 AM
To: [email protected]
Subject: Re: ServiceName question

 

Can you try dropping the @WebService annotation. You can certainly
control the name of the service using the name Attribute on the
services.xml.

Thanks,
Keith.

On Wed, Feb 18, 2009 at 1:44 AM, Cromer, Rick <[email protected]>
wrote:

I'm having problems controlling my ServiceName.  This is important since
I'm trying to migrate Axis1 to Axis2 and need to preserve the service
name to minimize the impact on the SOAP clients.  I set the WebService
name attribute in the service class to "Address", the class name of the
service is "AddressService" and the service name attribute in the
services.xml file to "Address".  What Axis appears to be doing it
setting the Service name to ClassName + "Service".  Why can't I control
the service name from the class @WebService attribute name value?

 

package book.sample;

 

import javax.jws.WebService;

 

@WebService (name = "Address")

public class AddressService {

 

    public Address getAddress(String name) {

 

        Address address = new Address();

        address.setStreet("Street");

        address.setNumber("Number 15");

        return address;

    }

}


Content of the services.xml file


    <service name="Address">

        <parameter name="ServiceClass"
locked="false">book.sample.AddressService</parameter>

    </service>


 


AddressServiceService
<http://localhost:8080/axis2/services/AddressServiceService?wsdl> 


Service EPR : http://localhost:8080/axis2/services/AddressServiceService


Service Description : Address


Service Status : Active
Available Operations

*       getAddress

Rick

 




-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Reply via email to