ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | celtix List | June 2006 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [celtix] Can transport see the operation ?


Hi Richard,

I think you can get operation name from the transport by means of 

Method targetMethod =
(Method)context.get(ObjectMessageContext.METHOD_OBJ);
targetMethod.getName()

Here context is the OutputStreamMessageContext, it's the parameter of
invoke method of your client transport class.

Hopefully this can solve your problem.

Cheers.

Freeman 

On Tue, 2006-06-20 at 11:28 +0100, Shaw, Richard A wrote:
> In my custom transport which gets the response data from an FTP file
> (the one I posted a couple of weeks ago). I wanted to add extra
> support so that each operation could be configured in the WSDL to a
> different file.
> 
> My WSDL looks like this -
> 
>     <binding name="TrafficNewsISOAPBinding" type="tns:TrafficNewsI"> 
>         <xformat:binding/> 
>         <operation name="GetTrafficNews"> 
>             <soap:operation soapAction="" style="document"/> 
>             <input name="GetTrafficNews"> 
>                 <soap:body use="literal"/> 
>             </input> 
>             <output name="GetTrafficNewsResponse"> 
>                 <soap:body use="literal"/> 
>             </output> 
>         </operation> 
>     </binding> 
>     
>     <service name="TrafficNewsService"> 
>         <port binding="tns:TrafficNewsISOAPBinding"
> name="SOAPOverHTTP"> 
>                 <ftpfile:address
> location="ftp:///myserver/TrafficNews.XML"/> 
>         </port> 
>     </service>
> 
> So when I make a GetTrafficNews request the reply is the contents of
> the TrafficNews.xml file on my FTP server.
> 
> This is fine when my WSDL defines a single operation, but if there is
> more than one operation I want to define the following WSDL -
> 
>     <binding name="TrafficNewsISOAPBinding" type="tns:TrafficNewsI"> 
>         <xformat:binding/> 
>         <operation name="GetTrafficNews"> 
>             <soap:operation soapAction="" style="document"/> 
>                 <ftpfile:address
> location="ftp:///myserver/TrafficNews.XML"/> 
>             <input name="GetTrafficNews"> 
>                 <soap:body use="literal"/> 
>             </input> 
>             <output name="GetTrafficNewsResponse"> 
>                 <soap:body use="literal"/> 
>             </output> 
>         </operation> 
>         <operation name="GetTrafficSpeeds"> 
>             <soap:operation soapAction="" style="document"/> 
>                 <ftpfile:address
> location="ftp:///myserver/TrafficSpeeds.XML"/> 
>             <input name="GetTrafficSpeeds"> 
>                 <soap:body use="literal"/> 
>             </input> 
>             <output name="GetTrafficSpeedsResponse"> 
>                 <soap:body use="literal"/> 
>             </output> 
>         </operation> 
>     </binding> 
>     
>     <service name="TrafficNewsService"> 
>         <port binding="tns:TrafficNewsISOAPBinding"
> name="SOAPOverHTTP"> 
>                 <ftpfile:address
> location="ftp:///myserver/TrafficNews.XML"/> 
>         </port> 
>     </service>
> 
> So now if the operation has a file defined it gets the response from
> there, otherwise it uses the file defined in the port. GetTrafficNews
> reads from TrafficNews.xml and GetTrafficSpeeds reads from
> TrafficSpeeds.xml
> 
> My question is (finally) how can my transport work out what the
> operation is so that it can get the correct filename ? I want this to
> work with any binding (I've tested pure XML and SOAP), looking at the
> source code of Celtix it seems that transport doesn't have access to
> the binding context so it can't use it to query what the operation
> was. 
> 
> I did wonder if I should have used a handler instead because it has
> access to the LogicalMessageContext and can work out what the
> operation is and then get the response from the FTP server, but this
> isn't quite as neat, and is harder to configure for use. 
> 
> 
> Richard Shaw
> 
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
> 
> Richard Shaw   
> Technical Design Authority - Information Solutions Consultancy   
> Intelligent Transport Systems 
> 
> Atkins Highways and Transportation 
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
> 
> Tel: +44 (0) 1372 756407  
> Fax: +44 (0) 1372 740055 
> Mob: 07740 817586  
> E-mail: richard.shaw@xxxxxxxxxxxxxxxx
> 
> www.atkinsglobal.com/its
> 
> 
> 
>    This email and any attached files are confidential and copyright
>   protected. If you are not the addressee, any dissemination of this
>    communication is strictly prohibited. Unless otherwise expressly
>    agreed in writing, nothing stated in this communication shall be
>                            legally binding.
> 
> plain text document attachment (message-footer.txt)
> --
> You receive this message as a subscriber of the celtix@xxxxxxxxxxxxx 
> mailing list.
> To unsubscribe: mailto:celtix-unsubscribe@xxxxxxxxxxxxx
> For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.