Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: GroovyWS-0.5.1
-
Fix Version/s: None
-
Component/s: GroovyWS
-
Labels:None
-
Environment:Windows XP, Grails 1.1.2 with Groovy WS, local testing
-
Patch Submitted:Yes
-
Number of attachments :
Description
My WSDL contains a wrong URL for a service endpoint, so i was looking for a way to set it manually.
As WSClient, you can use the method
public void changeEndpointAddress(URL newUrl)
{ client.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, newUrl.toExternalForm()); }of the class AbstractCXFWSClient, but unfortunately this does not work.
This code works:
proxy = new WSClient(wsdlUrlOfFile, this.class.classLoader)
proxy.initialize()
groovyx.net.ws.AbstractCXFWSClient proxyCXF = (groovyx.net.ws.AbstractCXFWSClient)proxy
org.apache.cxf.endpoint.Client client = proxyCXF.client
Endpoint endpoint = client.getEndpoint()
EndpointInfo epInfo = endpoint.getEndpointInfo()
epInfo.setAddress(endpointAddress)
The following statement works for me:
public void changeEndpointAddress(URL newUrl){ client.getConduit().getTarget().getAddress().setValue(newUrl.toExternalForm()); }Patch for fixing this issue (a test case is included in order to reproduce it).