Axis2でWebサービス構築!その5

エラー解決編

  1. 調べたら以下の情報を発見。
    '[Axis2] Deploying a annotated bean with JAXWS Deployer' - MARC
  2. jaxws-rt.jar,jaxws-tools.jarを以下より入手。
    https://jax-ws.dev.java.net/2.1.4/
  3. libにコピーし、Tomcat再起動。
  4. wsdlを確認。以下のように表示されれば成功!
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="TestService" targetNamespace="http://test/" xmlns:tns="http://test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <types>
    <xsd:schema>
      <xsd:import namespace="http://test/" schemaLocation="TestService.TestPort?xsd=TestService_schema1.xsd"/>
    </xsd:schema>
  </types>
  <message name="getTestInfoResponse">
    <part name="parameters" element="tns:getTestInfoResponse">
    </part>

  </message>
  <message name="getTestInfo">
    <part name="parameters" element="tns:getTestInfo">
    </part>
  </message>
  <portType name="Test">
    <operation name="getTestInfo">
      <input message="tns:getTestInfo">
    </input>

      <output message="tns:getTestInfoResponse">
    </output>
    </operation>
  </portType>
  <binding name="TestPortBinding" type="tns:Test">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="getTestInfo">
      <soap:operation soapAction=""/>
      <input>

        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="TestService">
    <port name="TestPort" binding="tns:TestPortBinding">

      <soap:address location="http://localhost:8080/Axis2Test/services/TestService.TestPort/"/>
    </port>
  </service>
</definitions>

pojoWebサービス作成の利点

  1. Webサービスを作ることをあまり意識せずに作成できる。
  2. 過去の資産を有効活用できる。
  3. aarを作る必要がない。

問題点・疑問点

  1. JRE6,Tomcat6.0では上手く動かなかった。
  2. eclipse上でAxis2を利用して作成した場合に上手く動かなかった。
    →理解できたら新たに情報を追加します。


次回はテスト用のクライアントを作成し、一旦Axis2でのWebサービス構築を完了させたいと思います。