Java Reference
In-Depth Information
}
private static URL __getWsdlLocation()
{
if (TEMPVERTERIMPLSERVICE_EXCEPTION!= null)
{
throw TEMPVERTERIMPLSERVICE_EXCEPTION;
}
return TEMPVERTERIMPLSERVICE_WSDL_LOCATION;
}
}
TempVerterImplService extends the Service class to provide the client
view of a web service. There are two items to note:
• The noargument constructor is equivalent to Listing 11-7 's Ser-
vice.create() method call.
getTempVerterImplPort() isequivalentto Listing11-7 ' s getPort()
method call.
Listing11-9 presentsthesourcecodetoa TempVerterClient classthatdemon-
strates how a client can use TempVerter and TempVerterImplService to ac-
cess the web service.
Listing 11-9. A simplified client for accessing the TempVerter web service
import client.TempVerter;
import client.TempVerterImplService;
class TempVerterClient
{
public static void main(String[] args) throws Exception
{
TempVerterImplService tvis = new TempVerterImplSer-
vice();
TempVerter tv = tvis.getTempVerterImplPort();
System.out.println(tv.c2F(37.0));
System.out.println(tv.f2C(212.0));
}
}
Search WWH ::




Custom Search