Java Doc for SimpleWebServiceProviderAdapter.java in  » Portal » Open-Portal » com » sun » portal » providers » simplewebservice » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.providers.simplewebservice 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.sun.portal.providers.jsp.JSPProvider
   com.sun.portal.providers.simplewebservice.SimpleWebServiceProviderAdapter

All known Subclasses:   com.sun.portal.providers.simplewebservice.rpc.SimpleWebServiceProvider,
SimpleWebServiceProviderAdapter
abstract public class SimpleWebServiceProviderAdapter extends JSPProvider (Code)
The Simple Web Service Provider is a specialized content Provider that facilitates the mechanism to dynamically construct the front end UI for interaction with relatively simple SOAP based web services targeted by an end user.

Minimally, given the WSDL URL and the name of the Method to be invoked on the web service, the Simple Web Service Provider fetches and parses the WSDL file, and then based on the content of the WSDL, dynamically generates the input UI that will allow the user to supply values for the input parameters required by the web service. Upon submission of the input form, the Provider invokes the designated method on the web service and subsequently renders the UI displaying the results received back from the web service.

Channels based on the Simple Web Service Provider are of the following two types -

  • Pre configured Simple Web Service Provider channel - The pre configured channel type is bound to a specific web service (e.g. a Stock Quote web service) and associated method by the Administrator, and is available for addition to the desktop by the end user. The values of the web service WSDL URL and method name configuration parameters is meant to be pre configured by the Administrator. The pre configured channel type provides the facility for the user to store default values for the web service input parameters via the "edit" menu selection on the channel UI.
  • Configurable Simple Web Service Provider channel - The configurable channel type allows the end user to switch the channel to point to other web services (and their associated methods). This is achieved by allowing the end user the capability to modify values for the WSDL URL and the web service method name from the "edit" menu option on the channel UI. However, unlike the pre configured channel type, the configurable type does not allow the user to store any default values for the web service input parameters.

Both the pre configured and configurable Simple Web Service Provider channel types include a configuration property that will specify the "default view" that is to be display when the desktop is initially rendered or refreshed. The "default view" can either be set to the web service input form or the view showing the web service output UI.

The SimpleWebServiceProviderAdapter class is an abstract sub-class of the JSPProvider that facilitates the basic framework required to invoke a given method on a remote SOAP based web service.

The SimpleWebServiceProviderAdapter class has one abstract method "invokeMethod". Given the relevant information required to invoke a method on the Web Service, a sub-class should implement this method using an appropriate SOAP implementation.

By default, the Simple Web Service Provider makes use of the JAXRPC runtime to make calls to remote web services.

The SimpleWebServiceProviderAdapter provides built-in capabilities for generic tasks such as -

  • Managing Web Services related display profile properties such as the WSDL URL, method name, etc.
  • Defining the input/output variables needed to invoke the designated web service method.
  • Storing and retrieving the default input values in the profile database.
  • Storing and retrieving the state for the provider.

Some of the classes used by the SimpleWebServiceProviderAdapter are:
SimpleWebServiceParameter - to encapsulate an input or output parameter for a web service method defined in a WSDL.
SimpleWebServiceState class to store the state of the Provider instance.
SimpleWebServiceException and its subclasses to throw fine grained exceptions.

The SimpleWebServiceProviderAdapter uses an instance variable of type SimpleWebServiceState to store the state of the provider instance. The logic in processRequest(request) method decides whether to use the information from the request object, or the last state, or default parameters obtained from the profile storage to provide results to the content jsp (default is webserviceContent.jsp).

For editing, an overridden processEdit method, checks for the request parameter "editContent". If the value is EDIT_DEFAULT_WSDL_URL, the method tries to save the new wsdl/methodname from the request object. If the value is EDIT_DEFAULT_INPUT, it tries to save the default input parameter values for the already configured WSDL and methodname. State is reset everytime any of the display profile properties are changed through this method.

Proxy Configuration
A Simple Web Service Provider uses a proxy to make calls to the remote web service if the proxy is set in the jvm12.conf file for web server For Example the proxy can be set as http.proxyHost=
http.proxyPort=


