You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Liav Ezer <li...@gmail.com> on 2009/01/25 16:43:24 UTC

Does http:consumer 'talk' to http:endpoint role='provider'?

Hi,

I have a working set of components: 1 http:endpoint role=consumer, 1 camel
with RouterBuilder & 1 http:endpoint role=provider.

I need to 'know' my 'from' end-point at run-time (at the Camel Builder
context), so i decided to add a Marshaller to the consumer end-point &
enrich the end-point's properties with its name.

My Problem:

For an HTTP Marshaller i need to convert my http endpoint consumer to be
from the new kind which is: http:consumer. And indeed i can deploy a
Marshaller. But my (old type) provider seems to be uncompliant with the xml
transmition now. I get the following exception:

Exception:

  fault: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://sche
ttp://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode
xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
   <faultstring>no SOAPAction header!</faultstring>
   <detail>
    <ns2:hostname
xmlns:ns2="http://xml.apache.org/axis/">LIAVE02</ns2:hostname>
   </detail>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>

Here is my consumer xbean:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0" 
       xmlns:con="http://con" 
       xmlns:oxp="http://oxp">

  <http:consumer service="con:PublicForecastWeatherService"
                 endpoint="PublicForecastWeather"  
                
locationURI="http://localhost:8192/oxp/services/internal/forecastWeather"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 targetService="oxp:oXpInternalService"
                 marshaler="#marshaler" /> 
      <bean id="marshaler" class="org.apache.servicemix.jbi.HTTPMarshaler"
/>
</beans>

Here is my proviser's xbean:

<beans xmlns:http="http://servicemix.apache.org/http/1.0"
xmlns:prd="http://prd">
  <http:provider service="prd:ForecastWeatherImpService"
                 endpoint="ForecastWeatherImp"
                
locationURI="http://localhost:8080/ForecasterService/services/ForecastWeatherImp"/> 
</beans>

Here is my routing logic in the Camel (via producerTemplate API)

private void routeMessage(Exchange exchange) throws
TransformerConfigurationException {
		ProducerTemplate<Exchange> serviceProducer =
exchange.getContext().createProducerTemplate();
		String targetEndpoint =
"jbi:service:http://prd/ForecastWeatherImpService";
		
		Endpoint serviceProviderEP =
exchange.getContext().getEndpoint(targetEndpoint);
		Exchange serviceProviderExchange =
serviceProviderEP.createExchange(ExchangePattern.InOut);
		

		serviceProviderExchange.setIn(exchange.getIn());
		// INVOKING THE PROVIDER'S SERVICE		
		Exchange serviceResultExchange = serviceProducer.send(serviceProviderEP,
serviceProviderExchange);
		
// HERE I SEND THE ANSWER FROM THE PROVIDER BACK TO THE CONSUMER	- DOESN'T
WORK	
		exchange.getOut().setBody(serviceResultExchange.getOut().getBody());
	}

Do i need to work with http-provider in order to be compliant with the new
consumer?

To be honest, i tried it & didn't get a response also...

Thanks for any tip,
Liav.
-- 
View this message in context: http://www.nabble.com/Does-http%3Aconsumer-%27talk%27-to-http%3Aendpoint-role%3D%27provider%27--tp21652891p21652891.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.