Source Code Cross Referenced for RPCServiceClient.java in  » Web-Services-AXIS2 » adb » org » apache » axis2 » rpc » client » 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 AXIS2 » adb » org.apache.axis2.rpc.client 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements. See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership. The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License. You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied. See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.
018:         */
019:        package org.apache.axis2.rpc.client;
020:
021:        import org.apache.axiom.om.OMElement;
022:        import org.apache.axis2.AxisFault;
023:        import org.apache.axis2.client.ServiceClient;
024:        import org.apache.axis2.client.async.Callback;
025:        import org.apache.axis2.client.async.AxisCallback;
026:        import org.apache.axis2.context.ConfigurationContext;
027:        import org.apache.axis2.databinding.utils.BeanUtil;
028:        import org.apache.axis2.description.AxisService;
029:        import org.apache.axis2.engine.DefaultObjectSupplier;
030:
031:        import javax.xml.namespace.QName;
032:        import java.net.URL;
033:
034:        public class RPCServiceClient extends ServiceClient {
035:
036:            private boolean notNullService;
037:
038:            public RPCServiceClient(ConfigurationContext configContext,
039:                    AxisService service) throws AxisFault {
040:                super (configContext, service);
041:                if (service != null) {
042:                    notNullService = true;
043:                }
044:            }
045:
046:            public RPCServiceClient() throws AxisFault {
047:                super ();
048:            }
049:
050:            public RPCServiceClient(ConfigurationContext configContext,
051:                    URL wsdlURL, QName wsdlServiceName, String portName)
052:                    throws AxisFault {
053:                super (configContext, wsdlURL, wsdlServiceName, portName);
054:                notNullService = true;
055:            }
056:
057:            /**
058:             * Return value can be a single a object or an object array (itself an object) , but it is
059:             * difficulty to figure the return object correctly unless we have TyepMapping in the client
060:             * side too. Until it is finalized lets return OMElement as return value. And the retuen value
061:             * will be the body first element user has to deal with that and create his own object out of
062:             * that.
063:             *
064:             * @param opName Operation QName (to get the body wrapper element)
065:             * @param args   Arraylist of objects
066:             * @return Response OMElement
067:             * @throws AxisFault in case of a problem - this can either be a processing fault or a received
068:             *                   on-the-wire fault.
069:             */
070:            public OMElement invokeBlocking(QName opName, Object[] args)
071:                    throws AxisFault {
072:                OMElement omElement = BeanUtil.getOMElement(opName, args, null,
073:                        false, null);
074:                if (notNullService) {
075:                    return super .sendReceive(opName, omElement);
076:                }
077:                return super .sendReceive(omElement);
078:            }
079:
080:            /**
081:             * @param opName      Operation QName (to get the body wrapper element)
082:             * @param args        Arraylist of objects
083:             * @param returnTypes , this array contains the JavaTypes for the return object , it could be
084:             *                    one or more depending on the return type , most of the type array will
085:             *                    contain just one element It should be noted that the array should only
086:             *                    contains JavaTypes NOT real object , what this methods does is , get the
087:             *                    body first element , and if it contains more than one childern take ith
088:             *                    element and convert that to ith javatype and fill the return arrya the
089:             *                    array will look like as follows [Integer, String, MyBean , etc]
090:             * @return Object array , whic will contains real object , but the object can either be simple
091:             *         type object or the JavaBeans, thats what this method can handle right now the return
092:             *         array will contains [10, "Axis2Echo", {"foo","baa","11"}]
093:             * @throws AxisFault a problem occurred, either locally or on the other side of the wire
094:             */
095:
096:            public Object[] invokeBlocking(QName opName, Object[] args,
097:                    Class[] returnTypes) throws AxisFault {
098:                OMElement omElement = BeanUtil.getOMElement(opName, args, null,
099:                        false, null);
100:                OMElement response;
101:                if (notNullService) {
102:                    response = super .sendReceive(opName, omElement);
103:                } else {
104:                    response = super .sendReceive(omElement);
105:                }
106:                return BeanUtil.deserialize(response, returnTypes,
107:                        new DefaultObjectSupplier());
108:            }
109:
110:            /**
111:             * Invoke the nonblocking/Asynchronous call
112:             *
113:             * @param opName Operation QName (to get the body wrapper element)
114:             * @param args an array of argument Objects
115:             * @param callback object extending Callback which will receive notifications
116:             * @throws AxisFault in case of a local processing error
117:             * @deprecated Please use the AxisCallback interface rather than Callback, which has been deprecated
118:             */
119:            public void invokeNonBlocking(QName opName, Object[] args,
120:                    Callback callback) throws AxisFault {
121:                OMElement omElement = BeanUtil.getOMElement(opName, args, null,
122:                        false, null);
123:                // call the underlying implementation
124:                if (notNullService) {
125:                    super .sendReceiveNonBlocking(opName, omElement, callback);
126:                } else {
127:                    super .sendReceiveNonBlocking(omElement, callback);
128:                }
129:            }
130:
131:            /**
132:             * Invoke the nonblocking/Asynchronous call
133:             *
134:             * @param opName Operation QName (to get the body wrapper element)
135:             * @param args an array of argument Objects
136:             * @param callback object implementing AxisCallback which will receive notifications
137:             * @throws AxisFault in case of a local processing error
138:             */
139:            public void invokeNonBlocking(QName opName, Object[] args,
140:                    AxisCallback callback) throws AxisFault {
141:                OMElement omElement = BeanUtil.getOMElement(opName, args, null,
142:                        false, null);
143:                // call the underlying implementation
144:                if (notNullService) {
145:                    super .sendReceiveNonBlocking(opName, omElement, callback);
146:                } else {
147:                    super .sendReceiveNonBlocking(omElement, callback);
148:                }
149:            }
150:
151:            public void invokeRobust(QName opName, Object[] args)
152:                    throws AxisFault {
153:                OMElement omElement = BeanUtil.getOMElement(opName, args, null,
154:                        false, null);
155:                //call the underline implementation
156:                if (notNullService) {
157:                    super.sendRobust(opName, omElement);
158:                } else {
159:                    super.sendRobust(omElement);
160:                }
161:            }
162:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.