3

JavaEE6チュートリアルの344ページを見ています。

  1. 生成されたhelloservice.endpoint.HelloServiceクラスを使用します。これは、デプロイされたサービスのWSDLファイルのURIでサービスを表します。importhelloservice.endpoint.HelloService;

この生成されたクラスはどこにありますか?これを生成することになっているサービスのWARファイルを含めました。http:// localhost:8080 / helloservice / HelloService?WSDLでWSDLで生成されたスキーマを確認できるため、サービス側は問題あり ません。

4

2 に答える 2

0

オラクルのjavaeeチュートリアルからのリンクは次のとおりです。

generate-wsdlタスクgenerate-wsdlタスクはwscompileを実行し、WSDLファイルとマッピングファイルを作成します。WSDLファイルはWebサービスを記述し、静的スタブクライアントでクライアントスタブを生成するために使用されます。マッピングファイルには、JavaインターフェイスとWSDL定義の間のマッピングを関連付ける情報が含まれています。これは、J2EE準拠のデプロイメントツールがWSDLファイルおよびJavaインターフェースとともにこの情報を使用して、デプロイされたWebサービスのスタブとタイを生成できるように移植可能であることを目的としています。

The files created in this example are MyHelloService.wsdl and mapping.xml. The generate-wsdl task runs wscompile with the following arguments: 

wscompile -define -mapping build/mapping.xml -d build -nd build 
-classpath build config-interface.xml 
The -classpath flag instructs wscompile to read the SEI in the build directory, and the -define flag instructs wscompile to create WSDL and mapping files. The -mapping flag specifies the mapping file name. The -d and -nd flags tell the tool to write class and WSDL files to the build subdirectory. 

The wscompile tool reads an interface configuration file that specifies information about the SEI. In this example, the configuration file is named config-interface.xml and contains the following: 

<?xml version="1.0" encoding="UTF-8"?>
<configuration 
  xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
  <service 
      name="MyHelloService" 
      targetNamespace="urn:Foo" 
      typeNamespace="urn:Foo" 
      packageName="helloservice">
      <interface name="helloservice.HelloIF"/>
  </service>
</configuration> 
This configuration file tells wscompile to create a WSDL file named MyHello
Service.wsdl with the following information: 

•The service name is MyHelloService.
•The WSDL target and type namespace is urn:Foo. The choice for what to use for the namespaces is up to you. The role of the namespaces is similar to the use of Java package names--to distinguish names that might otherwise conflict. For example, a company can decide that all its Java code should be in the package com.wombat.*. Similarly, it can also decide to use the namespace http://wombat.com. 
•The SEI is helloservice.HelloIF.
The packageName attribute instructs wscompile to put the service classes into the helloservice package. 
于 2011-04-13T13:35:23.150 に答える
0

java bin ディレクトリを調べたところ、wscompile は見つかりませんでしたが、[wsimport][1] が見つかりました。これはJava 6で使用されているものだと思います。

Overview 
The wsimport tool generates JAX-WS portable artifacts, such as: 

Service Endpoint Interface (SEI)
Service
Exception class mapped from wsdl:fault (if any)
Async Reponse Bean derived from response wsdl:message (if any)
JAXB generated value types (mapped java classes from schema types)
These artifacts can be packaged in a WAR file with the WSDL and schema documents along with the endpoint implementation to be deployed. also provides wsimport ant task, see Wsimport ant task. 


Launching wsimport 
Solaris/Linux 
/bin/wsimport.sh -help
Windows 
\bin\wsimport.bat -help
于 2011-04-13T13:40:16.313 に答える