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 "Iyengar, Kumar" <ku...@bmc.com> on 2007/11/14 01:30:36 UTC

Dynamic web services

Hi all,

 

We use Axis in a non standard way. The typical use of Axis is where one
generates the java stubs and then populates the stubs and deploys the
application. In our application we do it a bit dynamically - we have a
generic service and when the request comes in, it takes the request and
then extracts the document, determines the operation and makes internal
api calls. This way we never generate stubs.

 

I am currently upgrading our setup from Axis to Axis2 and having
problems with it:

1) I tried creating a service.xml file specifying the 'ServiceClass'
name. However, it is not clear whether I need to specify the method
name. With Axis I could specify the method name in the wsdd file.

2) Is there a complete documentation that explains all the options that
can be specified in a service.xml? I have only found links (especially
in IBM developer network) that explain bits and pieces.

3) Also, is it OK not to specify any operation in the service.xml file?
What I really want is my code to take control of the Message Context and
then extract the document and operation and then make internal calls. 

4) if none of that work then do I have to do this by writing my own
handler? I hope that is not the case since I could do this very easily
with Axis.

 

Any help is greatly appreciated.

 

--kumar


Re: Dynamic web services

Posted by Jeff Greif <je...@gmail.com>.
I asked some similar questions within the last week, so can pass on what 
I learned.

1. A pointer to the services schema is 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/resources/services.xsd?view=markup 
<http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/resources/services.xsd?view=markup>

2. If you don't list any operations or use the <excludeOperations> 
element, all the public methods of the service class become operations 
(or perhaps only those with signatures compatible with the 
MessageReceiver?).

3. You'll probably want to provide some dispatcher elements and probably 
a custom class in services.xml. Perhaps the standard dispatchers are 
sufficient to determine the service (trying first the request URL, then 
the soap action and then the first soap body child element). Then the 
operation in that service class must be determined. Normally, the soap 
body element's first child is matched against operation names in 
service.xml (or if none are present, against method names of the 
implementation class). You can provide your own dispatcher class whose 
findOperation method returns the same method for all possible soap body 
first children allowing that method to deal with further dispatching.

4. You'll probably be specifying the RawInOutXmlMessageReceiver (name is 
something like that). It's the closest analog to the Axis 1.x message style.

Hope this helps (that is, I'm not steering you wrong).

Jeff



Iyengar, Kumar wrote:
>
> Hi all,
>
> We use Axis in a non standard way. The typical use of Axis is where 
> one generates the java stubs and then populates the stubs and deploys 
> the application. In our application we do it a bit dynamically – we 
> have a generic service and when the request comes in, it takes the 
> request and then extracts the document, determines the operation and 
> makes internal api calls. This way we never generate stubs.
>
> I am currently upgrading our setup from Axis to Axis2 and having 
> problems with it:
>
> 1) I tried creating a service.xml file specifying the ‘ServiceClass’ 
> name. However, it is not clear whether I need to specify the method 
> name. With Axis I could specify the method name in the wsdd file.
>
> 2) Is there a complete documentation that explains all the options 
> that can be specified in a service.xml? I have only found links 
> (especially in IBM developer network) that explain bits and pieces.
>
> 3) Also, is it OK not to specify any operation in the service.xml 
> file? What I really want is my code to take control of the Message 
> Context and then extract the document and operation and then make 
> internal calls.
>
> 4) if none of that work then do I have to do this by writing my own 
> handler? I hope that is not the case since I could do this very easily 
> with Axis.
>
> Any help is greatly appreciated.
>
> --kumar
>


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


RE: Dynamic web services

Posted by "Iyengar, Kumar" <ku...@bmc.com>.
Also, I get an error "Unable to parse request URL
[urn:testWS2][/arsys/services]". I get this error whether I have a
service.xml file or not. The URL that I pass in to my application is
http://zzz:8080/arsys/services/ARService?server =xxx&WebService=yyy 

 

Has anyone seen this error? 

 

--kumar

 

________________________________

From: Iyengar, Kumar [mailto:kumar_iyengar@bmc.com] 
Sent: Tuesday, November 13, 2007 4:31 PM
To: axis-user@ws.apache.org
Subject: Dynamic web services

 

Hi all,

 

We use Axis in a non standard way. The typical use of Axis is where one
generates the java stubs and then populates the stubs and deploys the
application. In our application we do it a bit dynamically - we have a
generic service and when the request comes in, it takes the request and
then extracts the document, determines the operation and makes internal
api calls. This way we never generate stubs.

 

I am currently upgrading our setup from Axis to Axis2 and having
problems with it:

1) I tried creating a service.xml file specifying the 'ServiceClass'
name. However, it is not clear whether I need to specify the method
name. With Axis I could specify the method name in the wsdd file.

2) Is there a complete documentation that explains all the options that
can be specified in a service.xml? I have only found links (especially
in IBM developer network) that explain bits and pieces.

3) Also, is it OK not to specify any operation in the service.xml file?
What I really want is my code to take control of the Message Context and
then extract the document and operation and then make internal calls. 

4) if none of that work then do I have to do this by writing my own
handler? I hope that is not the case since I could do this very easily
with Axis.

 

Any help is greatly appreciated.

 

--kumar