Today I discovered the code above wasn't working correctly - it's true that it uses a web service on the configured endpoint but it gets the wsdl from the server used when the classes were generated! In my case, it was getting the wsdl from localhost. Fortunately for me I had my
Tomcat down and my code phailed.
The problem is that "new MyAppService();" is reading the wsdl immediately. To get around this, I pushed the endpoint reference into the constructor:
I stole the QName constructor straight from the generated code. That's what it will use if no arguments are given.
The 'BindingProvider' code I referred to previously isn't needed. This suits me as I didn't like it.