You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Ilya Kuleshov <ik...@naumen.ru> on 2006/02/09 17:59:10 UTC

one more routing problem

Hi!

I've  got  a  simple  task:  an  inbound SOAP message should be routed
depending on the value of it's wsa:to header. I tried the following
(with 3.0 snapshot and 2.0.2):

1) connected HttpSoapConnector with GroovyComponent. I expect to
find message's headers in NormalizedMessage's properties or at least
in the DOM tree generated from the inbound SOAP message. But it seems
that HttpSoapConnector swallows all SOAP headers and puts only the
message body to the NormalizedMessage. Properties of resulting
NormalizedMessage are empty.

2) connected HttpConnector/HttpSoapConnector to XsltComponent. Then it appeared that
jbi:forward xslt directive does not work (this issue has been reported
in
http://mail-archives.apache.org/mod_mbox/geronimo-servicemix-users/200602.mbox/%3c61DA7719C45FD31185280008C733EF6E068FED95@XCHANGE%3e
and
http://mail-archives.apache.org/mod_mbox/geronimo-servicemix-users/200601.mbox/%3cLPEOJDIOPIBDEGAJOFOOAECNCOAA.scott@theryansplace.com%3e
).

I feel myself stuck. Is there someone who made jbi:forward work?





Re[3]: one more routing problem

Posted by Ilya Kuleshov <ik...@naumen.ru>.
It appeared that I just forgot to add soap="true" attribute to endpoint
definition. Now http-component seems to handle wsa:To as expected. Thanks!

IK> Thanks, SM now starts perfectly. I used configuration from
IK> servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml
IK> and tried to send the message
IK> servicemix-http/src/test/resources/org/apache/servicemix/http/addressing-request.xml
IK> to  http://localhost:8192/Service/.
IK> It works. However it returns the same result regardless of the wsa:To
IK> header value. I get echo even without any headers. Maybe I've used the
IK> wrong URL to send the SOAP message?




Re[2]: one more routing problem

Posted by Ilya Kuleshov <ik...@naumen.ru>.
Hi, Guillaume!

Thanks, SM now starts perfectly. I used configuration from
servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml
and tried to send the message
servicemix-http/src/test/resources/org/apache/servicemix/http/addressing-request.xml
to  http://localhost:8192/Service/.
It works. However it returns the same result regardless of the wsa:To
header value. I get echo even without any headers. Maybe I've used the
wrong URL to send the SOAP message?

GN> Yes, I should have explained that in more details, sorry.

GN> Dropping the jbi component installer in the install directory, will install
GN> the http component as a standard jbi component.  You can then use it
GN> to deploy service units.  But if you want to use it in the servicemix.xml
GN> configuration file, you have to copy the
GN> servicemix-http-3.0-SNAPSHOT.jar
GN> file in the lib directory of your ServiceMix installation.
GN> You can find this jar inside the servicemix-http installer zip.

GN> This is due to the fact that when you "really" install the component,
GN> ServiceMix
GN> creates a classloader for this component, and so the component is not
GN> available
GN> in the classloader of the container.  Not sure I'm very clear ...

GN> Cheers,
GN> Guillaume Nodet

GN> Ilya Kuleshov wrote:

