[jboss-user] [JBoss Web Services] New message: "WebService annotation is not present"

aodhan hoffman do-not-reply at jboss.com
Thu Mar 18 15:38:36 EDT 2010


User development,

A new message was posted in the thread "WebService annotation is not present":

http://community.jboss.org/message/532914#532914

Author  : aodhan hoffman
Profile : http://community.jboss.org/people/gryffin

Message:
--------------------------------------------------------------
I am getting an error, "com.sun.xml.internal.ws.model.RuntimeModelerException: A WebService annotation is not present on class: ags.AssetGetService", which I can't fathom.
 
Here's the client:


package ags

import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;

public class AGSClient  {

    public static void main(String[] args) throws MalformedURLException   {
        URL url = new URL("http://127.0.0.1:8080/AssetGet?wsdl");
        QName qname = new QName("http://www.boeing.com/AGS/api", "AssetGetService");
        Service service = Service.create(url, qname);
        // ws client
        AssetGetService eif = service.getPort(AssetGetService.class);
        // interface
        AssetGetType port = eif.getAssetGetServicePort();
        AssetSelector as = new AssetSelector();
        as.setAssetId("foo");
        as.setOwnerAppId("bar");
        System.out.println(port.assetAssociationGet(as).success);    }    }
 
The interface:

package ags;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

@WebService(name = "AssetGetType", targetNamespace = "http://www.boeing.com/AGS/api")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface AssetGetType {

    @WebMethod(action = "urn:http://www.boeing.com/NLS/soap#AssetAssociationGet")
    @WebResult(name = "Results", partName = "Results")
    public AssetAssociationGetResults assetAssociationGet(
        @WebParam(name = "Selector", partName = "Selector")
        AssetSelector selector);    }
 
And the service class.
package ags;
 
import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;

@WebServiceClient(name = "AssetGetService", targetNamespace = "http://www.boeing.com/AGS/api", wsdlLocation = "http://127.0.0.1:8080/AssetGet?wsdl")
public class AssetGetService
    extends Service
{
 
    private final static URL ASSETGETSERVICE_WSDL_LOCATION;
    private final static Logger logger = Logger.getLogger(ags.AssetGetService.class.getName());
 
    static {
        URL url = null;
        try {
            URL baseUrl;
            baseUrl = ags.AssetGetService.class.getResource(".");
            url = new URL(baseUrl, "http://127.0.0.1:8080/AssetGet?wsdl");
        } catch (MalformedURLException e) {
            logger.warning("Failed to create URL for the wsdl Location: 'http://127.0.0.1:8080/AssetGet?wsdl', retrying as a local file");
            logger.warning(e.getMessage());
        }
        ASSETGETSERVICE_WSDL_LOCATION = url;
    }
 
    public AssetGetService(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName)   }
 
    public AssetGetService() {
        super(ASSETGETSERVICE_WSDL_LOCATION, new QName("http://www.boeing.com/AGS/api", "AssetGetService"));   }
 
    @WebEndpoint(name = "AssetGetServicePort")
    public AssetGetType getAssetGetServicePort() {
        return super.getPort(new QName("http://www.boeing.com/AGS/api", "AssetGetServicePort"), AssetGetType.class);    } }

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/532914#532914




More information about the jboss-user mailing list