2

I have a wsdl file, which contains service-tag and partial view of it:

<service name="EXFlowers">
   <port binding="getflowers:EXFlowersGetflowers" name="EXFlowersGetflowersService">
       <soap:address location="http://dev.example.com:67857/EXFlowers/getflowers" />
   </port>
</service>

My problem is in this part:

<soap:address location="http://dev.example.com:67857/EXFlowers/getflowers" />

I am using wsdl2java which creates .java files from the wsdl file (then I compile the generated files and make a jar file out of it for using it in WebSpehere).

As it is now I can't promote a .jar file from one environment to another (for example: development -> test -> staging -> production), because the location in each environment has different base url. I hate to run wsdl2java for each environment (basically create the same jar 5 times with just different string values in some of the class files). I want "build once, run anywhere" workflow and I found this from IBM's support page https://www.ibm.com/support/pages/accommodating-different-wsdl-urls-between-environments which explains how it could be done.

So my question is: Can a kindly soul explain me with syntax examples how option 2 can be done:

  1. Use a file:// based WSDL URL. Store the WSDL file itself in the same file path in each environment, but use different contents with custom hostnames and/or endpoint URLs therein.

I don't understand it, how will it look like:

<soap:address location="file://tmp/myendpointfile.txt and what about this part -> /EXFlowers/getflowers" />

and how will the content of the file be ?

cat /tmp/myendpointfile.txt
http://dev.example.com:67857

I would appreciate any help or if you guys know a better way of accomplishing this task.

yusuf tezel
  • 1,232
  • 13
  • 18

0 Answers0