See Also:   SimpleWebServiceParameter
See Also:   SimpleWebServiceState
See Also:   SimpleWebServiceException
See Also:   SimpleWebServiceProcessException
See Also:   XList



Field Summary
final public static  StringDP_CACHE_TIME_OUT
    
final public static  StringDP_DEFAULT_INPUT
    
final public static  StringDP_IS_DEFAULT_AVAILABLE
    
final public static  StringDP_IS_DEFAULT_SHOW_OUTPUT
    
final public static  StringDP_METHOD_NAME
    
final public static  StringDP_WSDL_URL
    
final public static  StringEDIT_DEFAULT_INPUT
    
final public static  StringEDIT_DEFAULT_WSDL_URL
    
final public static  intNO_CACHE_TIME_OUT_SPECIFIED
    


Method Summary
public  SimpleWebServiceParameter[]defineInputForWebService(HttpServletRequest req)
     This method returns an array of SimpleWebServiceParameters.
public  SimpleWebServiceParameter[]defineInputForWebService()
    
public  intgetDescriptorCacheTimeOut()
     Gets the time-out value for the WebServiceDescriptor cache from the profile store.
public  StringgetMethodName()
     Gets the configured web service method name from the profile store.
public  StringgetWSDL()
     Gets the URL for the configured WSDL from the profile store.
protected  WebServiceDescriptorgetWebServiceDescriptor()
     This method fetches an instance of WebServiceDescriptor from the WebServiceDescriptor factory.
abstract public  SimpleWebServiceParameterinvokeWebService(SimpleWebServiceParameter[] input)
     The abstract method that invokes the web service method using the input paramters provided as a SimpleWebServiceParameter array.


Parameters:
  input - array of web service input parameters.

public  booleanisDefaultAvailable()
     Gets the boolean value from the profile database.
public  booleanisDefaultShowOutput()
     Gets the value of DP_IS_DEFAULT_SHOW_OUTPUT from the profile database.
public  StringmakeUniqueStr(String name)
     This method prepends a string with the name of the channel to make a unique name that can be used in an input form rendered by webserviceContent.jsp.


Parameters:
  name - the name of the channel.

public  URLprocessEdit(HttpServletRequest request, HttpServletResponse res)
     Overridden processEdit method, checks for the request parameter "editContent".
public  SimpleWebServiceStateprocessRequest(HttpServletRequest request)
     This method is called by webserviceContent.jsp to get the results to be rendered on the page.
protected  SimpleWebServiceParameter[]readInputFromDefault()
     This method reads input values for a web service method from the profile database and returns them as an array of SimpleWebServiceParameter.
protected  SimpleWebServiceParameter[]readInputFromRequest(HttpServletRequest req)
     This method reads the input values for a web service method and returns them as an array of SimpleWebServiceParameter.
public  voidsaveInputAsDefault(HttpServletRequest req)
     This method reads the input values for a web service method from an servlet request and stores them as default values in the profile database.
public  booleanshowInputForm(HttpServletRequest request)
     This method is called by the webserviceContent.jsp to find out if it should prompt the user for input by showing an input form or if it should show the results.
public  voidvalidateFunctionalitySupport(WebServiceDescriptor descriptor)
     Throws an ProviderException if the WSDL (as represented by given instance of WebServiceDescriptor) requires functonality not supported by his provider.

Field Detail
DP_CACHE_TIME_OUT
final public static String DP_CACHE_TIME_OUT(Code)



DP_DEFAULT_INPUT
final public static String DP_DEFAULT_INPUT(Code)



DP_IS_DEFAULT_AVAILABLE
final public static String DP_IS_DEFAULT_AVAILABLE(Code)



DP_IS_DEFAULT_SHOW_OUTPUT
final public static String DP_IS_DEFAULT_SHOW_OUTPUT(Code)



DP_METHOD_NAME
final public static String DP_METHOD_NAME(Code)



DP_WSDL_URL
final public static String DP_WSDL_URL(Code)



EDIT_DEFAULT_INPUT
final public static String EDIT_DEFAULT_INPUT(Code)



EDIT_DEFAULT_WSDL_URL
final public static String EDIT_DEFAULT_WSDL_URL(Code)



