1. message sayHelloRequest has been defined.
2. message sayHelloReply has been defined.
3. operation sayHello has been defined.
4. input parameter of type sayHelloRequest has been defined for the message
sayHello.
5. output parameter of type sayHelloReply has been defined for the message
sayHello.
Chapter 9
[ 181 ]
The comparable Java definition of this method could be as follows:
public class SayHelloRequest 1
{ }
public class SayHelloResponse 2
{ }
public class SayHello
{
public SayHelloResponse sayHello (SayHelloRequest request)
{ 3, 4, 5
}
}
In this Java code, points 1 to 5 represent the same items as defined in the
WSDL document.
If you look carefully at this Java code, you will probably spot something missing;
exceptions. If we wanted to handle errors within the sayHello method, we would
need to specify on the method signature what exceptions the method throws. In
the above code, if we never wanted to say hello to anyone who isn't our friend, we
would define a specific exception for this case and then alter the method signature to
throw the exception.
public class NotFriendFault extends Exception
{ }
public class SayHello
{
public SayHelloResponse sayHello (
SayHelloRequest resuest) throws NotFriendFault
}
Handling Events
[ 182 ]
This exception can easily be mapped within a WSDL document by specifying a
new fault message and a new
option within our operation.
Pages:
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166