📄 jaxr4.html
字号:
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <title>Running the Client Examples</title> <link rel="StyleSheet" href="document.css" type="text/css" media="all" /> <link rel="StyleSheet" href="catalog.css" type="text/css" media="all" /> <link rel="Table of Contents" href="J2EETutorialTOC.html" /> <link rel="Previous" href="JAXR3.html" /> <link rel="Next" href="JAXR5.html" /> <link rel="Index" href="J2EETutorialIX.html" /> </head> <body> <table width="550" summary="layout" id="SummaryNotReq1"> <tr> <td align="left" valign="center"> <font size="-1"> <a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a> </td> <td align="center" valign="center"><a accesskey="p" href="JAXR3.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="JAXR5.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a> </td> <td align="right" valign="center"> <font size="-1"> <a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a> <br> <a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font> </font> </td> </tr> </table> <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"> <blockquote><a name="wp64170"> </a><h2 class="pHeading1">Running the Client Examples</h2><a name="wp69474"> </a><p class="pBody">The simple client programs provided with this tutorial can be run from the command line. You can modify them to suit your needs. They allow you to specify the IBM registry, the Microsoft registry, or the Java WSDP Registry Server for queries and updates; you can specify any other UDDI version 2 registry.</p><a name="wp77560"> </a><p class="pBody">The client examples, in the <code class="cCode"><</code><code class="cVariable">INSTALL</code><code class="cCode">>/j2eetutorial14/examples/jaxr/simple/src/</code> directory, are as follows:</p><div class="pSmartList1"><ul class="pSmartList1"><a name="wp77562"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRQuery.java" target="_blank">JAXRQuery.java</a></code> shows how to search a registry for organizations</li></div><a name="wp77564"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRQueryByNAICSClassification.java" target="_blank">JAXRQueryByNAICSClassification.java</a></code> shows how to search a registry using a common classification scheme</li></div><a name="wp77566"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRQueryByWSDLClassification.java" target="_blank">JAXRQueryByWSDLClassification.java</a></code> shows how to search a registry for Web services that describe themselves by means of a WSDL document</li></div><a name="wp77568"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRPublish.java" target="_blank">JAXRPublish.java</a></code> shows how to publish an organization to a registry</li></div><a name="wp77570"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRDelete.java" target="_blank">JAXRDelete.java</a></code> shows how to remove an organization from a registry</li></div><a name="wp87342"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRSaveClassificationScheme.java" target="_blank">JAXRSaveClassificationScheme.java</a></code> shows how to publish a classification scheme (specifically, a postal address scheme) to a registry</li></div><a name="wp85376"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRPublishPostal.java" target="_blank">JAXRPublishPostal.java</a></code> shows how to publish an organization with a postal address for its primary contact</li></div><a name="wp85377"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRQueryPostal.java" target="_blank">JAXRQueryPostal.java</a></code> shows how to retrieve postal address data from an organization</li></div><a name="wp87357"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRDeleteScheme.java" target="_blank">JAXRDeleteScheme.java</a></code> shows how to delete a classification scheme from a registry</li></div><a name="wp141019"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRPublishConcept.java" target="_blank">JAXRPublishConcept.java</a></code> shows how to publish a concept for a WSDL document</li></div><a name="wp144262"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRPublishHelloOrg.java" target="_blank">JAXRPublishHelloOrg.java</a></code> shows how to publish an organization with a service binding that refers to a WSDL document</li></div><a name="wp141020"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRDeleteConcept.java" target="_blank">JAXRDeleteConcept.java</a></code> shows how to delete a concept</li></div><a name="wp87546"> </a><div class="pSmartList1"><li><code class="cCode"><a href="../examples/jaxr/simple/src/JAXRGetMyObjects.java" target="_blank">JAXRGetMyObjects.java</a></code> lists all the objects that you own in a registry</li></div></ul></div><a name="wp87919"> </a><p class="pBody">The <code class="cCode"><</code><code class="cVariable">INSTALL</code><code class="cCode">>/j2eetutorial14/examples/jaxr/simple/</code> directory also contains: </p><div class="pSmartList1"><ul class="pSmartList1"><a name="wp87920"> </a><div class="pSmartList1"><li>A <code class="cCode">build.xml</code> file for the examples</li></div><a name="wp87921"> </a><div class="pSmartList1"><li>A <code class="cCode"><a href="../examples/jaxr/simple/src/JAXRExamples.properties" target="_blank">JAXRExamples.properties</a></code> file, in the <code class="cCode">src</code> subdirectory, that supplies string values used by the sample programs</li></div><a name="wp87922"> </a><div class="pSmartList1"><li>A file called <code class="cCode">postalconcepts.xml</code> that you use with the postal address examples</li></div></ul></div><a name="wp150576"> </a><p class="pBody">You do not have to have the J2EE Application Server running in order to run these client examples. However, if you want to run the J2EE Application Server and the Registry Server at the same time, you should be aware that they both use the same port, 8080, to run the Web container. You need to change this port for either the J2EE Application Server or for the Java WSDP. </p><a name="wp151730"> </a><p class="pBody">You specified the Web container port for the J2EE Application Server (called the HTTP listen port?) when you installed it. If you did not already specify a nondefault port for the J2EE Application server, it is probably easier to change the Java WSDP port. This involves two tasks:</p><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp151733"> </a><div class="pSmartList1"><li>Open the file <code class="cCode"><</code><code class="cVariable">JWSDP_HOME</code><code class="cCode">>/conf/server.xml</code> in a text editor. Find the comment "Define a non-SSL Coyote HTTP/1.1 Connector on port 8080." In the Connector element that follows, change this attribute to some other port value, such as 8082 or 8083:</li></div><a name="wp151697"> </a><p class="pBodyRelative"><code class="cCode">port="8080"</code></p><a name="wp151738"> </a><div class="pSmartList1"><li>Open the file <code class="cCode"><</code><code class="cVariable">JWSDP_HOME</code><code class="cCode">>/jwsdp-shared/bin/launcher.xml</code> in a text editor. Find the following lines (they are all on one line in the file):</li></div><a name="wp151749"> </a><p class="pBodyRelative"><code class="cCode"><sysproperty key="org.apache.xindice.host" <br />value="desired Xindice host"/><br /><sysproperty key="org.apache.xindice.port" <br />value="desired Xindice port"/></code></p></ol></div><a name="wp151752"> </a><p class="pBody">Make the host and port values the same as those for the Web container (the host is ordinarily <code class="cCode">localhost</code>). Uncomment these properties before you save the file.</p><a name="wp151746"> </a><p class="pBody">Now, when you start the Java WSDP Web container, Tomcat, as described in <a href="JAXR4.html#wp96272">Running the Examples</a>, there will be no port conflict with the J2EE Application Server.</p><a name="wp77309"> </a><h3 class="pHeading2">Before You Compile the Examples</h3><a name="wp75855"> </a><p class="pBody">Before you compile the examples, edit the file <code class="cCode"><</code><code class="cVariable">INSTALL</code><code class="cCode">>/j2eetutorial14/examples/jaxr/simple/src/JAXRExamples.properties</code> as follows.</p><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp75864"> </a><div class="pSmartList1"><li>Edit the following lines to specify the registry you wish to access. For both the <code class="cCode">queryURL</code> and the <code class="cCode">publishURL</code> assignments, comment out all but the registry you wish to access. The default is the Java WSDP Registry Server.</li></div><a name="wp87959"> </a><p class="pBodyRelative"><code class="cCode">## Uncomment one pair of query and publish URLs.<br />## IBM:<br />#query.url=http://uddi.ibm.com/testregistry/inquiryapi<br />#publish.url=https://uddi.ibm.com/testregistry/publishapi<br />## Microsoft:<br />#query.url=http://test.uddi.microsoft.com/inquire<br />#publish.url=https://test.uddi.microsoft.com/publish<br />## Registry Server:<br />query.url=http://localhost:8080/RegistryServer/<br />publish.url=http://localhost:8080/RegistryServer/</code></p><a name="wp115839"> </a><p class="pBodyRelative">If you are using the Java WSDP Registry Server, and if it is running on a system other than your own, specify the fully qualified host name instead of <code class="cCode">localhost</code>. Do not use <code class="cCode">https:</code> for the <code class="cCode">publishURL</code>. If Tomcat is using a nondefault port, change <code class="cCode">8080</code> to the correct value for your system.</p><a name="wp78007"> </a><p class="pBodyRelative">The IBM and Microsoft registries both have a considerable amount of data in them that you can perform queries on. Moreover, you do not have to register if you are only going to perform queries.</p><a name="wp86236"> </a><p class="pBodyRelative">We have not included the URLs of the SAP registry; feel free to add them.</p><a name="wp78062"> </a><p class="pBodyRelative">If you want to publish to any of the public registries, the registration process for obtaining access to them is not difficult (see <a href="JAXR3.html#wp64094">Preliminaries: Getting Access to a Registry</a>). Each of them, however, allows you to have only one organization registered at a time. If you publish an organization to one of them, you must delete it before you can publish another. Since the organization that the <code class="cCode">JAXRPublish</code> example publishes is fictitious, you will want to delete it immediately anyway. </p><a name="wp90930"> </a><p class="pBodyRelative">The Java WSDP Registry Server gives you more freedom to experiment with JAXR. You can publish as many organizations, concepts, and classification schemes to it as you wish. However, this registry comes with an empty database, so you must publish data to it yourself before you can perform queries on the data.</p><a name="wp87970"> </a><div class="pSmartList1"><li>Edit the following lines to specify the user name and password you obtained when you registered with the registry. The defaults are the Registry Server default username and password.</li></div><a name="wp87971"> </a><p class="pBodyRelative"><code class="cCode">## Specify username and password if needed<br />## testuser/testuser are defaults for Registry Server<br />registry.username=testuser<br />registry.password=testuser</code></p><a name="wp87972"> </a><div class="pSmartList1"><li>If you will be using a public registry, edit the following lines, which contain empty strings for the proxy hosts, to specify your own proxy settings. The proxy host is the system on your network through which you access the Internet; you usually specify it in your Internet browser settings. You can leave this value empty to use the Java WSDP Registry Server.</li></div><a name="wp87973"> </a><p class="pBodyRelative"><code class="cCode">## HTTP and HTTPS proxy host and port; <br />## ignored by Registry Server<br />http.proxyHost=<br />http.proxyPort=8080<br />https.proxyHost=<br />https.proxyPort=8080</code></p><a name="wp87974"> </a><p class="pBodyRelative">The proxy ports have the value 8080, which is the usual one; change this string if your proxy uses a different port.</p><a name="wp87975"> </a><p class="pBodyRelative">For a public registry, your entries usually follow this pattern:</p><a name="wp87976"> </a><p class="pBodyRelative"><code class="cCode">http.proxyHost=proxyhost.mydomain<br />http.proxyPort=8080<br />https.proxyHost=proxyhost.mydomain<br />https.proxyPort=8080</code></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -