Slightly different solution, a bit less code but inspired by original
solution:

Java
-----
package com.foo;
...
public class MyXFireExporter extends XFireExporter {
  
  private static Logger logger = Logger.getLogger(MyXFireExporter.class);  
  
  private String serviceURL;
  
  @Override
  public ModelAndView handleRequest(HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    logger.debug("in handleRequest");
    
    /* Unregister the default XFire SOAP transport object and
    substitute with our bespoke one.*/
    TransportManager tm = super.getXfire().getTransportManager();
    Transport transport =
tm.getTransport(SoapHttpTransport.SOAP11_HTTP_BINDING);
    tm.unregister(transport);
    tm.register(new MyXFireTransport());
    return super.handleRequest(request, response);
  }
  
  public void setServiceURL(String serviceURL) {
    this.serviceURL = serviceURL;
  }
  
  class MyXFireTransport extends SoapHttpTransport {
    @Override
    public String getServiceURL(Service service) {
      logger.debug("returning XFire service URL " + serviceURL);
      return serviceURL;
    }
  }
}

XML Config for example service:
------------------------------
  ...
  <bean id="myService" class="com.foo.MyService" />
      
  <bean id="myServiceController" class="com.foo.MyXFireExporter">
    <property name="xfire" ref="xfire" />
    <property name="serviceFactory" ref="xfire.annotationServiceFactory" />
    <property name="serviceClass" value="com.foo.IMyService" />
    <property name="serviceBean" ref="myService" /> 
    <property name="inHandlers" ref="xfire.inHandlers" /> 
    <property name="serviceURL" value="https://foo.com/ws/MyService?WSDL"; />
  </bean>
    
  <bean
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="urlMap">
      <map>                             
        <entry key="/MyService" value-ref="myServiceController" />
      </map>
    </property>
  </bean>
  ...


Jack Schwenderman wrote:
> 
>     I am using Spring and XFire to configure and expose my services.  I 
> run my service application on Tomcat behind a firewall.  Apache HTTPD is 
> exposed through the firewall so all access to all services pass through 
> Apache on port 80.
> 
> The problem I have is that the auto-generated WSDL contains the port of 
> the Tomcat server as follows:
>     <wsdlsoap:address 
> location="http://*tomcatserver:8080*/MyService/xfire/InventoryService"/>
> and I need it to be the Apache port instead like this:
>     <wsdlsoap:address 
> location="http://*apacheserver*/MyService/xfire/InventoryService"/>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-to-override-generated-WSDL-address--tp9559546p28752526.html
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to