2011-08-26 3 views
0

저는 Spring을 기반으로하는 웹 서비스 클라이언트를 가지고 있습니다 :Spring JaxWs 프록시의 포트를 어떻게 바꿀 수 있습니까?

<bean id="myService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean"> 
    <property name="wsdlDocumentUrl" value="classpath:/ex/MyService.wsdl" /> 
    <property name="namespaceUri"  value="http://ex.tld/namespace" /> 
    <property name="serviceName"  value="MyService" /> 
    <property name="portName"   value="MyServicePort01" /> 
    <property name="serviceInterface" value="ex.MyService" /> 
</bean> 

다른 엔드 포인트 목록에서 같은 서비스에 액세스해야합니다. 목록이 동적이기 때문에이를 위해 여러 Spring JaxWsPortProxy 빈을 구성 할 수는 없습니다.

바인딩을 동적으로 변경할 수 있습니까? WS 클라이언트를위한 Spring 기능을 계속 활용하면서 어떻게 해결할 수 있습니까?

답변

1

는 단순히 프록시의 엔드 포인트 주소를 변경.

누군가가이를 채택하면 동기화 문제를 조심하십시오.

0

xml로 구성되었습니다. 이후 postConsruct set 끝점에서 afterPropertiesSet을 호출합니다.

@Autowired 
private JaxWsPortProxyFactoryBean myService; 

@PostConstruct 
public void init() { 
    myService.setEndpointAddress("http://new/endpoint/address"); 
    myService.afterPropertiesSet(); 
} 
관련 문제