You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by hiyer <iy...@hotmail.com> on 2006/08/08 21:39:40 UTC

Deploying multiple webservices with xfire binding

Hi,
I have multiple webservices for which I use xfire binding. 
1. Do I need to use multiple http bindings and multiple servlets to deploy
them as shown below? Is there a more concise configuration?
2. Using "org.apache.servicemix.components.xfire.XFireBinding" does not
diisplay the WSDL when invoking the servlet. We currently have a custom
implementation to do it. Is there any standard option?
Cheers,
Hari.
-----------------------springcontext-sm.xml--------------------------------
  <sm:container
  	id="jbi"
  	monitorInstallationDirectory="false">

    <sm:activationSpecs>
        <sm:activationSpec componentName="orderHttpBinding"
service="xfire:httpBinding" destinationService="xfire:OrderService">
		<sm:component>
  		   <bean class="org.apache.servicemix.components.http.HttpInOutBinding"
abstract="false" singleton="true" lazy-init="default" autowire="default"
dependency-check="default" /> 
  		</sm:component>
       </sm:activationSpec>
          
       <sm:activationSpec
            componentName="orderXFireBinding"
            service="xfire:OrderService">
            <sm:component>
               <bean class="com.company.servicemix.XFireBinding">
                   <property name="xfire" ref="xfire"/>
               </bean>
            </sm:component>
       </sm:activationSpec>

       <sm:activationSpec componentName="directoryHttpBinding"
service="xfire:httpBinding" destinationService="xfire:DirectoryService">
		<sm:component>
  		   <bean class="org.apache.servicemix.components.http.HttpInOutBinding"
abstract="false" singleton="true" lazy-init="default" autowire="default"
dependency-check="default" /> 
  		</sm:component>
  	  </sm:activationSpec>
          
       <sm:activationSpec
            componentName="directoryXFireBinding"
            service="xfire:DirectoryService">
            <sm:component>
               <bean class="com.company.servicemix.XFireBinding">
                   <property name="xfire" ref="xfire"/>
               </bean>
            </sm:component>
       </sm:activationSpec>
    </sm:activationSpecs>
  </sm:container>

----------------------WEB.xml---------------------------------
  <servlet>
    <servlet-name>OrderBindingServlet</servlet-name>
    <servlet-class>
      org.apache.servicemix.components.http.SpringBindingServlet
    </servlet-class>
    <init-param>
      <param-name>endpoint</param-name>
      <param-value>orderHttpBinding</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>OrderBindingServlet</servlet-name>
    <url-pattern>/jbi/OrderService/*</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>DirectoryBindingServlet</servlet-name>
    <servlet-class>
      org.apache.servicemix.components.http.SpringBindingServlet
    </servlet-class>
    <init-param>
      <param-name>endpoint</param-name>
      <param-value>directoryHttpBinding</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>DirectoryBindingServlet</servlet-name>
    <url-pattern>/jbi/DirectoryService/*</url-pattern>
  </servlet-mapping>

-- 
View this message in context: http://www.nabble.com/Deploying-multiple-webservices-with-xfire-binding-tf2074775.html#a5713547
Sent from the ServiceMix - User forum at Nabble.com.


Re: Deploying multiple webservices with xfire binding

Posted by Guillaume Nodet <gn...@gmail.com>.
I have recently update servicemix-web to use servicemix-http component in
managed mode.
In this case, you only need one servlet, and you need to define several http
consumer endpoint,
one for each service you want to expose through HTTP.

If you want WSDL support, you should take a look at the soap-binding (in
3.0-M2) or
wsdl-first demo (in svn head).  They use the jsr181 component (which
internally use
xfire) to expose a web service through soap (using servicemix-http).

On 8/8/06, hiyer <iy...@hotmail.com> wrote:
>
>
> Hi,
> I have multiple webservices for which I use xfire binding.
> 1. Do I need to use multiple http bindings and multiple servlets to deploy
> them as shown below? Is there a more concise configuration?
> 2. Using "org.apache.servicemix.components.xfire.XFireBinding" does not
> diisplay the WSDL when invoking the servlet. We currently have a custom
> implementation to do it. Is there any standard option?
> Cheers,
> Hari.
> -----------------------
> springcontext-sm.xml--------------------------------
>   <sm:container
>         id="jbi"
>         monitorInstallationDirectory="false">
>
>     <sm:activationSpecs>
>         <sm:activationSpec componentName="orderHttpBinding"
> service="xfire:httpBinding" destinationService="xfire:OrderService">
>                 <sm:component>
>                    <bean class="
> org.apache.servicemix.components.http.HttpInOutBinding"
> abstract="false" singleton="true" lazy-init="default" autowire="default"
> dependency-check="default" />
>                 </sm:component>
>        </sm:activationSpec>
>
>        <sm:activationSpec
>             componentName="orderXFireBinding"
>             service="xfire:OrderService">
>             <sm:component>
>                <bean class="com.company.servicemix.XFireBinding">
>                    <property name="xfire" ref="xfire"/>
>                </bean>
>             </sm:component>
>        </sm:activationSpec>
>
>        <sm:activationSpec componentName="directoryHttpBinding"
> service="xfire:httpBinding" destinationService="xfire:DirectoryService">
>                 <sm:component>
>                    <bean class="
> org.apache.servicemix.components.http.HttpInOutBinding"
> abstract="false" singleton="true" lazy-init="default" autowire="default"
> dependency-check="default" />
>                 </sm:component>
>           </sm:activationSpec>
>
>        <sm:activationSpec
>             componentName="directoryXFireBinding"
>             service="xfire:DirectoryService">
>             <sm:component>
>                <bean class="com.company.servicemix.XFireBinding">
>                    <property name="xfire" ref="xfire"/>
>                </bean>
>             </sm:component>
>        </sm:activationSpec>
>     </sm:activationSpecs>
>   </sm:container>
>
> ----------------------WEB.xml---------------------------------
>   <servlet>
>     <servlet-name>OrderBindingServlet</servlet-name>
>     <servlet-class>
>       org.apache.servicemix.components.http.SpringBindingServlet
>     </servlet-class>
>     <init-param>
>       <param-name>endpoint</param-name>
>       <param-value>orderHttpBinding</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>
>   <servlet-mapping>
>     <servlet-name>OrderBindingServlet</servlet-name>
>     <url-pattern>/jbi/OrderService/*</url-pattern>
>   </servlet-mapping>
>
>   <servlet>
>     <servlet-name>DirectoryBindingServlet</servlet-name>
>     <servlet-class>
>       org.apache.servicemix.components.http.SpringBindingServlet
>     </servlet-class>
>     <init-param>
>       <param-name>endpoint</param-name>
>       <param-value>directoryHttpBinding</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>
>   <servlet-mapping>
>     <servlet-name>DirectoryBindingServlet</servlet-name>
>     <url-pattern>/jbi/DirectoryService/*</url-pattern>
>   </servlet-mapping>
>
> --
> View this message in context:
> http://www.nabble.com/Deploying-multiple-webservices-with-xfire-binding-tf2074775.html#a5713547
> Sent from the ServiceMix - User forum at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet