Java Reference
In-Depth Information
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type"
content="application/x-www-form-urlencoded; charset=UTF-8">
<title>.NET HTTP Client</title>
</head>
<body>
<form method="POST" target="_blank"
action="http://localhost:3416/WebSite1/Service.asmx/
HelloMsg">
<input name="name" value="Eben" type="text"/>
<input type="submit" />
</form>
</body>
</html>
This will call the web service you've deployed and give you back a non-SOAP response, like
this:
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://soacookbook.com/dotnet">string</string>
Now you can write a JSP using a proxy, as you've done before. First generate the proxy using
wsimport or an equivalent tool. Then you can create a JSP like the one in Example 12-12 .
Example12-12.soap12.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="com.soacookbook.dotnet.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<title>SOAP 1.2 Invoker</title>
</head>
<body>
<%
try {
GreetingService service = new GreetingService();
GreetingServiceSoap port = service.getGreetingServiceSoap12();
HelloMsg parameters = new HelloMsg();
Search WWH ::




Custom Search