You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by nvijayak <nv...@cs.indiana.edu> on 2008/02/01 17:24:44 UTC

help with exposing a POJO as a web service

Hi all,

I have a POJO and I want to expose it as a web service. I have the
corresponding wsdl as well. I followed the example in 'Orchestration of
JSR181 services' and it works. In this I first have to generate the stubs
from my wsdl and then map the stub to the POJO. My question is can I expose
my POJO as a web service without manually mapping each stub?

I tried specifying just the POJO and wsdl without creating the service. I
can see the service deployed and pull up the wsdl. But when I issue a
request it fails with error in request.  I have checked my request with my
other service with stubs and it works correctly.  Is it possible to expose a
pojo with mapping each method?

My currentl config is as follows:

Jsr181-su xbean.xml

<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
  <jsr181:endpoint pojo="#calculator" 
              
wsdlResource="C:/Software/apache-servicemix-3.2.1/examples/calcws/calcws-jsr181-su/src/main/resources/service.wsdl" 
               annotations="none" 
               typeMapping="jaxb2" 
               style="document" /> 
  <bean id="calculator" class="test.calculator.CalculatorImpl" /> 
  </beans>

consumer-http-su xbean.xml


<beans xmlns:http="http://servicemix.apache.org/http/1.0"
       xmlns:calcws="http://servicemix.apache.org/test/calculator">
                 
  <http:endpoint service="calcws:CalculatorXXX"
                 endpoint="soap"
                 role="consumer" 
                 targetService="calcws:CalculatorXXX"                 
                 locationURI="http://localhost:8392/CalculatorXXX/"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 soap="true" />             

</beans>

Thanks,
Nithya
-- 
View this message in context: http://www.nabble.com/help-with-exposing-a-POJO-as-a-web-service-tp15229873s12049p15229873.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.