0
I created a web service with JAX-WS and used Spring to put it online and also to decrease the use of XML. Problem is that when I declare the Simplejaxwsserviceexporter in the Spring configuration file I have to put the attribute baseAddress that is the host, the default is localhost:8080 and when it is this way I cannot access the Webservice through another machine. Ex: I go on another machine and type the IP of mine and not access the Web Service on the port referred, now if I configure the baseAddress with my-ip:8080 I access from any machine and not access by localhost:8080/
If it was a study project I had no problem but I have to put in homologation and production and every time before generating the . War have change and put ip.
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<tx:annotation-driven/>
<context:component-scan base-package="br" />
<context:annotation-config />
<bean name="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" scope="singleton">
<property name="packagesToScan" value="br.com" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</prop>
<prop key="hibernate.connection.url">$url</prop>
<prop key="hibernate.connection.username">$user</prop>
<prop key="hibernate.connection.password">$pass</prop>
<prop key="hibernate.c3p0.min_size">5</prop>
<prop key="hibernate.c3p0.max_size">20</prop>
<prop key="hibernate.c3p0.timeout">86400</prop>
<prop key="hibernate.c3p0.max_statements">0</prop>
<prop key="hibernate.temp.use_jdbc_metadata_defaults">false</prop>
<prop key="hibernate.c3p0.idle_test_period">120</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="messageDispatcherServlet" class="org.springframework.ws.transport.http.MessageDispatcherServlet">
</bean>
<!-- Localhost -->
<bean class= "org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter">
<property name="baseAddress" value="http://localhost:7078/" />
</bean>
I already have her in pom.xml =/
– adelmo00
then just replace your Simplejaxwsserviceexporter bean with bindings, I changed the answer with the prefix definition
– filipeportes
And every time I add a new Web Service I’ll have to add in XML too, I’m running away from that rsrs. I’ll leave it as it is, I just change the address when generating the . War
– adelmo00