Does anyone know of any examples online of binding a web service as a DataSource to a ListGrid with SmartGWT? There are a few examples of binding a web service as a DataSource to a DynamicForm, but we're looking to bind it to a ListGrid, and having trouble.
Announcement
Collapse
No announcement yet.
X
-
Yes, same code, but with the lack of a proxy you will need to make the WSDL file and the service itself available on the same machine that serves the primary web page.
Make sure all URLs you use are relative, that is, no "http://" even if the hostname is localhost. Also, using a different port is also considered a different host by some browsers, so avoid that.
Or just use Pro/EE.
Comment
-
Originally posted by IsomorphicYes, same code, but with the lack of a proxy you will need to make the WSDL file and the service itself available on the same machine that serves the primary web page.
Make sure all URLs you use are relative, that is, no "http://" even if the hostname is localhost. Also, using a different port is also considered a different host by some browsers, so avoid that.
Or just use Pro/EE.
Regarding the example in the SmartGWT EE Showcase, is the .wsdl file available anywhere?
Comment
-
No, it means in calls to loadWSDL() and in the WSDL file itself (for the service location), or, manually call setLocation() on the WebService instance to correct the URL if you can't make it relative in the WSDL.
You can see the URL of the WSDL file in that sample and/or use the Net panel in Firebug to capture it.
Comment
-
I tried this example and it works fine (PRO Version)
However my Web Service is on Port 8082 and when I try to use it I get the Error
Transport error - HTTP code: 500 for URL: http://srvr:8082/MyService/ServicePort?wsdl (via proxy: http://localhost:8888/testproject/sc/HttpProxy)
Thanks for any help
Pius
Comment
-
1. Download this HttpProxy Implementation:
http://edwardstx.net/wiki/attach/HttpProxyServlet/ProxyServlet.java
2. Configure it in web.xml
Code:<servlet> <servlet-name>HttpProxy</servlet-name> <servlet-class>com.logalyze.admin.web.server.ProxyServlet</servlet-class> <init-param> <param-name>proxyHost</param-name> <param-value>127.0.0.1</param-value> </init-param> <init-param> <param-name>proxyPort</param-name> <param-value>8088</param-value> </init-param> <init-param> <param-name>prefixPath</param-name> <param-value>/httpproxy</param-value> </init-param> <init-param> <param-name>proxyPath</param-name> <param-value></param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HttpProxy</servlet-name> <url-pattern>/httpproxy/*</url-pattern> </servlet-mapping>
Code:// Replace absolute URLs String targetURI = "http://"+stringProxyHost+":"+intProxyPort; String sourceURI = httpServletRequest.getContextPath()+stringPrefixPath; response = response.replaceAll(targetURI, sourceURI);
Code:wsdlURL = GWT.getHostPageBaseURL()+"httpproxy/anything?wsdl"; .... private void loadWSDL(){ RPCRequest rpc = new RPCRequest(); rpc.setTimeout(10000); rpc.setShowPrompt(false); rpc.setWillHandleError(true); XMLTools.loadWSDL(wsdlURL, new WSDLLoadCallback(){ public void execute(WebService webService) { System.out.println("WSDL loaded: "+ wsdlURL); SearchService = webService; } }, rpc, true); } ...
Comment
Comment