-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Elli wrote: > Hi, I am trying to write a generic service that works against > another framework. This service has to support a few data types > that are specified as Java Beans, but are not known at development > time as they will be specified at deployment time. > > A good analogy will be a service that inserts Java Beans to a > database using something like hibernate. The user can choose the > list of tables to expose, and gets an operation for each table. The > WSDL should contain the schema of the input record, which maps to a > Java Bean. So if I decide to expose the tables “CUSTOMER” and > “ORDER”, the WSDL will contain two operations, one for each table. > The operations must contain a request schema that matches the bean > associated with the table by hibernate, “beans.Customer” and > “beans.Order”. > > It is not possible to write a function for each operation, because > it relies on the list of tables that the user configures, and the > java beans associated with the tables are extracted by hibernate. > This is configurable by the user and not known at development time. > > > I have the feeling that all the pieces are there and it should be a > fairly quick task, but I am having a hard time finding the starting > point after reading all the documentation. The documentation deals > extensively with static signatures, where the WSDL is generated > dynamically based on a Java function signature that is strongly > typed, but not when the Java function is generic and the request > object is a configuration property. > > I am thinking of something like this: > > <service name="InsertToTables" class="sample.InsertToTablesService" > scope="application"> <messageReceivers> <messageReceiver > mep="http://www.w3.org/2004/08/wsdl/in-only" > > class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/> > </messageReceivers> <parameter > name="ServiceClass">sample.InsertSingleRecord</parameter> > <parameter name="tables"> <tables> <table>CUSTOMER</table> > <table>ORDER</table> </tables> </parameter> </service> > > Or even add the operations individually: <operation > name="customer"> <messageReceiver > class="org.apache.axis2.receivers.RPCInOnlyMessageReceiver" /> > <actionMapping>urn:insert</actionMapping> <parameter > name="table">CUSTOMER</parameter> </operation> <operation > name="order"> <messageReceiver > class="org.apache.axis2.receivers.RPCInOnlyMessageReceiver" /> > <actionMapping>urn:insert</actionMapping> <parameter > name="table">ORDER</parameter> </operation> > > The service class should be generic: > > public void insert(Object javaBeanRecord) or: public void > insert(OMElement xmlRecord) > > but still have the WSDL generated properly form the Java Bean of > the table. > > I am looking for a place to plug in the schema in the WSDL > generation, the rest seems very straight forward. AFAIK, you can't plug in the schema in the WSLD generation. But you can put a hand written WSDL in your service archive and configure it to show that WSDL.
Sanka > > Any help will be greatly appreciated! - -- Sanka Samaranayake WSO2 Inc. http://sankas.blogspot.com/ http://www.wso2.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (GNU/Linux) iD8DBQFFb8QQ/Hd0ETKdgNIRAhRzAJ9SaK5qz3xLXNoU/lBVW1llaqkuCwCfbRWS SrqKgc9tQIowMmFFYVHjWI8= =V3Ru -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
