ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | celtix List | June 2006 Index

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

How do I get BindingOperation InputMessage name


Title: Can transport see the operation ?
Can I ask this question again, I didn't get an answer and it is the final missing link in my custom transport. I've tried searching the variables in the call stack when debugging the code but I can't find a mention of it (although having said that I can see where the METHOD_OBJ is either but the code gets it).
 
How do I get the name of the InputMessage and OutputMessage for the bindingOperation that I am using. I need this to pass to the getBindingOperation function.
 
I was assuming it was METHOD_MESSAGE and METHOD_RETURN but these return null.
 
My code looks like the following. I will replace obj & obj2 with meaningful names when I work out how to make it work. I can get the input and output message classes from the targetMethod but that is not what getBindingOperation requires.
 
        Method targetMethod = (Method)context.get(ObjectMessageContext.METHOD_OBJ);
        String methodName = "Unknown";
        if (targetMethod != null)
        {
            methodName = targetMethod.getName();
        }
        Object obj = context.get(ObjectMessageContext.METHOD_MESSAGE);
        Object obj2 = context.get(ObjectMessageContext.METHOD_RETURN);
       
        System.out.println("invoke: " + methodName);
 
        AddressType address = null;
 
        Port port;
        try
        {
            port = EndpointReferenceUtils.getPort(bus.getWSDLManager(), endpointRef);
        }
        catch (WSDLException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
 
            return null;
        }
 
        // see if the operation has an address defined
        Binding binding = port.getBinding();
        // TODO : fill in the InputMessage and OutputMessage names
        BindingOperation bindingOperation = binding.getBindingOperation(methodName, inputMessageNameoutputMessageName);
        @SuppressWarnings("unchecked")
        List<ExtensibilityElement> exts = bindingOperation.getExtensibilityElements();

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

 


From: Shaw, Richard A [mailto:richard.shaw@xxxxxxxxxxxxxxxx]
Sent: 20 June 2006 14:34
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] Can transport see the operation ?

I can now get the name of the operation but I can't extract the BindingOperation object because I need the name of the InputMessage and OutputMessage to pass into the getBindingOperation() function along with the method name.
 
I can't see where these are - I can get the class names but they don't necessarily match the message names. I was assuming that METHOD_MESSAGE and METHOD_RETURN might have been them but they return null.
 

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

 


From: Shaw, Richard A [mailto:richard.shaw@xxxxxxxxxxxxxxxx]
Sent: 20 June 2006 12:37
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] Can transport see the operation ?

Thanks, I was missing the bit that stores the context in my outputMessageContext.
 
I was extending the GenericMessageContext, I've now changed to extend the MessageContextWrapper and I've added super(context) to my constructor.
 
Thanks again.

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

 


From: Paibir, Ajay [mailto:ajay.paibir@xxxxxxxx]
Sent: 20 June 2006 12:13
To: celtix@xxxxxxxxxxxxx
Subject: RE: [celtix] Can transport see the operation ?

The operation name can be accessed by using the standard JAX-WS MessageContext.WSDL_OPERATION property. Also as per the spec it is not mandatory to set the property in the context.

However on looking through the Celtix Code the Transport context i.e OutputStreamMessageContext should have the property set.  While creating the transport Context using the ServerTransport.createOutputStreamContext(MessageContext bindingContext) the binding context is passed in.

Basically this binding context will have to be wrapped/copied into the output stream context of the FTP transport.

Regards

Ajay


From: Shaw, Richard A [mailto:richard.shaw@xxxxxxxxxxxxxxxx]
Sent: 20 June 2006 11:29
To: celtix@xxxxxxxxxxxxx
Subject: [celtix] Can transport see the operation ?

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.



This message has been scanned for viruses by MailControl

--
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.