This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It's not as simple as "giving a sample program". There's a lot you need to understand about SOAP, WSDL, data binding, interoperability and various Java APIs (like SAAJ and JAX-WS) if you want to develop WS successfully.
You could start by reading up on the JAX-WS API, which is the major Java WS API. The http://faq.javaranch.com/java/WebServicesFaq links to an article titled "web services made easy" that would be a good start. Instead of the GlassFish server you could also use Apache Axis2.