On Wednesday 16 March 2011 2:20:15 PM slocum wrote:
> So I still get the same error with this. Here is the new JSP code:
>
> CMPSWebService service = new CMPSWebService();
> URL wsdlURL =
> service.getClass().getResource("/WEB-INF/classes/cmps-1.0.wsdl");
Can you double check that wsdlURL is not null here? If getResource doesn't
find it, it would be null and that would be the equivilent of:
new CMPSWebService(null, serviceName);
and thus thus wsdl wouldn't be used.
THAT said, if there is nothing in the wsdl that is really needed (like
policies and such), you can do something like:
service = new CMPSWebService();
QName portName = new QName("http://ws.cmps.digitalriver.com",
"CMPSWebServiceHttpPort");
service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
"http://localhost:8080/path/to/service");
Dan
> QName serviceName = new QName("http://ws.cmps.digitalriver.com",
> "CMPSWebService");
> service = new CMPSWebService(wsdlURL, serviceName);
> CMPSWebServicePortType port = service.getCMPSWebServiceHttpPort();
>
>
> For reference, here is the top of the web service implementation code:
>
> @WebService(name = "CMPSServiceImpl",
> serviceName = "CMPSWebService",
> portName = "CMPSWebServiceHttpPort",
> wsdlLocation="classpath:cmps-1.0.wsdl",
> endpointInterface =
"com.digitalriver.cmps.ws.CMPSWebServicePortType",
> targetNamespace = "http://ws.cmps.digitalriver.com")
> public class CMPSServiceImpl implements CMPSWebServicePortType {
>
> public CMPSServiceImpl() {
> this(Application.getInstance().getSessionFactory());
> }
>
> public CMPSServiceImpl(SessionFactory factory) {
> sessionFactory = factory;
> try {
> Application.getInstance().loadProperties();
> logger.debug("Loaded application props!!!!!!!");
> }
> catch(Exception e) {
> e.printStackTrace();
> }
> }
> ...
> }
>
> Daniel Kulp wrote:
> > It would depend on where you stick the WSDL. A common place is in WEB-
> > INF/wsdl in which case it would be something like:
> >
> > URL wsdlURL =
> > service.getClass().getResource("/WEB-INF/wsdl/myWsdl.wsdl"); QName
> > serviceName = new QName(http://ws.cmps.digitalriver.com"",
> > "CMPSWebService");
> > service = new CMPSWebService(wsdlURL, serviceName);
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Calling-cxf-web-service-from-JSP-page-tp37
> 86341p3791853.html Sent from the cxf-user mailing list archive at
> Nabble.com.
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com