Hi all:

I've started cleaning up the "message style" service architecture for Axis, and
wanted to run some thoughts by the assembled masses for comments.

As I see it, there are three cases we want to support.

NOTE: In all of these cases, I think that there's the "give me the envelope"
option and the "give me the body contents" option.  This is simply specifying
your method as taking a SOAPEnvelope or a SOAPBodyElement[], i.e.:

  public SOAPBodyElement [] envMethod(SOAPEnvelope env);

  public SOAPBodyElement [] bodyMethod(SOAPBodyElement [] bodies);

The engine will figure out the right thing to do based on the method signature
(during OperationDesc introspection).

Now, here are the cases (each containing sample WSDD):

1) Single method handling all messages.

<service name="singleMethod" style="message">
  <operation name="envMethod"/>
  (or equiv <allowedMethods>)
</service>

In this case, any message which comes in would pass the whole envelope to
envMethod().

2) Element localName "automaps" to method name

<service name="automap" style="message">
  <allowedMethods>bodyMethod envMethod</allowedMethods>
  (or equiv <operation>s)
</service>

So in this case, <Body><bodyMethod>...</bodyMethod></Body> would end up calling
bodyMethod() with the body elements, and
<Body><envMethod>...</envMethod></Body> would call envMethod() with the whole
envelope.  Other XML would result in "no such method".

3) Arbitrary mapping of element QName -> method

<service name="mapped" style="message">
  <operation name="method1" qname="ns:someElement" xmlns:ns="http://foo"/>
  <operation name="method2" qname="ns:otherElement" xmlns:ns="http://foo"/>
</service>

In this case, bodyMethod() would get called when a message arrived which looks
like:

 <Body>
   <foo:someElement xmlns:foo="http://foo";>...</foo:someElement>
 </Body>

In a similar way, foo:otherElement would call envMethod, and other elements
would get "unrecognized element".

Note that this approach makes the following assumption - if there is a single
<operation> or allowed method, we should funnel ALL messages to it.  If there
is more than one, we should do a mapping (either the default localname one, or
a specific one).  It may be that there is a case where you have a single method
that you want to accept a single body QName and fault on others - if so, we'd
need to define another way of doing that (i.e. an "acceptAll" attribute on the
<operation> to indicate the non-matching case).

QUESTIONS:

Are these the right options?

Does the suggested WSDD make sense?

Thanks for your input!

--Glen


Reply via email to