>>wow, HttpComponent seems to be very promising, but when I start
>>servicemix with configuration from the
>>
>>servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml
>>
>>with servicemix-http-3.0-SNAPSHOT.zip in my 'install' directory,
>>
>>then all I get is
>>
>>Caught: org.springframework.beans.factory.BeanCreationException: Error
>>creating bean with name 'jbi' defined in file
>>[/home/users/ikuleshov/src/ESB/servicemix-3.0-SNAPSHOT/examples/test/servicemix.xml]:
>>Initialization of bean failed; nested exception is
>>java.lang.IllegalArgumentException:
>>Component name: ID:devel-33294-1139504503425-0:0 is bound to an
>>object which is not a JBI component, it is of type:
>>javax.xml.namespace.QName
>>        at
>> org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:824)
>>        at
>> org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:66)
>>
>>
>>According to the log messages, servicemix-http component has been
>>installed correctly, but what should be in servicemix.xml?
>>
>>  
>>
>>>>I've  got  a  simple  task:  an  inbound SOAP message should be routed
>>>>depending on the value of it's wsa:to header. I tried the following
>>>>(with 3.0 snapshot and 2.0.2):
>>>>
>>>>1) connected HttpSoapConnector with GroovyComponent. I expect to
>>>>find message's headers in NormalizedMessage's properties or at least
>>>>in the DOM tree generated from the inbound SOAP message. But it seems
>>>>that HttpSoapConnector swallows all SOAP headers and puts only the
>>>>message body to the NormalizedMessage. Properties of resulting
>>>>NormalizedMessage are empty.
>>>> 
>>>>
>>>>      
>>>>
>>GN> The HttpSoapConnector is really simplistic with respect to SOAP processing
>>GN> (as you have seen, nothing is done).  You should consider trying to
>>GN> servicemix-http component
>>GN> which handles wsa:To header to select the target jbi service. You can
>>GN> use it with service units
>>GN> (wsdl or xml deployment) or in a servicemix.xml config file (see [1]).



Re: one more routing problem

Posted by Guillaume Nodet <gu...@worldonline.fr>.
Yes, I should have explained that in more details, sorry.

Dropping the jbi component installer in the install directory, will install
the http component as a standard jbi component.  You can then use it
to deploy service units.  But if you want to use it in the servicemix.xml
configuration file, you have to copy the servicemix-http-3.0-SNAPSHOT.jar
file in the lib directory of your ServiceMix installation.
You can find this jar inside the servicemix-http installer zip.

This is due to the fact that when you "really" install the component, 
ServiceMix
creates a classloader for this component, and so the component is not 
available
in the classloader of the container.  Not sure I'm very clear ...

Cheers,
Guillaume Nodet

Ilya Kuleshov wrote:

>Hi, Guillaume!
>
>wow, HttpComponent seems to be very promising, but when I start
>servicemix with configuration from the
>
>servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml
>
>with servicemix-http-3.0-SNAPSHOT.zip in my 'install' directory,
>
>then all I get is
>
>Caught: org.springframework.beans.factory.BeanCreationException: Error
>creating bean with name 'jbi' defined in file
>[/home/users/ikuleshov/src/ESB/servicemix-3.0-SNAPSHOT/examples/test/servicemix.xml]:
>Initialization of bean failed; nested exception is java.lang.IllegalArgumentException:
>Component name: ID:devel-33294-1139504503425-0:0 is bound to an object which is not a JBI component, it is of type: javax.xml.namespace.QName
>        at org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:824)
>        at org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:66)
>
>
>According to the log messages, servicemix-http component has been
>installed correctly, but what should be in servicemix.xml?
>
>  
>
>>>I've  got  a  simple  task:  an  inbound SOAP message should be routed
>>>depending on the value of it's wsa:to header. I tried the following
>>>(with 3.0 snapshot and 2.0.2):
>>>
>>>1) connected HttpSoapConnector with GroovyComponent. I expect to
>>>find message's headers in NormalizedMessage's properties or at least
>>>in the DOM tree generated from the inbound SOAP message. But it seems
>>>that HttpSoapConnector swallows all SOAP headers and puts only the
>>>message body to the NormalizedMessage. Properties of resulting
>>>NormalizedMessage are empty.
>>> 
>>>
>>>      
>>>
>GN> The HttpSoapConnector is really simplistic with respect to SOAP processing
>GN> (as you have seen, nothing is done).  You should consider trying to
>GN> servicemix-http component
>GN> which handles wsa:To header to select the target jbi service. You can
>GN> use it with service units
>GN> (wsdl or xml deployment) or in a servicemix.xml config file (see [1]).
>
>
>
>
>
>  
>


