01 <!-- Copyright (c) 1999-2005 by BEA Systems, Inc. All Rights Reserved.-->
02 <%@ page import="examples.webservices.jws_basic.simple.client.SimpleImplService,
03 examples.webservices.jws_basic.simple.client.SimpleImplService_Impl,
04 examples.webservices.jws_basic.simple.client.Simple,
05 javax.xml.rpc.Stub,
06 java.io.StringWriter,
07 java.io.PrintWriter"%>
08
09 <%!
10 String WS_URL = "/jws_basic_simple/SimpleService";
11
12 private Simple getPort(String h, int p) throws Exception {
13 String url = "http://"+h+":"+p+WS_URL;
14 SimpleImplService service = new SimpleImplService_Impl(url+"?WSDL");
15 Simple port = service.getSimpleSoapPort();
16 Stub stub = (Stub)port;
17 stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, url);
18 return port;
19 }
20 %>
21
22
23 <jsp:include page="ExamplesHeader.jsp">
24 <jsp:param name="title" value="Web Services - Using JWS metadata annotations" />
25 </jsp:include>
26
27 <% if ("POST".equals(request.getMethod())) { %>
28 <table>
29 <tr>
30 <%
31 try {
32 String h = request.getLocalName();
33 int p = request.getLocalPort();
34 String str = weblogic.servlet.security.Utils.encodeXSS(request.getParameter("str"));
35 Simple port = getPort(h, p);
36 %>
37 <td>sayHello() returned: <b><%=port.sayHello(str)%></b>
38 <br/>
39 <% } catch (Exception e) {
40 StringBuffer strOutput = new StringBuffer();
41 strOutput.append("<pre>");
42 StringWriter sw = new StringWriter();
43 e.printStackTrace(new PrintWriter(sw));
44 strOutput.append(sw);
45 strOutput.append("</pre>");
46 out.println(strOutput.toString());
47 }
48 %>
49 </tr>
50 <tr>
51 <td> </td>
52 </tr>
53 <tr>
54 <td><a href="JWS_WebService.jsp">Invoke JWS Web Service Again</a></td>
55 </tr>
56 </table>
57
58
59 <%
60 } else {
61 %>
62 <form method="POST" name="JWS_WebService" action="JWS_WebService.jsp">
63 <table>
64 <tr>
65 <td colspan="2">This example shows how to create a simple WebLogic Web Service using JWS metadata annotations. Metadata annotations are a new J2SE 5.0 feature that provides the ability to associate additional data alongside Java classes, interfaces, methods, and fields. The set of annotations used to annotate Web Service files are called JWS annotations. WebLogic Web Services use standard JWS annotations, as defined by the <i>Web Services Metadata for the Java Platform</i> specification (JSR-181), as well as WebLogic-specific ones for added value.</td>
66 </tr>
67 <tr>
68 <td colspan="2"> </td>
69 </tr>
70 <tr>
71 <td colspan="2"><b>This JSP invokes the sayHello operation of the Simple Web service.</b></td>
72 </tr>
73 <tr>
74 <td colspan="2"> </td>
75 </tr>
76 <tr>
77 <td width="30%">Enter a String to send to the sayHello operation:</td>
78 <td><input type="text" name="str" size="30" value="Hello JWS WebService!"></td>
79 </tr>
80 <tr>
81 <td colspan="2"> </td>
82 </tr>
83 <tr>
84 <td><font face="Helvetica"><input type="Submit" value="Submit Query" name="Submit"></font></td>
85 </tr>
86 </table>
87 </form>
88 <%
89 }
90 %>
91
92
93 <%@ include file="ExamplesFooter.jsp" %>
|