NO_CACHE_TIME_OUT_SPECIFIED
final public static int NO_CACHE_TIME_OUT_SPECIFIED(Code)





Method Detail
defineInputForWebService
public SimpleWebServiceParameter[] defineInputForWebService(HttpServletRequest req) throws ProviderException, SimpleWebServiceException(Code)
This method returns an array of SimpleWebServiceParameters. There is 1-to-1 correspondence between the array elements and variables defined for the web service method to be called.

This method is used by JSPs to render the proper UI for input values. This method is also used by other methods in the provider to read input from Request or Profile.

an array of SimpleWebServiceParameters.
throws:
  ProviderException - if there was a generic Provider error.
throws:
  SimpleWebServiceException - if there was an error associatedwith the web service.




defineInputForWebService
public SimpleWebServiceParameter[] defineInputForWebService() throws ProviderException, SimpleWebServiceException(Code)



getDescriptorCacheTimeOut
public int getDescriptorCacheTimeOut() throws ProviderException(Code)
Gets the time-out value for the WebServiceDescriptor cache from the profile store.

the int value (secs) of WebServiceDescriptor cache time-out.
throws:
  ProviderException - if there was a problem getting the WebServiceDescriptor cache time-out.




getMethodName
public String getMethodName() throws ProviderException(Code)
Gets the configured web service method name from the profile store.

the web service method name.
throws:
  ProviderException - if there was a problem getting the method name.




getWSDL
public String getWSDL() throws ProviderException(Code)
Gets the URL for the configured WSDL from the profile store.

the WSDL URL.
throws:
  ProviderException - if there were problems obtaining the WSDL URL.




getWebServiceDescriptor
protected WebServiceDescriptor getWebServiceDescriptor() throws ProviderException, SimpleWebServiceException(Code)
This method fetches an instance of WebServiceDescriptor from the WebServiceDescriptor factory. It throws an Provider Exception if the web service uses features not (yet) supported by this web service.
exception:
  com.sun.portal.providers.ProviderException -
exception:
  com.sun.portal.providers.simplewebservice.SimpleWebServiceException -



invokeWebService
abstract public SimpleWebServiceParameter invokeWebService(SimpleWebServiceParameter[] input) throws ProviderException, SimpleWebServiceException(Code)
The abstract method that invokes the web service method using the input paramters provided as a SimpleWebServiceParameter array.


Parameters:
  input - array of web service input parameters. the output result.
throws:
  ProviderException - if there was a generic Provider error.
throws:
  SimpleWebServiceException - if there was an error associatedwith the web service.




isDefaultAvailable
public boolean isDefaultAvailable() throws ProviderException(Code)
Gets the boolean value from the profile database. Value of true indicates that default input data is available from the profile database at this time.

true if DP_IS_DEFAULT_AVAILABLE is true, false if not.
throws:
  ProviderException - if there was a problem getting the property.




isDefaultShowOutput
public boolean isDefaultShowOutput() throws ProviderException(Code)
Gets the value of DP_IS_DEFAULT_SHOW_OUTPUT from the profile database. If value is true, the Provider uses the default input values (if available) from the profile database to invoke the web service method. If false, the JSP shows the form prompting the user for input values.

true if DP_IS_DEFAULT_SHOW_OUTPUT is true, false if not.
throws:
  ProviderException - if there was a problem getting the property.




makeUniqueStr
public String makeUniqueStr(String name)(Code)
This method prepends a string with the name of the channel to make a unique name that can be used in an input form rendered by webserviceContent.jsp.


Parameters:
  name - the name of the channel. the unique name to use for the channel.




processEdit
public URL processEdit(HttpServletRequest request, HttpServletResponse res) throws ProviderException(Code)
Overridden processEdit method, checks for the request parameter "editContent". Based on the value of this parameter. If the value is EDIT_DEFAULT_WSDL_URL, the method tries to save the new wsdl/methodname from the request object, If the value is EDIT_DEFAULT_INPUT, it tries to save the default input parameter values for already configured wsdl and methodname. State is reset everytime, any of the display profile properties are changed through this method.


Parameters:
  request - the HttpServletRequest.
Parameters:
  res - the HttpServletResponse.
throws:
  ProviderException - if there was a generic Provider error.




