Announcement Announcement Module
Collapse
No announcement yet.
Why is locationUri hardcoded? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why is locationUri hardcoded?

    Hello everybody,

    I'm currently implementing a Web Service using Spring-WS, which works fine so far. Now that I'm trying to deploy the current state on a different system, I only have one small issue:

    The locationUri in the DynamicWsdl11Definition is hardcoded in my config file, which requires me to change the config everytime I deploy on a new machine.

    Code:
    <bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
    <property name="schema" value="classpath:v2/MovilizerTransferDescription.xsd" />
    <property name="portTypeName" value="MovilizerWebService" />
    <property name="locationUri" value="http://localhost:8080/SRV_APP_WebServiceConnector/" />
    <!--<property name="locationUri" value="/SRV_APP_WebServiceConnector/" />-->
    <property name="targetNamespace" value="http://movilitas.com/movilizer" />
    <property name=""></property>
    </bean>
    The question I have, why do I have to hardcode an absolute URI in here? Does anybody know a way to allow a dynmic Url (there must be a servlet sending the WSDL definition to the client) or a relative Url to be used, that would really help me.

    btw: Where does the DynamicWsdl11Definition get loaded from? There must be a servlet that does that...

    Thanks,
    Christian

  • #2
    You have a few options here but by far simpliest just applicable for a locationUri specific to your environment can be to use transformWsdlLocations

    <servlet-name>spring-ws</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.Messag eDispatcherServlet</servlet-class>
    <init-param>
    <param-name>transformWsdlLocations</param-name>
    <param-value>true</param-value>
    </init-param>
    etc

    Comment


    • #3
      Thanks, that works! If I had looked into the web.xml ... :-)

      Comment

      Working...
      X