Re[2]: one more routing problem

Posted by Ilya Kuleshov <ik...@naumen.ru>.
Hi, Guillaume!

wow, HttpComponent seems to be very promising, but when I start
servicemix with configuration from the

servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml

with servicemix-http-3.0-SNAPSHOT.zip in my 'install' directory,

then all I get is

Caught: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'jbi' defined in file
[/home/users/ikuleshov/src/ESB/servicemix-3.0-SNAPSHOT/examples/test/servicemix.xml]:
Initialization of bean failed; nested exception is java.lang.IllegalArgumentException:
Component name: ID:devel-33294-1139504503425-0:0 is bound to an object which is not a JBI component, it is of type: javax.xml.namespace.QName
        at org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:824)
        at org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:66)


According to the log messages, servicemix-http component has been
installed correctly, but what should be in servicemix.xml?

>>I've  got  a  simple  task:  an  inbound SOAP message should be routed
>>depending on the value of it's wsa:to header. I tried the following
>>(with 3.0 snapshot and 2.0.2):
>>
>>1) connected HttpSoapConnector with GroovyComponent. I expect to
>>find message's headers in NormalizedMessage's properties or at least
>>in the DOM tree generated from the inbound SOAP message. But it seems
>>that HttpSoapConnector swallows all SOAP headers and puts only the
>>message body to the NormalizedMessage. Properties of resulting
>>NormalizedMessage are empty.
>>  
>>
GN> The HttpSoapConnector is really simplistic with respect to SOAP processing
GN> (as you have seen, nothing is done).  You should consider trying to
GN> servicemix-http component
GN> which handles wsa:To header to select the target jbi service. You can
GN> use it with service units
GN> (wsdl or xml deployment) or in a servicemix.xml config file (see [1]).




Re: one more routing problem

Posted by Guillaume Nodet <gu...@worldonline.fr>.
Ilya Kuleshov wrote:

>Hi!
>
>I've  got  a  simple  task:  an  inbound SOAP message should be routed
>depending on the value of it's wsa:to header. I tried the following
>(with 3.0 snapshot and 2.0.2):
>
>1) connected HttpSoapConnector with GroovyComponent. I expect to
>find message's headers in NormalizedMessage's properties or at least
>in the DOM tree generated from the inbound SOAP message. But it seems
>that HttpSoapConnector swallows all SOAP headers and puts only the
>message body to the NormalizedMessage. Properties of resulting
>NormalizedMessage are empty.
>  
>
The HttpSoapConnector is really simplistic with respect to SOAP processing
(as you have seen, nothing is done).  You should consider trying to 
servicemix-http component
which handles wsa:To header to select the target jbi service. You can 
use it with service units
(wsdl or xml deployment) or in a servicemix.xml config file (see [1]).

Btw, if you want the whole soap request in the jbi exchange, you should 
use the
HttpConnector instead of the HttpSoapConnector.  The main purpose of the 
HttpSoapConnector
is to remove the soap envelope...

>2) connected HttpConnector/HttpSoapConnector to XsltComponent. Then it appeared that
>jbi:forward xslt directive does not work (this issue has been reported
>in
>http://mail-archives.apache.org/mod_mbox/geronimo-servicemix-users/200602.mbox/%3c61DA7719C45FD31185280008C733EF6E068FED95@XCHANGE%3e
>and
>http://mail-archives.apache.org/mod_mbox/geronimo-servicemix-users/200601.mbox/%3cLPEOJDIOPIBDEGAJOFOOAECNCOAA.scott@theryansplace.com%3e
>).
>
>I feel myself stuck. Is there someone who made jbi:forward work?
>  
>
I've just checked the forward stuff.  We have some test cases and they pass.
I think the main problem is that the xslt router does not really handle 
in-out mep at the moment.
I 've just raised  a jira about that 
http://jira.activemq.org/jira/browse/SM-300

Cheers,
Guillaume Nodet

>
>
>
>
>
>  
>