You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by ae...@apache.org on 2006/09/18 17:08:45 UTC

svn commit: r447428 - /webservices/muse/site/docs/2.0.0/tutorial/08-test-client.html

Author: aeberbac
Date: Mon Sep 18 08:08:44 2006
New Revision: 447428

URL: http://svn.apache.org/viewvc?view=rev&rev=447428
Log:
finished client portion

Modified:
    webservices/muse/site/docs/2.0.0/tutorial/08-test-client.html

Modified: webservices/muse/site/docs/2.0.0/tutorial/08-test-client.html
URL: http://svn.apache.org/viewvc/webservices/muse/site/docs/2.0.0/tutorial/08-test-client.html?view=diff&rev=447428&r1=447427&r2=447428
==============================================================================
--- webservices/muse/site/docs/2.0.0/tutorial/08-test-client.html (original)
+++ webservices/muse/site/docs/2.0.0/tutorial/08-test-client.html Mon Sep 18 08:08:44 2006
@@ -112,25 +112,72 @@
 <div id="minitoc-area">
 <ul class="minitoc">
 <li>
-<a href="#Section1">Section #1 Header</a>
-</li>
-<li>
-<a href="#Section2">Section #2 Header</a>
+<a href="#Section1">Connecting to a Deployed Endpoint</a>
 </li>
 </ul>
 </div>
 
 <a name="N1000C"></a><a name="Section1"></a>
-<h2 class="boxed">Section #1 Header</h2>
+<h2 class="boxed">Connecting to a Deployed Endpoint</h2>
 <div class="section">
-<p>TODO: Andrew</p>
+    <p>When communicating with a resource, you must create a proxy to that resource as described <a href="03-wsdl2java.html#Section4">earlier</a>. 
+    After adding the generated client jar to your compilation classpath, you can create a proxy as follows:
+    <code>
+        <pre>
+    public static void main(String[] args) {
+        try {
+            // insert your endpoint's uri here
+            URI uri = new URI("http://...");
+            EndpointReference epr = new EndpointReference(uri);
+
+            // change to use your own proxy class
+            YOURProxy proxy = new YOURProxy(epr);
+
+            //optional, but useful
+            proxy.setTrace(true);
+
+            //get the foo property
+            proxy.getFoo();
+
+            //invoke the bar operation
+            proxy.bar();
+        } catch (Exception e) {
+            System.err.println(e.getMessage());
+            e.printStackTrace();
+        }
+    }
+    </pre>
+    </code>
+    In the above code you should replace "http://..." with the URI to your deployed resource. For resources created using
+    the <em>wsdl2java</em> tooling, a default resource is created when the endpoint is deployed. The URI to this resource is as follows.
+    For Axis2 on J2EE:
+    <ul>
+        <li>Hostname: <code>http://localhost:PORT</code> where PORT is replaced with your J2EE container port.</li>
+        <li>WAR path: this is the name of the WAR file that you deployed.</li>
+        <li>Resource path: <code>services/NAME</code> where NAME is the name of the generated service. This is the name of a directory
+        under <b>/WebContent/WEB-INF/services/muse/router-entries</b>.</li>
+    </ul>
+    For example, if the PORT is 8080, the name of the WAR file is myWar.war and the name of the service is MyService. The URI would be:
+    <blockquote>
+        <code>http://localhost:8080/myWar/services/MyService</code>
+    </blockquote>
+    For OSGi:
+    <ul>
+        <li>Hostname: <code>http://localhost:PORT</code> where PORT is replaced with your OSGi HTTP service port.</li>
+        <li>Bundle path: this is the name of the bundle.</li>
+        <li>Resource path: <code>NAME</code> where NAME is the name of the generated service. This is the name of a directory
+        under <b>/router-entries</b>.</li>
+    </ul>
+    For example, if the PORT is 80, the name of the WAR file is myBundle and the name of the service is MyService. The URI would be:
+    <blockquote>
+        <code>http://localhost:80/myBundle/MyService</code>
+    </blockquote>
+    </p>
+    <p>Also, in the above code you must replace <code>YOURProxy</code> with the name of the Proxy that is generated.</p>
+    <p>Finally the <code>setTrace</code> call will print all of the outgoing and incoming messages to standard output. This is extremely useful
+    when developing your endpoints. This operation is available on all generated Proxies, but the other two methods will be specific to your
+    endpoint.</p>
 </div>
-		
-<a name="N10016"></a><a name="Section2"></a>
-<h2 class="boxed">Section #2 Header</h2>
-<div class="section">
-<p>TODO: Andrew
-</p>
 <p>
 <br/>
 <a href="07-deploy-application-axis2.html"><strong>&lt;</strong> Back (Axis2)</a>



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org