L.S., Good to see you got this working! One clarification on your doubts with the service/endpoint. A service can have multiple endpoints and an endpoint is only unique when specified together with a service, so that's why you always have to specify a targetService together with a targetEndpoint. On the Camel side, the matching URI that specifies the endpoint is jbi:endpoint:http://www.servicemix.org/example/my-service-camel/endpoint.
Don't hestitate to contact us again if you run into any more problems... Regards, Gert Vanthienen ------------------------ Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/5/28 Fly13DW <[email protected]>: > > > This is working. Here are the changes I've made: > > For the java file : > from("jbi:service:http://www.servicemix.org/example/my-service-camel").to("log:tutorial"); > -- You shall not use the endpoint otherwise there will be an error about the > service that is unused (see previous post) > > for the http-su xbean : > <beans xmlns:http="http://servicemix.apache.org/http/1.0" > xmlns:myService="http://www.servicemix.org/example"> > <http:consumer service="myService:my-service-http" > endpoint="endpoint" > targetService="myService:my-service-camel" > locationURI="http://0.0.0.0:8192/example" > defaultMep="http://www.w3.org/2004/08/wsdl/in-out" > /> > </beans> > -- No need to define the targetEndpoint, otherwise there will be a warning > in servicemix (telling that:Target service > ({http://www.servicemix.org/example}my-service-camel) and endpoint > (endpoint) specified, but no matching endpoint found. Only the service will > be used for routing.) > > and there it is : the adress shall be like jbi:service:${targetService} > > To test the application, I am using the html page provided in the wsdl-first > example, pointing to "http://localhost:8192/example" > Hoping I'm not posting too much... > > Again, thank you for the help you provided :) > > I have cxf left to do. I'll let you know and post my code. > > Regards, > Cedric > > > Fly13DW wrote: >> >> After some tries it seems to me that the servicemix-http consumer requires >> a targetService. But I don't know how to define the service for the camel >> component (can't find it in the xsd definition...). >> >> -- I say that because I have an error when I don't precise the >> targetService for the servicemix-http >> (javax.jbi.management.DeploymentException: targetInterface, targetService >> or targetUri should be specified). >> >> >> >> Fly13DW wrote: >>> >>> Thank you for your help. It is not exactly right but it helped me to see >>> where was my mistake. >>> from("jbi:myService/my-service-http-endpoint").to("log:in_message"); >>> isn't working. >>> >>> I just mess up when I post the content of the xbean.xml from in-http-bc >>> (1b). My file is: >>> <beans xmlns:http="http://servicemix.apache.org/http/1.0" >>> xmlns:myService="http://www.servicemix.org/example"> >>> <http:consumer service="myService:my-service-http" >>> endpoint="myService:my-service-http-endpoint" >>> targetService="myService/my-service-camel" >>> targetEndpoint="camel-in" >>> locationURI="http://0.0.0.0:8192/example" >>> defaultMep="http://www.w3.org/2004/08/wsdl/in-out" >>> /> >>> </beans> >>> >>> Here is something I don't understand: if I want to create a jbi route >>> from the consumer. >>> <My_supposition> >>> To me, the message is coming from the external world to >>> "http://0.0.0.0:8192/example", using the endpoint >>> "myService:my-service-http-endpoint" and the service >>> "myService:my-service-http". >>> Then, once received by HTTP SU, it is send to the targetService >>> "myService/my-service-camel" throught the endpoint "camel-in". >>> So camel-in should be the name of the endpoint used for camel SU entry, >>> and myService/my-service-camel his service. >>> </My_supposition> >>> Is this supposition right? >>> >>> it seems to work when I put : >>> from("jbi:service:myService/my-service-http").to("log:tutorial"); >>> but an error is traced in servicemix console : >>> WARN - HttpComponent - Target service >>> (myService/my-service-camel) and endpoint (camel-in) specified, but no >>> matching endpoint found. Only the service will be used for routing. >>> WARN - DefaultBroker - ServiceName >>> (myService/my-service-camel) specified for routing, but can't find it >>> registered >>> >>> Can you help me understanding what is the comportment of this http >>> consumer? >>> >>> >>> >>> Jean-Baptiste Onofré wrote: >>>> >>>> Hi, >>>> >>>> Answer in line: >>>> >>>>> 1) the http su: >>>>> I used this tutorial >>>>> (http://cwiki.apache.org/SM/704-intermediate-configuring-the-http-consumer-su.html) >>>>> 1a) I change the name in the pom.xml to "Wsdl distant :: IN HTTP SU" >>>>> and add >>>>> the dependency: >>>>> <dependency> >>>>> <groupId>org.apache.servicemix</groupId> >>>>> <artifactId>servicemix-core</artifactId> >>>>> <version>${servicemix-version}</version> >>>>> </dependency> >>>> >>>> Be careful, if you want to use the HTTP component, you need to add the >>>> servicemix-http dependency in your pom.xml like this: >>>> <dependency> >>>> <groupId>org.apache.servicemix</groupId> >>>> <artifactId>servicemix-http</artifactId> >>>> <version>2009.01</version> >>>> </dependency> >>>> >>>> Basicly, you don't need the servicemix-core dependency in your SU. >>>> >>>>> >>>>> 1b) And then I set the xbean.xml to: >>>>> <beans xmlns:http="http://servicemix.apache.org/http/1.0" >>>>> xmlns:ex="http://www.servicemix.org/example"> >>>>> >>>>> <http:endpoint service="myService:my-service-http" >>>>> endpoint="myService:my-service-http-endpoint" >>>>> targetService="myService:my-service-camel" >>>>> targetEndpoint="camel-in" >>>>> locationURI="http://0.0.0.0:8181/myService" /> >>>>> >>>>> </beans> >>>>> >>>>> by the way, I have a question in my mind : >>>>> 1c) what is the difference between http:endpoint and http:consumer ? (I >>>>> tried to use http:endpoint but it wasn't working) >>>> >>>> The HTTP component supports two kinds of endpoint: the old fashion and >>>> the new one. >>>> >>>> The old fashion uses the http:endpoint notation and the component role >>>> is defined using the role attribute (consumer or provider). You can find >>>> the old fashion documentation here: >>>> http://servicemix.apache.org/servicemix-http.html. >>>> This usage should be deprecated soon. >>>> >>>> On the other hand, the new fashion uses http:consumer and http:provider >>>> notation and define the component role. >>>> You can find the new fashion documentation here: >>>> http://servicemix.apache.org/servicemix-http-new-endpoints.html. >>>> >>>> In your case, I think that the usage of the http:endpoint is not correct >>>> as you haven't define the role attribute. >>>> >>>>> >>>>> ------------------------------------------------------------ >>>>> >>>>> 2) the camel se: >>>>> I used this tutorial >>>>> (http://servicemix.apache.org/32-using-the-camel-java-dsl-for-the-first-time.html) >>>>> 2a) I change the name in the pom.xml to "Wsdl distant :: CAMEL SE SU" >>>>> 2b) I change the camel-context.xml with : >>>>> <camelContext id="camel" >>>>> xmlns="http://activemq.apache.org/camel/schema/spring"> >>>>> <package>org.apache.servicemix.test3</package> >>>>> </camelContext> >>>>> 2c) I change the org.apache.servicemix.test3.MyRouteBuilder.java >>>>> I add the line from("ex:httphandler").to("log:tutorial"); in the >>>>> configure >>>>> method (just to test the two components) >>>>> >>>>> ------------------------------------------------------------ >>>>> >>>>> 3a) I create the Service assembly >>>>> TestWsdlDistant3> mvn archetype:create >>>>> -DarchetypeArtifactId=servicemix-service-assembly >>>>> -DarchetypeGroupId=org.apache.servicemix.tooling >>>>> -DartifactId=wsdl-distant-sa >>>>> 3b) I add the http and camel SU dependencies in the pom.xml file >>>>> <dependency> >>>>> <groupId>org.apache.servicemix.test3</groupId> >>>>> <artifactId>in-http-bc</artifactId> >>>>> <version>1.0-SNAPSHOT</version> >>>>> </dependency> >>>>> <dependency> >>>>> <groupId>org.apache.servicemix.test3</groupId> >>>>> <artifactId>camel-su</artifactId> >>>>> <version>1.0-SNAPSHOT</version> >>>>> </dependency> >>>>> >>>> Be careful, in the camel se doesn't need to have your http SU in >>>> dependency. The routing between the Camel SE and the HTTP BC will be >>>> made by the container (SMX) using JBI routing. >>>> >>>>> ------------------------------------------------------------ >>>>> >>>>> I run mvn install and I try to deploy the application >>>>> >>>>> I had the following error at deployment: >>>>> org.apache.camel.NoSuchEndpointException: No endpoint could be found >>>>> for: >>>>> ex:httphandler >>>>> >>>>> So I tryed to add >>>>> xmlns:ex="http://www.servicemix.org/example" >>>>> in the camel-context (2b) either in the bean and the camelContext >>>>> elements >>>>> but it didn't work. >>>>> Then, reading some topics, I tried to add the HTTP dependency into the >>>>> camel >>>>> pom.xml (2a). didn't work neither. >>>>> >>>>> I saw that you were talking about classpath definition but I just can't >>>>> figure out: >>>>> How (meaning when) can I indicate the "ex:httphandler" import for camel >>>>> SU? >>>>> >>>>> I hope I was clear... Thank you for you help >>>> >>>> In your case, you have defined a http endpoint (consumer) >>>> myService:my-service-http-endpoint. >>>> This endpoint is deployed into SMX as a JBI endpoint. >>>> >>>> Your Camel route should wait for message coming from this endpoint. So >>>> it should look like: >>>> from("jbi:myService/my-service-http-endpoint").to("log:in_message"); >>>> >>>> This route listens message coming from your HTTP endpoint (deployed into >>>> SMX as a JBI endpoint) and put this message into the in_message log. >>>> >>>> I hope it's clear :) >>>> >>>> Regards >>>> JB >>>> >>>>> >>>>> >>>>> the complete stackTrace is : >>>>> <loc-message>Could not deploy xbean service unit</loc-message> >>>>> </msg-loc-info> >>>>> </task-status-msg> >>>>> <exception-info> >>>>> <nesting-level>1</nesting-level> >>>>> <msg-loc-info> >>>>> <loc-token/> >>>>> <loc-message>No endpoint could >>>>> be >>>>> found for: ex:httphandler</loc-message> >>>>> >>>>> <stack-trace><![CDATA[org.apache.camel.NoSuchEndpointException: No >>>>> endpoint >>>>> could be found for: ex:httphandler >>>>> at >>>>> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54) >>>>> at >>>>> org.apache.camel.model.RouteType.resolveEndpoint(RouteType.java:100) >>>>> at >>>>> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:102) >>>>> at >>>>> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108) >>>>> at >>>>> org.apache.camel.model.FromType.resolveEndpoint(FromType.java:73) >>>>> at >>>>> org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:77) >>>>> at >>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:214) >>>>> at >>>>> org.apache.camel.model.RouteType.addRoutes(RouteType.java:90) >>>>> at >>>>> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:537) >>>>> at >>>>> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:529) >>>>> at >>>>> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:149) >>>>> at >>>>> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:47) >>>>> at >>>>> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103) >>>>> at >>>>> org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78) >>>>> at >>>>> org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49) >>>>> at >>>>> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76) >>>>> at >>>>> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275) >>>>> at >>>>> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:737) >>>>> at >>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:384) >>>>> at >>>>> org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:86) >>>>> at >>>>> org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:71) >>>>> at >>>>> org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88) >>>>> at >>>>> org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69) >>>>> at >>>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:667) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:631) >>>>> at java.util.TimerThread.mainLoop(Timer.java:512) >>>>> at java.util.TimerThread.run(Timer.java:462) >>>>> ]]></stack-trace> >>>>> </msg-loc-info> >>>>> </exception-info> >>>>> </task-result-details> >>>>> </component-task-result-details> >>>>> </component-task-result> >>>>> </jbi-task-result> >>>>> </jbi-task> >>>>> >>>>> at >>>>> org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:125) >>>>> at >>>>> org.apache.servicemix.jbi.framework.ManagementSupport.failure(ManagementSupport.java:111) >>>>> at >>>>> org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:543) >>>>> at >>>>> org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353) >>>>> ... 6 more >>>>> >>>>> >>>>> >>>>> >>>>> Fly13DW wrote: >>>>>> Thank you for your answer. >>>>>> >>>>>> I create the project as said in the tutorial: >>>>>>> mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling >>>>>>> -DarchetypeArtifactId=servicemix-project-root >>>>>>> -DgroupId=org.apache.servicemix.test3 -DartifactId=TestWsdlDistant3 >>>>>> ------------------------------------------------------------ >>>>>> >>>>>> Then I create a HTTP SU consumer into the new created folder: >>>>>> TestWsdlDistant3> mvn archetype:create >>>>>> -DarchetypeGroupId=org.apache.servicemix.tooling >>>>>> -DarchetypeArtifactId=servicemix-http-consumer-service-unit >>>>>> -DgroupId=org.apache.servicemix.test3 -DartifactId=in-http-bc >>>>>> the Camel SU (the SE, I think?): >>>>>> TestWsdlDistant3> mvn archetype:create >>>>>> -DarchetypeGroupId=org.apache.servicemix.tooling >>>>>> -DarchetypeArtifactId=servicemix-camel-service-unit >>>>>> -DgroupId=org.apache.servicemix.test3 -DartifactId=camel-su >>>>>> and finally the CXF SU provider: >>>>>> TestWsdlDistant3> mvn archetype:create >>>>>> -DarchetypeGroupId=org.apache.servicemix.tooling >>>>>> -DarchetypeArtifactId=servicemix-cxf-bc-service-unit >>>>>> -DgroupId=org.apache.servicemix.test3 -DartifactId=out-cxf-bc >>>>>> >>>>>> ------------------------------------------------------------ >>>>>> >>>>>> I try mvn install (just to see if everything is ok) >>>>>> >>>>>> I have a Build failed and these error messages : >>>>>> error: error reading >>>>>> D:\Users\itmaster\.m2\repository\org\springframework\spring-support\2.0.6\spring-support-2.0.6.jar; >>>>>> error in opening zip file >>>>>> error: error reading >>>>>> D:\Users\itmaster\.m2\repository\xerces\xerces\2.0.2\xerces-2.0.2.jar; >>>>>> error in opening zip file >>>>>> >>>>>> so I just try to delete these files and build again and I have the >>>>>> same >>>>>> error with another one: >>>>>> [INFO] Unable to find resource 'xerces:xerces:jar:2.0.2' in repository >>>>>> apache (http://people.apache.org/repo/m2-ibiblio-rsync-repository) >>>>>> Downloading: >>>>>> http://servicemix.org/m2-repo/xerces/xerces/2.0.2/xerces-2.0.2.jar >>>>>> 1K downloaded (spring-support-2.0.6.jar) >>>>>> 1K downloaded (xerces-2.0.2.jar) >>>>>> [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = >>>>>> '000fe85014f41d2570499c0f861c6e98665499ec'; remote = '<!-- >>>>>> >>>>>> top.location="http://servicemix.org/?fp=kXHnDH0xDZIfzlzX%2BEMg2aI8qPN9TqlzHEvrAIivMgIVV8vmkUBX4h5fLLjpt9HdKiETENFLeq7LkY2rrQCF2FHRwxbQ0JOI5XstHCqgtkjkneSsbkG9g5TREzkc6g28z%2B3I&cifr=1"; >>>>>> /* >>>>>> --> >>>>>> <script' - RETRYING >>>>>> Downloading: >>>>>> http://servicemix.org/m2-repo/org/springframework/spring-support/2.0.6/spring-support-2.0.6.jar >>>>>> [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = >>>>>> 'd8139c47cb24b298407e36191473fa0a5ab8bbdd'; remote = '<!-- >>>>>> >>>>>> top.location="http://servicemix.org/?fp=kXHnDH0xDZIfzlzX%2BEMg2aI8qPN9TqlzHEvrAIivMgG0LVtTK53YbqdD8EHCEuJyd%2BkjnjI2WBtsvlBX76VzTsAnUF%2FzL%2BaLUNTBFrTXZaMDt3sXM13kSMp4Y56EJ3DCJUDA&cifr=1"; >>>>>> /* >>>>>> --> >>>>>> <script' - RETRYING >>>>>> Downloading: >>>>>> http://servicemix.org/m2-repo/xerces/xerces/2.0.2/xerces-2.0.2.jar >>>>>> 1K downloaded (spring-support-2.0.6.jar) >>>>>> 1K downloaded (xerces-2.0.2.jar) >>>>>> [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = >>>>>> 'f080208aea8ead70f558a477b75823eb2edf0528'; remote = '<!-- >>>>>> >>>>>> top.location="http://servicemix.org/?fp=kXHnDH0xDZIfzlzX%2BEMg2aI8qPN9TqlzHEvrAIivMgV6gYeVlYjq3NS%2BzAEK8w9wFtV%2FHPf%2BrPQZdHtrGqJHtifNu99Ejea0M8k2UkVu6zZn%2FCpaMZLYESTRe7Gfw%2FqxB90c&cifr=1"; >>>>>> /* >>>>>> --> >>>>>> <script' - IGNORING >>>>>> [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = >>>>>> '6bdc54056ba8980e25701c351629116897ace8ee'; remote = '<!-- >>>>>> >>>>>> top.location="http://servicemix.org/?fp=kXHnDH0xDZIfzlzX%2BEMg2aI8qPN9TqlzHEvrAIivMgRsfuksEv7MO3Rr1LS8rmxCcpQDTTFBgZnvXuESeWVrUW%2BLbGYnJsDy3WYHVnKIan6zcl7W08M%2Bmm6a3rJd0s20huUO&cifr=1"; >>>>>> /* >>>>>> --> >>>>>> <script' - IGNORING >>>>>> >>>>>> (and the same for spring-support). >>>>>> I think this means that the source is not available. >>>>>> Do I have to modify some configuration (resource server)? >>>>>> Does someone have a hint? >>>>>> >>>>>> Regards, >>>>>> Cedric >>>>>> >>>>>> >>>>>> >>>>>> Gert Vanthienen wrote: >>>>>>> L.S., >>>>>>> >>>>>>> First of all, welcome to ServiceMix! ;) >>>>>>> >>>>>>> If you want to receive the non-soap XML message using a HTTP POST, an >>>>>>> HTTP consumer endpoint would be the ideal solution there. For >>>>>>> invoking the external endpoint, you could use an HTTP provider >>>>>>> endpoint but we would generally recommend using the servicemix-cxfbc, >>>>>>> because it is specifically geared towards dealing with web services. >>>>>>> >>>>>>> Once you have these two set up, you could actually choose any >>>>>>> component that best suits your needs : servicemix-bean if you want to >>>>>>> use a POJO, servicemix-saxon if you are going for XSL, ... My >>>>>>> personal favorite/recommendation would be to use Camel inbetween the >>>>>>> two endpoints: it has excellent EIP and POJO support and there are >>>>>>> components available for XSL, EL, ... to help you build the >>>>>>> transformations. >>>>>>> >>>>>>> So in a nutshell, I think the best solution for you would be: >>>>>>> HTTP consumer -> Camel route -> CXF provider >>>>>>> >>>>>>> Regards, >>>>>>> >>>>>>> Gert Vanthienen >>>>>>> ------------------------ >>>>>>> Open Source SOA: http://fusesource.com >>>>>>> Blog: http://gertvanthienen.blogspot.com/ >>>>>>> >>>>>>> >>>>>>> >>>>>>> 2009/5/27 Fly13DW <[email protected]>: >>>>>>>> Hello, >>>>>>>> >>>>>>>> I'm new with Apache ServiceMix, and I'm asking questions concerning >>>>>>>> the> >>>>>>>> architecture I should use. >>>>>>>> 1) I have a XML message as entry (no-SOAP) >>>>>>>> <message>msg</message> >>>>>>>> 2) This message has to be converted to be passed to an external Web >>>>>>>> Service, >>>>>>>> using SOAP. >>>>>>>> 3) The Web Service returns a SOAP message that has to be converted >>>>>>>> back >>>>>>>> to >>>>>>>> XML >>>>>>>> >>>>>>>> I thought I use the servicemix-http for the Binding Component (1), >>>>>>>> and >>>>>>>> maybe >>>>>>>> the servicemix-jsr181 (2). >>>>>>>> My questions are : >>>>>>>> - do you think there is a better Binding Component (1) to do this >>>>>>>> job? >>>>>>>> - my servicemix-jsr181 will use a java pojo. Do I have to do a call >>>>>>>> to >>>>>>>> the >>>>>>>> Web Service in this implemented class, or should I use another >>>>>>>> architecture? >>>>>>>> >>>>>>>> thank you for your answers >>>>>>>> -- >>>>>>>> View this message in context: >>>>>>>> http://www.nabble.com/components-to-use-for-an-XML-to-SOAP-request-tp23745527p23745527.html >>>>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com. >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> ----- >>>>>>> --- >>>>>>> Gert Vanthienen >>>>>>> http://gertvanthienen.blogspot.com >>>>>>> >>>>>> >>>>> >>>> >>>> >>> >>> >> >> > > -- > View this message in context: > http://www.nabble.com/components-to-use-for-an-XML-to-SOAP-request-tp23745527p23765726.html > Sent from the ServiceMix - User mailing list archive at Nabble.com. > >
