I used the second method and it got farther. Looks like the service URL in
the addPort() isn't working right.
JSP Code:
CMPSWebService service = new CMPSWebService();
QName portName = new QName("http://ws.cmps.digitalriver.com",
"CMPSWebServiceHttpPort");
service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
"http://localhost:8080/cmps-1.0/services/CMPSWebService");
CMPSWebServicePortType port = service.getCMPSWebServiceHttpPort();
LookupProductRequestType prdReq = new LookupProductRequestType();
Error output:
org.apache.jasper.JasperException: An exception occurred processing JSP page
/new_product.jsp at line 138
135: prdReq.setDivisionID(division);
136: prdReq.setDivisionProductID(divProductID);
137: prdReq.setLanguage(lang);
138: LookupProductResponseType resp = port.lookupProduct(prdReq);
139:
140: if (resp.getResponseMessage() != null &&
!resp.getResponseMessage().isEmpty() &&
resp.getResponseMessage().equalsIgnoreCase("SUCCESS")) {
141: product = resp.getProductInformation();
...
root cause
javax.xml.ws.WebServiceException: Could not send Message.
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
$Proxy69.lookupProduct(Unknown Source)
org.apache.jsp.new_005fproduct_jsp._jspService(new_005fproduct_jsp.java:258)
...
root cause
java.net.ConnectException: ConnectException invoking
http://localhost:8080/cmps-1.0/services/CMPSWebService: Connection refused
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:2058)
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2043)
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:487)
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
$Proxy69.lookupProduct(Unknown Source)
org.apache.jsp.new_005fproduct_jsp._jspService(new_005fproduct_jsp.java:258)
--
View this message in context:
http://cxf.547215.n5.nabble.com/Calling-cxf-web-service-from-JSP-page-tp3786341p3796000.html
Sent from the cxf-user mailing list archive at Nabble.com.