Forum Discussion

UhsBat's avatar
Occasional Contributor
5 years ago

How to create object of EnvironmentEndpointConfig

I have a readyAPI project  and it has only default environemnt. I want to create a new environment(DEV) and add all the services using groovy. I searched some code, but it fails to cast url to Enviro...
  • UhsBat's avatar
    5 years ago

    Finally it worked, I just created a string and converted into  EnvironmentEndpointConfig 


    def str = '<xml-fragment authProfile="No Authorization" username="" password="" domain="" incomingWss="" outgoingWss="" wssTimeToLive="" wssType="" proxyHost="" proxyPort="" proxyUsername="" proxyPassword="" xmlns:con="">' + NewUrl+ '</xml-fragment>'
    com.eviware.soapui.config.EnvironmentEndpointConfig epConfig = com.eviware.soapui.config.EnvironmentEndpointConfig.Factory.parse(str);
    EndpointImpl epImpl = new EndpointImpl(epConfig, soapService);