How can i expose a Java legacy app as a soap web services?

Our company is moving some components to our internal cloud and I am working in a project and one of the task is to expose an existing legacy java class as soap web service. Can anyone please help me stir in the right direction? How can  I write a soap Producer on existing new class and methods? Should I write a new class and extend this class or should I write a subclass? What is the best  way  to approach  this?I  am new  to integration projects. The company is using  Mule  Esb as an integration solution? Also how Mule esb fitst together  with all this?I am new to  Mule  esb.
Frank DannyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You should use composition. Write your web service and within your web service just call the methods in your legacy code.

public class NewWebService {
    private LegacyJavaObject legacy = new LegacyJavaObject();

    public void doSomething() {

Open in new window

Frank DannyAuthor Commented:
Thank  you can I publish  it?Build  it and get the wsdl?
There are two approaches.

The first is you build the WSDL and from the WSDL you generate the skeleton Java code. Then you fill in the gaps.

The second approach is to write the Java class first, build it, deploy it, and then get the WSDL form the Java code.

The second approach is easier.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.