axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "St-Germain, Sylvain" <Sylvain.StGerm...@cognos.com>
Subject RE: Client side soap:header support.
Date Tue, 23 Apr 2002 18:27:21 GMT
Tom, 

As you noticed I did not set "required" for the reason I pointed out, this
is one of the thing I am investigating now.

As a service consumer you simply do on the client side:

	service.setHeader(String partName, Object o);
	// Note that there is currently no validation done in the setter
	// to ensure you provide the appropriate type, I believe we have 
	// all the info so we should check.

	Object o = service.getHeader(String namespace, String partName);
	// Ideally you should probably not have to bother with the 
	// namespace here.   I'll have a look at it.

About implicit ServiceContext, I understand the idea brought by JAX-RPC but
I see little value (as a WS consumer) in using it.   My idea of header is
that you set them and they are roundtrip, you avoid setting and unsetting
them in a given session... but I could be wrong.  I am not sure if we have
to support both implicit and explicit headers to be JAX-RPC compliant.

I certainly can bundle a userGude section as well as a test case.

Headers and Header are clones of Parameter and Parameters but I can change
this no problem.
I can also get rid of some "ownership" information in there!  as well as
cleaning up the System.out and the tabs.

Thanks Tom for your warm welcome!
Looking forward to see soap:header support in early B2 versions!

Sylvain.

-----Original Message-----
From: Tom Jordahl [mailto:tomj@macromedia.com]
Sent: Tuesday, April 23, 2002 12:07 PM
To: 'axis-dev@xml.apache.org'
Subject: RE: Client side soap:header support. 



Sylvain,

I took a look at this code and its looking good.
I do have some JAX-RPC concerns however.

A few comments/questions:

- The required attribute isn't getting set?  You probably want to
investigate
  and fix that problem as part of your submission.  See your comment in
  Header.java.

- How, as a user of the stub, do I set headers? How do I retrieve them?

- JAX-RPC (chapter 11) talks about the ServiceContext.  In 11.2.2, they
  talk about an Explicit Service Context, which is added as a
  parameter to the stub method signature.  Do we need to implement
  headers this way to be JAX-RPC compliant?

- Make sure you write up a section for the users guide and include that
  as part of the submit.  That way people will have something to reference.

- Make sure to include a functional test that verifies the feature.

Nit picking:
- Header and Headers aren't very good class names, too much alike. :-)
  How about Header and HeaderList?

- Look like you have tabs in some places, make sure you use spaces.

- Probably no need for the @author comment for methods (i.e. Service.java)

- Make sure you remove all the System.out.println() statements


I agree that we do not want these changes in for Beta 2, but I think
we should work to get them in shortly after B2 is release.

Thanks again for jumping in and helping out with this!

--
Tom Jordahl
Macromedia




-----Original Message-----
From: St-Germain, Sylvain [mailto:Sylvain.StGermain@cognos.com]
Sent: Monday, April 22, 2002 3:51 PM
To: Axis Dev (E-mail)
Subject: Client side soap:header support. 


Hi all, 

Here is some code that provide client side support for soap:header entry in
the WSDL operation binding.  

Modified files:
  xml-axis/java/src/org/apache/axis/client/Service.java
  xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
Added files:
  xml-axis/java/src/org/apache/axis/serviceContext/ServiceContext.java  
  xml-axis/java/src/org/apache/axis/serviceContext/HeaderKey.java
  xml-axis/java/src/org/apache/axis/wsdl/toJava/Headers.java
  xml-axis/java/src/org/apache/axis/wsdl/toJava/Header.java

>From a high level point of view:

1 - WSDL2Java now adds the appropriate setHeader() before call.invoke() as
well as the appropriate updateHeader() following call.invoke()

2 - I have added a ServiceContext class stored in the Service that currently
simply stores a Hashtable of all the service's header.  The key to the hash
is a HeaderKey (which could/should (not sure) be replace by a String if
someone can confirm that the key to a header is the part name...)  I did
create HeaderKey because originaly I was using the combination of the part
and the message to find a Header in the ServiceContext hash.

I believe that this will not make its way into the build before Beta-2
(right?) so I am sending it to get feedback, let me know if my understanding
of soap:header is right and what should be changed may this be the case.

To try it simply have some entry like this in your input operation :
<soap:header required="false" message="tns:tracking" part="tracking"
use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>

--
Sylvain

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.
          

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

Mime
View raw message