You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sanka Samaranayke <ss...@gmail.com> on 2006/12/01 06:56:33 UTC

Re: Generate WSDL for dynamic types

-----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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Generate WSDL for dynamic types

Posted by Elli <al...@avaya.com>.
Thanks Sanka.
I want to avoid hand coding the WSDL, because it depends on parameters
configurable by the user at deployment. It is actually a goal that the user
will not have to hand code a WSDL. 

I am thinking of getting into the configuration objects and changing the
operations configuration of the service. Then axis will generate the WSDL
from that. Is that possible?
-- 
View this message in context: http://www.nabble.com/Generate-WSDL-for-dynamic-types-tf2728713.html#a7640645
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Generate WSDL for dynamic types

Posted by Sanka Samaranayke <ss...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Elli wrote:
> Thanks again. Is there any place to interfere with the service
> definition before that execution? Maybe in a service lifecycle
> listener?

You can write your own CustomAxisObserver class which will get called
when a service is deployed.
(You need to put the following entry in the axis2.xml.  <listener
class="full name of your CustomAxisObserver"/>)

That way you can get access for the service configuration at
deployment time. I think you need to generate and set
schema and type mapping in the service configuration once you have
access to it. If you set it properly then the
generated WSDL should reflects the actual data types you use for the
service.

see also :   org.apache.ws.java2wsdl.SchemaGenerator
                 org.apache.axis2.deployment.util.Util
                 org.apache.axis2.deployment.DeploymentEngine


Hope this will help ..!!

Sanka



- --
Sanka Samaranayake
WSO2 Inc.

http://sankas.blogspot.com/
http://www.wso2.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFFd9AT/Hd0ETKdgNIRAhqZAJ94O99C3zXMFqyClx74mOfecmpTRQCaAkDX
jNqQ69wzL79qQBWauq7dr2g=
=nQR/
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Generate WSDL for dynamic types

Posted by Elli <al...@avaya.com>.
Thanks again. Is there any place to interfere with the service definition
before that execution? Maybe in a service lifecycle listener?
-- 
View this message in context: http://www.nabble.com/Generate-WSDL-for-dynamic-types-tf2728713.html#a7684279
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Generate WSDL for dynamic types

Posted by Sanka Samaranayke <ss...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Elli wrote:
> Thanks Sanka. I want to avoid hand coding the WSDL, because it
> depends on parameters configurable by the user at deployment time.
> It is actually a goal that the user will not have to hand code a
> WSDL.
>
> I am thinking of getting into the configuration objects and
> changing the operations configuration of the service. Then axis
> will generate the WSDL from that. Is that possible?

AFAIK, it is not possible since most parts of the WSDL are generated
by the deployment
at the time of the deployment using Java reflection.

Sanka


- --
Sanka Samaranayake
WSO2 Inc.

http://sankas.blogspot.com/
http://www.wso2.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFFdGgB/Hd0ETKdgNIRAiPYAJ4ksK2WunTl04VpGHEf3ekUofiNbwCfWhWu
chY7tOGwQVTIc/xwtIAfpUk=
=HS9R
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Generate WSDL for dynamic types

Posted by Elli <al...@avaya.com>.
Thanks Sanka.
I want to avoid hand coding the WSDL, because it depends on parameters
configurable by the user at deployment time. It is actually a goal that the
user will not have to hand code a WSDL. 

I am thinking of getting into the configuration objects and changing the
operations configuration of the service. Then axis will generate the WSDL
from that. Is that possible?
-- 
View this message in context: http://www.nabble.com/Generate-WSDL-for-dynamic-types-tf2728713.html#a7643734
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org