In a WSDL we define the operation name, input and output in the portType element; later on in binding we define operation, input and output again. What is the rationale behind this? why define them twice? I understand in binding we define the encodingStyle and other attributes, so what is the need of portType?
You are talking about WSDL 1.1. In WSDL 2.0, you define operations only once, in an interface tag. You should read more about Java libraries' support for WSDL 2.0, for instance: Axis2 with WSDL 2.0 Tutorial