You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by MrNinni <mm...@sardegnait.it> on 2009/01/21 15:50:39 UTC

http-consumer doesn't speak with http-provider

Hi,
I'm a novice, sorry for my bad english.
I wish create two services, one published in the http-consumer and one
published in the http-provider.
The first service has a client in order to insert the name.

public class MyClass1 {
   public String myMethod1 (String name1) {
       return "Hello1"+name;
   }
}

public class MyClass2 {
   public String myMethod2 (String name2) {
       return "Hello2"+name;
   }
}

I wish send the name1 at the ServiceMix, the ServiceMix sends it at the
second service that adds "Hello2", and returns the String at the client that
display the final String.
The two methods have two name-methods different, and the ServiceMix doesn't
find the second method, because tries the method "myMethod1".
How do I do?
Thank you.
-- 
View this message in context: http://www.nabble.com/http-consumer-doesn%27t-speak-with-http-provider-tp21584624p21584624.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: http-consumer doesn't speak with http-provider

Posted by MrNinni <mm...@sardegnait.it>.
Thank you very much for your fast reply.
Unfortunately i did not understand the method you are suggested,
maybe because of my lack of knowledge on servicemix and jbi components...

I have these 2 xbeans:

consumer (called by a MyClass1 Client mock)

  <http:endpoint service="test:Consumer"
                 endpoint="myConsumer"
                 role="consumer" 
                 locationURI="http://localhost:8091/services/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
				 targetService="test:Provider1"
                 targetEndpoint="myProvider" 
				 wsdlResource="classpath:MyClass1.wsdl"
                 soap="true" /> 
				 
Provider (calls the actual service exposed by MyClass2 on an external tomcat
server)

  <http:endpoint service="test:Provider1"
                 endpoint="myProvider1"
                 role="provider" 
                 locationURI="http://localhost:8080/services/MyClass2"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
				 wsdlResource="http://localhost:8080/services/MyClass2?wsdl"
                 soap="true" /> 
				 

The MyClass1 client calls a method myMethod1(String name1) to the esb
consumer
that should transform the call to the actual method myMethod2(String name2).
Indeed the soap reply (caugth by tcpmon) is the one below:


<soapenv:Fault>
	<faultcode
xmlns:ns1="http://www.w3.org/2003/05/soap-rpc">ns1:ProcedureNotPresent</faultcode>
		<faultstring>No such operation 'myMethod1'</faultstring>
			<detail>
				<ns2:hostname
xmlns:ns2="http://xml.apache.org/axis/">mrninni-pc</ns2:hostname>
			</detail>
</soapenv:Fault>

You said that what i wish to do cannot be done unless i put one or more SE
in the middle of the communication? 
Since i am newbie, can you show me how this can be done, or point me to a
similar tutorial / book / article (anything!! :D  )?
Unfortunately servicemix documentation is way too criptic!
Thank you so much.


Jean-Baptiste Onofré wrote:
> 
> Hi,
> 
> HTTP is a BindingComponent : it allows the mediation with transport
> protocol.
> But it's not responsible of the operation.
> You need a ServiceEngine that implement your process logic.
> 
> In the same SA, you can have :
> - One CXF-SE SU based on MyClass1 (POJO)
> - One CXF-SE SU based on MyClass2 (POJO)
> - One HTTP consumer linked with MyClass1
> - One HTTP producer linked with MyClass2
> 
> Using only HTTP, you can make a kind of "bridge" between the producer and
> the
> consumer.
> 
> Regards
> JB
> 
> On Wednesday 21 January 2009 - 06:50, MrNinni wrote:
>> 
>> Hi,
>> I'm a novice, sorry for my bad english.
>> I wish create two services, one published in the http-consumer and one
>> published in the http-provider.
>> The first service has a client in order to insert the name.
>> 
>> public class MyClass1 {
>>    public String myMethod1 (String name1) {
>>        return "Hello1"+name;
>>    }
>> }
>> 
>> public class MyClass2 {
>>    public String myMethod2 (String name2) {
>>        return "Hello2"+name;
>>    }
>> }
>> 
>> I wish send the name1 at the ServiceMix, the ServiceMix sends it at the
>> second service that adds "Hello2", and returns the String at the client
>> that
>> display the final String.
>> The two methods have two name-methods different, and the ServiceMix
>> doesn't
>> find the second method, because tries the method "myMethod1".
>> How do I do?
>> Thank you.
>> -- 
>> View this message in context:
>> http://www.nabble.com/http-consumer-doesn%27t-speak-with-http-provider-tp21584624p21584624.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>> 
> 
> -- 
> Jean-Baptiste Onofré (Nanthrax)
> BuildProcess/AutoDeploy Project Leader
> http://buildprocess.sourceforge.net
> jb@nanthrax.net
> PGP : 17D4F086
> 
> 

-- 
View this message in context: http://www.nabble.com/http-consumer-doesn%27t-speak-with-http-provider-tp21584624p21586018.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: http-consumer doesn't speak with http-provider

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

HTTP is a BindingComponent : it allows the mediation with transport protocol.
But it's not responsible of the operation.
You need a ServiceEngine that implement your process logic.

In the same SA, you can have :
- One CXF-SE SU based on MyClass1 (POJO)
- One CXF-SE SU based on MyClass2 (POJO)
- One HTTP consumer linked with MyClass1
- One HTTP producer linked with MyClass2

Using only HTTP, you can make a kind of "bridge" between the producer and the
consumer.

Regards
JB

On Wednesday 21 January 2009 - 06:50, MrNinni wrote:
> 
> Hi,
> I'm a novice, sorry for my bad english.
> I wish create two services, one published in the http-consumer and one
> published in the http-provider.
> The first service has a client in order to insert the name.
> 
> public class MyClass1 {
>    public String myMethod1 (String name1) {
>        return "Hello1"+name;
>    }
> }
> 
> public class MyClass2 {
>    public String myMethod2 (String name2) {
>        return "Hello2"+name;
>    }
> }
> 
> I wish send the name1 at the ServiceMix, the ServiceMix sends it at the
> second service that adds "Hello2", and returns the String at the client that
> display the final String.
> The two methods have two name-methods different, and the ServiceMix doesn't
> find the second method, because tries the method "myMethod1".
> How do I do?
> Thank you.
> -- 
> View this message in context: http://www.nabble.com/http-consumer-doesn%27t-speak-with-http-provider-tp21584624p21584624.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> 

-- 
Jean-Baptiste Onofré (Nanthrax)
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net
jb@nanthrax.net
PGP : 17D4F086