开发者

WSDL first Web Service with Maven, CXF under JBoss

I'm sorry if this questions seems trivial but I've been Google-ing for a few days with no success.

I'm new to WebServices and I've been assigned to develop the server part for a web service in Java. I was given a WSDL and with maven and cxf I built a project with two modules. A core module where I've written business code and intend to do the web service server part and a wsdl module where the classes are generated from the WSDL.

Now, after writing the business code and testing it I have to deploy the web service server under JBoss for further testing with soapUI. I've never done this and trying to google a tutorial has made me really confused as I can't seem to find out a good example/tutorial - most being made using different technologies.

I think I have to configure a web.xml and a cxf.xml and create an endpoint pointing to my service implementation - a class that implements the service interface created from the WSDL; but I have no idea how to do this.

I also notice that the WSDL created a Service_service class that extends Service. The class looks like this. (some things edited out for confidentiality sake)

import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.Service;


@WebServiceClient(name = "Service", 
              wsdlLocation = "file:/C:/dev/ws/ems/APP/wsdl/src/main/resources/wsdl/Service.wsdl",
              targetNamespace = "http://smth.com/smth/smth/smth") 
public class Service_Service extends Service {

public final static URL WSDL_LOCATION;

public final static QName SERVICE = new QName("http://smth.com/smth/smth/smth", "Service");
public final static QName ServicePort = new QName("http://smth.com/smth/smth/smth", "ServicePort");
static {
    URL url = null;
    try {
        url = new URL("file:/C:/dev/ws/ems/Service/wsdl/src/main/resources/wsdl/Service.wsdl");
    } catch (MalformedURLException e) {
        System.err.println("Can not initialize the default wsdl from file:/C:/dev/ws/ems/Service/wsdl/src/main/resources/wsdl/Service.wsdl");
        // e.printStackTrace();
    }
    WSDL_LOCATION = url;
}

public Service_Service(URL wsdlLocation) {
    super(wsdlLocation, SERVICE);
}

public Service_Service(URL wsdlLocation, QName serviceName) {
    super(wsdlLocation, serviceName);
}

public Service_Service() {
    super(WSDL_LOCATION, SERVICE);
}


/**
 * 
 * @return
 *     returns Service
 */
@WebEndpoint(name = "ServicePort")
public Service getServicePort() {
    return super.getPort(ServicePort, Service.class);
}

/**
 * 
 * @param features
 *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
 * @return
 *     returns Service
 */
@WebEndpoint(name = "ServicePort")
public Service getServicePort(WebServiceFeature... features) {
    return super.getPort(ServicePort, Service.class, features);
}}

What should I use this for? What does it do ?

Can anyone help me with a tutorial or a similar example? At the moment I don't really know how to proceed...

Thank you,

Later EDIT: I just noticed that Service_service is used for the client so I guess I won't need it 开发者_高级运维as I'm not developing a client.

The WSDL generated Service contains

@WebService(targetNamespace = "http://smth.com/smth/smth/smth", name = "Service")

I'm guessing I need to use this in my web.xml.

I could use any input on this... Thanks again,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