processRequest
public SimpleWebServiceState processRequest(HttpServletRequest request) throws ProviderException, SimpleWebServiceException(Code)
This method is called by webserviceContent.jsp to get the results to be rendered on the page. This method uses logic to find out whether the results are to be produced using 1) stored state 2) request parameter or 3) default input parameters. In case of 2) and 3), this method calls the abstract method invokeWebService() to actually invoke the web service.


Parameters:
  request - the HttpServletRequest. the state of the web service.
throws:
  ProviderException - if there was a generic Provider error.
throws:
  SimpleWebServiceException - if there was an error associatedwith the web service.




readInputFromDefault
protected SimpleWebServiceParameter[] readInputFromDefault() throws ProviderException, SimpleWebServiceException(Code)
This method reads input values for a web service method from the profile database and returns them as an array of SimpleWebServiceParameter.
exception:
  com.sun.portal.providers.ProviderException -
exception:
  com.sun.portal.providers.simplewebservice.SimpleWebServiceException -



readInputFromRequest
protected SimpleWebServiceParameter[] readInputFromRequest(HttpServletRequest req) throws ProviderException, SimpleWebServiceException(Code)
This method reads the input values for a web service method and returns them as an array of SimpleWebServiceParameter.
Parameters:
  req -
exception:
  com.sun.portal.providers.ProviderException -
exception:
  com.sun.portal.providers.simplewebservice.SimpleWebServiceException -



saveInputAsDefault
public void saveInputAsDefault(HttpServletRequest req) throws ProviderException, SimpleWebServiceException(Code)
This method reads the input values for a web service method from an servlet request and stores them as default values in the profile database. It is called by webserviceInputDoEdit.jsp


Parameters:
  req - the HttpServletRequest
throws:
  ProviderException - if there was a generic Provider error.
throws:
  SimpleWebServiceException - if there was an error associated with theweb service.




showInputForm
public boolean showInputForm(HttpServletRequest request) throws ProviderException(Code)
This method is called by the webserviceContent.jsp to find out if it should prompt the user for input by showing an input form or if it should show the results. This method uses the stored state and request parameter "myProvider" & "invokeService" to decide what needs to be rendered.


Parameters:
  request - the HttpServletRequest
throws:
  ProviderException - if there was a generic Provider error.




validateFunctionalitySupport
public void validateFunctionalitySupport(WebServiceDescriptor descriptor) throws SimpleWebServiceException, ProviderException(Code)
Throws an ProviderException if the WSDL (as represented by given instance of WebServiceDescriptor) requires functonality not supported by his provider.
Parameters:
  descriptor - the web service descriptor that contains all the meta information about the web service.
throws:
  ProviderException - if there was a generic Provider error.
throws:
  SimpleWebServiceException - if there was an error associatedwith the web service.



Methods inherited from com.sun.portal.providers.jsp.JSPProvider
protected File getCompiledJSPPath(ProviderContext pc, String channel, String file) throws ProviderException(Code)(Java Doc)
public StringBuffer getContent(HttpServletRequest req, HttpServletResponse res) throws ProviderException(Code)(Java Doc)
protected String getContentPage() throws ProviderException(Code)(Java Doc)
public StringBuffer getEdit(HttpServletRequest req, HttpServletResponse res) throws ProviderException(Code)(Java Doc)
protected String getEditPage() throws ProviderException(Code)(Java Doc)
protected File getExistingJSPPath(ProviderContext pc, String channel, String file) throws ProviderException(Code)(Java Doc)
protected File getMostSpecificJSPPath(ProviderContext pc, String channel, String file) throws ProviderException(Code)(Java Doc)
protected String getProcessPage() throws ProviderException(Code)(Java Doc)
protected StringBuffer includeJspPage(String jsp, Hashtable parameters, HttpServletRequest req, HttpServletResponse res) throws ProviderException(Code)(Java Doc)
public void init(String n, HttpServletRequest httpreq) throws ProviderException(Code)(Java Doc)
public boolean isPresentable(HttpServletRequest req)(Code)(Java Doc)
public URL processEdit(HttpServletRequest req, HttpServletResponse res) throws ProviderException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.