cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Schneider Christian <Christian.Schnei...@enbw.com>
Subject AW: SOAP over JMS interceptor for adding JMS header properties
Date Fri, 29 Oct 2010 12:46:24 GMT
Hi Aleksandar,

I can already confirm SoapAction. We had the problem that cxf used SOAPAction and Tibco BW
did not undestand this.
The newer versions of BW  also work with SOAPAction. I am not aware of the Content_Type property.
I guess Tibco BW uses it like you described but we did not use it ourself. In our case the
content type implicitly always was UTF-8. I think you could probably also define it that way.

As far as I know the SOAP over JMS that Tibco does predates the SOAP over JMS standard and
so it is no wonder that they solved that differently. I also do not know if / when Tibco will
support the standard.

I have attached the interceptor we use to simply treat the message content as UTF-8. I am
not sure if this is still necessary with cxf but you can try it.

Best regards

Christian

Christian Schneider
Informationsverarbeitung 
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


---------------

/**
 * Treat message as UTF-8
 */
public class XMLInputInterceptor extends AbstractPhaseInterceptor<Message> {
    
    /**
     * Add interceptor to phase RECEIVE
     */
    public XMLInputInterceptor() {
        super(Phase.RECEIVE);
    }

    /**
     * Convert message to UTF-8
     */
    public void handleMessage(Message message) {
        try {
            InputStream inputStream = message.getContent(InputStream.class);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            while (true) {
                int ch = inputStream.read();
                if (ch == -1) {
                    break;
                }
                baos.write(ch);
            }
            String string = baos.toString();
            ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes("UTF-8"));
            message.setContent(InputStream.class, bais);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
---------------


-----Ursprüngliche Nachricht-----
Von: Aleksandar Valchev [mailto:aleksandar.valchev@gmail.com] 
Gesendet: Freitag, 29. Oktober 2010 13:43
An: users@cxf.apache.org
Betreff: Re: SOAP over JMS interceptor for adding JMS header properties

Christian,

I'm using TIBCO BusinessWorks 5.8. When TIBCO sends or receives JMS SOAP
messages, it uses JMS properties "Content_Type" and "SoapAction". In terms
of java this means:

javax.jms.Message msg:

msg.setStingProperty("Content_Type", ".....");
msg.setStingProperty("SoapAction", ".....");

According to SOAP over JMS specification and what CXF is doing:

msg.setStingProperty("SOAPJMS_contentType", ".....");
msg.setStingProperty("SOAPJMS_soapAction", ".....");

As an addtion, TIBCO BW doesn't send "SOAPJMS_requestURI".

Could you verfiy this in your BW environment?

P.S. In case of SOAP over HTTP, everything is OK.


On Fri, Oct 29, 2010 at 1:04 PM, Schneider Christian <
Christian.Schneider@enbw.com> wrote:

> Hi Aleksandar,
>
> could you go into more detail what you needed to do. We are also running
> Tibco Business Works together with CXF and did not have to change content
> type.
>
> We used bytes messages and made sure they always contain UTF-8 encoded
> data.
>
> Best Regards
>
> Christian
>
>
>
>
>
> Christian Schneider
> Informationsverarbeitung
> Business Solutions
> Handel und Dispatching
>
> Tel : +49-(0)721-63-15482
>
> EnBW Systeme Infrastruktur Support GmbH
> Sitz der Gesellschaft: Karlsruhe
> Handelsregister: Amtsgericht Mannheim ­ HRB 108550
> Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
> Geschäftsführer: Jochen Adenau, Hans-Günther Meier
>
>
> -----Ursprüngliche Nachricht-----
> Von: Aleksandar Valchev [mailto:aleksandar.valchev@gmail.com]
> Gesendet: Freitag, 29. Oktober 2010 12:18
> An: users@cxf.apache.org
> Betreff: Re: SOAP over JMS interceptor for adding JMS header properties
>
> Hi Christian,
>
> TibcoSoapActionInterceptor fixes only small part of SOAP JMS message
> exchange with TIBCO BusinessWorks.
>
> TIBCO BusinessWorks is not so compliant with SOAP over JMS standart and
> headers (for SOAP action and content type) must be changed. I almost solved
> the problem, but I need more tests.
>
> On Thu, Oct 28, 2010 at 4:38 PM, Schneider Christian <
> Christian.Schneider@enbw.com> wrote:
>
> > Hi Aleksandar,
> >
> > You should take a look at the issue Interceptor to work around SoapAction
> > bug in Tibco Business Works:
> > https://issues.apache.org/jira/browse/CXF-2612
> >
> >
> >
> http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/TibcoSoapActionInterceptor.java?view=markup&pathrev=897567
> >
> > In this issue I added an interceptor that allows to convert the
> SOAPAction
> > property into a SoapAction property that Tibco likes. So this could be an
> > ideal template for the interceptor you want to create.
> >
> > Best Regards
> >
> > Christian
> >
> >
> >
> > Christian Schneider
> > Informationsverarbeitung
> > Business Solutions
> > Handel und Dispatching
> >
> > Tel : +49-(0)721-63-15482
> >
> > EnBW Systeme Infrastruktur Support GmbH
> > Sitz der Gesellschaft: Karlsruhe
> > Handelsregister: Amtsgericht Mannheim ­ HRB 108550
> > Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
> > Geschäftsführer: Jochen Adenau, Hans-Günther Meier
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Aleksandar Valchev [mailto:aleksandar.valchev@gmail.com]
> > Gesendet: Donnerstag, 28. Oktober 2010 14:47
> > An: users@cxf.apache.org
> > Betreff: SOAP over JMS interceptor for adding JMS header properties
> >
> > Hi,
> >
> > I'm trying to use CXF client with TIBCO BW service (SOAP over JMS with
> > attachments). The problem is that against the SOAP over JMS
> specification,
> > TIBCO accepts the following JMS message properties:
> >
> > Content_Type
> > SoapAction
> >
> > I need to have interceptor for outgoing and incoming messages that.
> >
> > 1. In case of outgoing message (CXF is consumer and TIBCO is provider,
> > Request)
> >
> >  After CXF finishes with creating the JMS message, to add new header
> > "Content_Type" copy the value of "SOAPJMS_contentType" header to
> > "Content_Type".
> >
> > 2. In case of incoming message (CXF is consumer and TIBCO is provedier,
> > Response)
> >
> >  Before CXF do anything with the JMS message, to add new header
> > "SOAPJMS_contentType" and copy the contents of "Content_Type".
> >
> >
> > What I want to do is something like JMS properties tranlation in both
> > directions.
> >
> > I think that this could be achived with Interceptors, but I don't know in
> > which phase and after which interceptor I have to put them.
> >
> > Thanks.
> >
>

Mime
View raw message