4

How to make below variables as configurable,I generated webservice java classes using WS IMPORT.But problem is eventhough wsdl is same for each environemnt SIT,UAT and PROD.But below properties will be different.

wsdlLocation
targetNamespace
url

So how to configure these from properties file?

Suppose take below code that is generated from ws import using JAXWS.How below fields to be configurable without generating the code by environment level.

@WebServiceClient(name = "empLookup", targetNamespace = "https://caitest/empLookup", wsdlLocation = "http://caitest.net:10001/empLookup/empLookup?WSDL")

Regards, Raj

rajputhch
  • 627
  • 4
  • 22
  • 36

1 Answers1

0

You can configure this vars using a properties file, loaded at the beginning and use different in each environment.

logoff
  • 3,347
  • 5
  • 41
  • 58
  • That part I know and understand.but how to pass those values into annotations – rajputhch Oct 02 '13 at 18:00
  • OK, now I understand. it's not possible using variables resolved et runtime. see this question: http://stackoverflow.com/questions/2065937/how-to-supply-value-to-an-annotation-from-a-constant-java – logoff Oct 02 '13 at 18:36
  • Looking for some example,dont understand how to pass those vslues to annotation – rajputhch Oct 02 '13 at 18:53
  • Similarly I am looking for this http://stackoverflow.com/questions/3569075/overriding-or-setting-web-service-endpoint-at-runtime-for-code-generated-with-ws – rajputhch Oct 02 '13 at 20:50
  • this question does not use annotations. with annotations is not possible using dynamic variables, as I explained in my last comment. – logoff Oct 03 '13 at 06:45