Java Doc for SOAPMapCallingConvention.java in  » Web-Services » xins » org » xins » server » 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 » Web Services » xins » org.xins.server 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.xins.server.CallingConvention
   org.xins.server.SOAPCallingConvention
      org.xins.server.SOAPMapCallingConvention

SOAPMapCallingConvention
public class SOAPMapCallingConvention extends SOAPCallingConvention (Code)
The SOAP calling convention that tries to map the SOAP request to the parameters of the function. The rules applied for the mapping are the same as for the command wsdl-to-api.

Note that by default any SOAP message will be handled by the _xins_soap calling convention. If you want to use this calling convention you will need to explicitly have _convention=_xins_soap_map in the URL parameters.

This calling convention is easily extendable in order to adapt to the specificity of your SOAP requests.

Here is the mapping for the input:

  • If the element in the Body ends with 'Request', the function name is considered to be what is specified before
  • Otherwise the name of the element is used for the name of the function
  • Elements in the request are mapped to input parameters if available.
  • Elements with sub-elements are mapped to input parameters element1.sub-element1... if available.
  • If no parameter is found, try to find an input data element with the name.
  • If not found, go to the sub-elements and try to find an input data element with the name.
  • If not found, skip it. Here it's up to you to override this convention and provide a mapping.

Here is the mapping for the output:

  • Response name = function name + "Response"
  • Output parameters with dots are transformed to XML. e.g. element1.element2 -> <element1><element2>value</element2></element1>
  • The data section is not put in the returned XML, only the elements it contains.
  • Data section element attributes are changed to sub-elements with the same rule as for output parameters.

version:
   $Revision: 1.8 $ $Date: 2007/09/18 08:45:06 $
author:
   Anthony Goubard
since:
   XINS 2.1.


Field Summary
final protected static  StringREQUEST_BODY
     The key used to store the Body element of the request.
final protected static  StringREQUEST_ENVELOPE
     The key used to store the Envelope element of the request.
final protected static  StringREQUEST_FUNCTION
     The key used to store the function element of the request.

Constructor Summary
public  SOAPMapCallingConvention(API api)
     Creates a new SOAPCallingConvention instance.

Method Summary
protected  FunctionRequestconvertRequestImpl(HttpServletRequest httpRequest)
    
protected  voidconvertResultImpl(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest)
    
protected  booleanmatches(HttpServletRequest httpRequest)
    
protected  FunctionRequestreadInput(Element functionElem, String functionName)
     Generates the function request based the the SOAP request.
protected  ElementreadInputElem(Element inputElem, String functionName, String parent, Element parentElement, BasicPropertyReader inputParams)
     Parses the SOAP request element according to the rules specified in this class description.
protected  voidsetDataElementAttribute(ElementBuilder builder, String attributeName, String attributeValue, String elementNameSpacePrefix)
    
protected  voidwriteOutputDataElement(Map dataSectionSpec, Element dataElement, Element parent)
     Write the given output data element in the SOAP response.
protected  voidwriteOutputDataSection(String functionName, FunctionResult xinsResult, Element response)
     Writes the output data section to the SOAP XML.
protected  voidwriteOutputParameter(String parameterName, String parameterValue, Element parent)
     Write an output parameter to the SOAP response.
protected  voidwriteOutputParameters(String functionName, FunctionResult xinsResult, Element response)
     Writes the output parameters to the SOAP XML.
protected  ElementwriteResponse(HttpServletRequest httpRequest, FunctionResult xinsResult)
    

Field Detail
REQUEST_BODY
final protected static String REQUEST_BODY(Code)
The key used to store the Body element of the request.



REQUEST_ENVELOPE
final protected static String REQUEST_ENVELOPE(Code)
The key used to store the Envelope element of the request.



REQUEST_FUNCTION
final protected static String REQUEST_FUNCTION(Code)
The key used to store the function element of the request.




Constructor Detail
SOAPMapCallingConvention
public SOAPMapCallingConvention(API api) throws IllegalArgumentException(Code)
Creates a new SOAPCallingConvention instance.
Parameters:
  api - the API, needed for the SOAP messages, cannot be null.
throws:
  IllegalArgumentException - if api == null.




Method Detail
convertRequestImpl
protected FunctionRequest convertRequestImpl(HttpServletRequest httpRequest) throws InvalidRequestException, FunctionNotSpecifiedException(Code)



