For: > PortType port = service.getPort(portQName, PortType.class);
you need to specify your service endpoint interface here instead of javax.wsdl.PortType. You could take a look at one of the following CXF examples to see how it's done: https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/java_first_jaxws https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/wsdl_first Colm. On Fri, Mar 16, 2018 at 11:23 PM, George S. <[email protected]> wrote: > I'm trying to run a web service and I'm hitting an error: > > com.sun.xml.ws.model.RuntimeModelerException: A WebService annotation is > not present on class: javax.wsdl.PortType > at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(Runtim > eModeler.java:269) > at com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl. > java:100) > at com.sun.xml.ws.db.DatabindingProviderImpl.create(Databinding > ProviderImpl.java:74) > at com.sun.xml.ws.db.DatabindingProviderImpl.create(Databinding > ProviderImpl.java:58) > at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(Datab > indingFactoryImpl.java:120) > at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WS > ServiceDelegate.java:882) > at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WS > ServiceDelegate.java:899) > at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDele > gate.java:862) > at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDel > egate.java:451) > at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDel > egate.java:420) > at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDel > egate.java:402) > at javax.xml.ws.Service.getPort(Service.java:119) > at oasis.names.tc.xx.wsdl.webservicemessagingprofile_definition > s_4.SvcStagePortBindingImpl.yy(SvcStagePortBindingImpl.java:112) > > The code is: > > LOGGER.debug("--== Building Message ==--"); > LOGGER.debug("--== wsdl URL ==--"); > URL wsdlLocation = new URL(WS_URL); > LOGGER.debug("--== Service QName ==--"); > QName serviceQName = new QName(namespace, serviceName); > LOGGER.debug("--== Port QName ==--"); > QName portQName = new QName(namespace, portName); > LOGGER.debug("--== Creating Service ==--"); > Service service = Service.create(wsdlLocation, serviceQName); > > PortType port = service.getPort(portQName, PortType.class); > > If someone could give me an idea of where to go with this, I would be > really appreciative. > > -- > George S. > *MH Software, Inc.* > Voice: 303 438 9585 > http://www.mhsoftware.com > -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com