convertResultImpl
protected void convertResultImpl(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws IOException(Code)



matches
protected boolean matches(HttpServletRequest httpRequest) throws Exception(Code)



readInput
protected FunctionRequest readInput(Element functionElem, String functionName)(Code)
Generates the function request based the the SOAP request. This function will get the XML element in the SOAP request and associate the values with the input parameter or data section element of the function.
Parameters:
  functionElem - the SOAP element of the function request, cannot be null.
Parameters:
  functionName - the name of the function, cannot be null.the function request that will be passed to the XINS function, cannot be null.



readInputElem
protected Element readInputElem(Element inputElem, String functionName, String parent, Element parentElement, BasicPropertyReader inputParams) throws Exception(Code)
Parses the SOAP request element according to the rules specified in this class description.
Parameters:
  inputElem - the SOAP request element, cannot be null.
Parameters:
  functionName - the name of the function, cannot be null.
Parameters:
  parent - the name of the super element, can be null.
Parameters:
  parentElement - the input data element that is being created, can be null.
Parameters:
  inputParams - the PropertyReader where the input parameters should be stored, cannot be null.the input data element for the FunctionRequest or null if the SOAPrequest does not need to create a input data element.
throws:
  Exception - if anything goes wrong such specifications not available or incorrect SOAP request.



setDataElementAttribute
protected void setDataElementAttribute(ElementBuilder builder, String attributeName, String attributeValue, String elementNameSpacePrefix)(Code)



writeOutputDataElement
protected void writeOutputDataElement(Map dataSectionSpec, Element dataElement, Element parent)(Code)
Write the given output data element in the SOAP response.
Parameters:
  dataSectionSpec - the specification of the output data elements for the function, cannot be null.
Parameters:
  dataElement - the data element to tranform as SOAP element, cannot be null.
Parameters:
  parent - the parent element to add the created element, cannot be null.



writeOutputDataSection
protected void writeOutputDataSection(String functionName, FunctionResult xinsResult, Element response)(Code)
Writes the output data section to the SOAP XML.
Parameters:
  functionName - the name of the function called.
Parameters:
  xinsResult - the result of the call to the function.
Parameters:
  response - the SOAP response element, cannot be null.



writeOutputParameter
protected void writeOutputParameter(String parameterName, String parameterValue, Element parent)(Code)
Write an output parameter to the SOAP response.
Parameters:
  parameterName - the name of the output parameter, cannot be null.
Parameters:
  parameterValue - the value of the output parameter, cannot be null.
Parameters:
  parent - the parent element to put the created element in, cannot be null.



writeOutputParameters
protected void writeOutputParameters(String functionName, FunctionResult xinsResult, Element response)(Code)
Writes the output parameters to the SOAP XML.
Parameters:
  functionName - the name of the function called, cannot be null.
Parameters:
  xinsResult - the result of the call to the function, cannot be null.
Parameters:
  response - the SOAP response element, cannot be null.



writeResponse
protected Element writeResponse(HttpServletRequest httpRequest, FunctionResult xinsResult) throws IOException(Code)



Fields inherited from org.xins.server.SOAPCallingConvention
final protected static String FUNCTION_NAME(Code)(Java Doc)
final protected static String REQUEST_NAMESPACE(Code)(Java Doc)
final protected static String RESPONSE_CONTENT_TYPE(Code)(Java Doc)
final protected static String RESPONSE_ENCODING(Code)(Java Doc)

Methods inherited from org.xins.server.SOAPCallingConvention
protected FunctionRequest convertRequestImpl(HttpServletRequest httpRequest) throws InvalidRequestException, FunctionNotSpecifiedException(Code)(Java Doc)
protected void convertResultImpl(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws IOException(Code)(Java Doc)
protected String[] getSupportedMethods()(Code)(Java Doc)
protected boolean matches(HttpServletRequest httpRequest) throws Exception(Code)(Java Doc)
protected Element readDataSection(Element parametersElem, String functionName) throws InvalidRequestException(Code)(Java Doc)
protected BasicPropertyReader readInputParameters(Element parametersElem, String functionName)(Code)(Java Doc)
protected void setDataElementAttribute(ElementBuilder builder, String attributeName, String attributeValue, String elementNameSpacePrefix)(Code)(Java Doc)
protected Element soapElementTransformation(Map dataSection, boolean input, Element element, boolean top)(Code)(Java Doc)
protected String soapInputValueTransformation(Type parameterType, String value) throws InvalidSpecificationException(Code)(Java Doc)
protected String soapOutputValueTransformation(Type parameterType, String value) throws InvalidSpecificationException(Code)(Java Doc)
protected void writeFaultSection(String functionName, String namespaceURI, FunctionResult xinsResult, XMLOutputter xmlout) throws IOException(Code)(Java Doc)
protected void writeOutputDataSection(String functionName, FunctionResult xinsResult, XMLOutputter xmlout) throws IOException(Code)(Java Doc)
protected void writeOutputParameters(String functionName, FunctionResult xinsResult, XMLOutputter xmlout) throws IOException(Code)(Java Doc)

Methods inherited from org.xins.server.CallingConvention
static void cleanUpParameters(BasicPropertyReader parameters) throws IllegalArgumentException(Code)(Java Doc)
final FunctionRequest convertRequest(HttpServletRequest httpRequest) throws IllegalStateException, IllegalArgumentException, InvalidRequestException, FunctionNotSpecifiedException(Code)(Java Doc)
abstract protected FunctionRequest convertRequestImpl(HttpServletRequest httpRequest) throws InvalidRequestException, FunctionNotSpecifiedException(Code)(Java Doc)
final void convertResult(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws IllegalStateException, IllegalArgumentException, IOException(Code)(Java Doc)
abstract protected void convertResultImpl(FunctionResult xinsResult, HttpServletResponse httpResponse, HttpServletRequest httpRequest) throws IOException(Code)(Java Doc)
BasicPropertyReader gatherParams(HttpServletRequest httpRequest) throws InvalidRequestException(Code)(Java Doc)
final protected API getAPI()(Code)(Java Doc)
final String getConventionName()(Code)(Java Doc)
protected String[] getSupportedMethods()(Code)(Java Doc)
protected String[] getSupportedMethods(HttpServletRequest request)(Code)(Java Doc)
abstract protected boolean matches(HttpServletRequest httpRequest) throws Exception(Code)(Java Doc)
final boolean matchesRequest(HttpServletRequest httpRequest)(Code)(Java Doc)
protected Element parseXMLRequest(HttpServletRequest httpRequest) throws IllegalArgumentException, InvalidRequestException(Code)(Java Doc)
protected Element parseXMLRequest(HttpServletRequest httpRequest, boolean checkType) throws IllegalArgumentException, InvalidRequestException(Code)(Java Doc)
final void setAPI(API api)(Code)(Java Doc)
final void setConventionName(String conventionName)(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.