自己去查JDOM或者DOM4J的API文档

解决方案 »

  1.   

    wsdl作了些小修改
    用axis的WSDL2Java可自动生成java代码
    axis下载地址http://ws.apache.org/axis/<?xml version="1.0" encoding="utf-8"?>
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:s0="http://hostname/applicationName/queryRequest"
                 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                 targetNamespace="http://hostname/applicationName/queryRequest">
        <types>
            <xsd:schema targetNamespace="http://hostname/applicationName/queryRequest"
                        xmlns="http://hostname/applicationName/queryRequest">            <xsd:complexType name="QueryRequest">
                    <xsd:sequence>
                        <xsd:element name="senderID" type="xsd:string"/>
                        <xsd:element name="queryType" type="xsd:int"/>
                        <xsd:element name="receiverID" type="xsd:string"/>
                        <xsd:element name="queryTitle" type="xsd:string" minOccurs="0"/>
                        <xsd:element name="sentTime" type="xsd:string"/>
                        <xsd:element name="page" type="xsd:int"/>
                        <xsd:element name="pageSize" type="xsd:int"/>
                        <xsd:element name="queryCondition" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
                <xsd:complexType name="QueryResponse">
                    <xsd:sequence>
                        <xsd:element name="senderID" type="xsd:string"/>
                        <xsd:element name="sentTime" type="xsd:string"/>
                        <xsd:element name="providerID" type="xsd:string"/>
                        <xsd:element name="responseType" type="xsd:int"/>
                        <xsd:element name="resultCode" type="xsd:int"/>
                        <xsd:element name="resultNum" type="xsd:int"/>
                        <xsd:element name="page" type="xsd:int"/>
                        <xsd:element name="pageSize" type="xsd:int"/>
                        <xsd:element name="resultMessage" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:schema>
        </types>
        <message name="QueryRequestSoapIn">
            <part name="request" type="s0:QueryRequest"/>
        </message>
        <message name="QueryRequestSoapOut">
            <part name="QueryRequestResult" type="s0:QueryResponse"/>
        </message>
        <portType name="QueryRequestSoap">
            <operation name="QueryRequest">
                <input message="s0:QueryRequestSoapIn"/>
                <output message="s0:QueryRequestSoapOut"/>
            </operation>
        </portType>
        <binding name="QueryRequestSoap" type="s0:QueryRequestSoap">
            <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
            <operation name="QueryRequest">
                <soap:operation soapAction="http://hostname/applicationName/queryRequest" style="rpc"/>
                <input>
                    <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                               namespace="http://hostname/applicationName/queryRequest"/>
                </input>
                <output>
                    <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                               namespace="http://hostname/applicationName/queryRequest"/>
                </output>
            </operation>
        </binding>
        <service name="interface">
            <port name="QueryRequestSoap" binding="s0:QueryRequestSoap">
                <soap:address location="http://hostname/applicationName/com/cnc/.../queryRequest.jws"/>
            </port>
        </service>
    </definitions>
      

  2.   

    手动构造的话用WSDL4J,是专门处理WSDL文件的API
      

  3.   

    好象axis底层也是用的它处理和生成WSDL的
    地址:http://sourceforge.net/projects/wsdl4japi:  http://www.extreme.indiana.edu/apis/wsdl4j/index.html
      

  4.   

    QueryRequest和QueryResponse可以写成
    public class QueryRequest {
      private String senderID;
      private String receiverID;
      private String queryTitle;
      private String sentTime;
      private int page;
      private int pageSize;
      private String queryCondition;
      private int queryType;
      public QueryRequest() {
      }
      public String getSenderID() {
        return senderID;
      }
      public void setSenderID(String senderID) {
        this.senderID = senderID;
      }
      public int getQueryType() {
        return queryType;
      }
      public void setQueryType(int queryType) {
        this.queryType = queryType;
      }
      public String getReceiverID() {
        return receiverID;
      }
      public void setReceiverID(String receiverID) {
        this.receiverID = receiverID;
      }
      public String getQueryTitle() {
        return queryTitle;
      }
      public void setQueryTitle(String queryTitle) {
        this.queryTitle = queryTitle;
      }
      public String getSentTime() {
        return sentTime;
      }
      public void setSentTime(String sentTime) {
        this.sentTime = sentTime;
      }
      public int getPage() {
        return page;
      }
      public void setPage(int page) {
        this.page = page;
      }
      public int getPageSize() {
        return pageSize;
      }
      public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
      }
      public String getQueryCondition() {
        return queryCondition;
      }
      public void setQueryCondition(String queryCondition) {
        this.queryCondition = queryCondition;
      }
    }

    public class QueryResponse {
      private String senderID;
      private String sentTime;
      private String providerID;
      private int responseType;
      private int resultCode;
      private int resultNum;
      private int page;
      private int pageSize;
      private String resultMessage;
      public QueryResponse() {
      }
      public String getSenderID() {
        return senderID;
      }
      public void setSenderID(String senderID) {
        this.senderID = senderID;
      }
      public String getSentTime() {
        return sentTime;
      }
      public void setSentTime(String sentTime) {
        this.sentTime = sentTime;
      }
      public String getProviderID() {
        return providerID;
      }
      public void setProviderID(String providerID) {
        this.providerID = providerID;
      }
      public int getResponseType() {
        return responseType;
      }
      public void setResponseType(int responseType) {
        this.responseType = responseType;
      }
      public int getResultCode() {
        return resultCode;
      }
      public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
      }
      public int getResultNum() {
        return resultNum;
      }
      public void setResultNum(int resultNum) {
        this.resultNum = resultNum;
      }
      public int getPage() {
        return page;
      }
      public void setPage(int page) {
        this.page = page;
      }
      public int getPageSize() {
        return pageSize;
      }
      public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
      }
      public String getResultMessage() {
        return resultMessage;
      }
      public void setResultMessage(String resultMessage) {
        this.resultMessage = resultMessage;
      }
    }
    么?
    那么这个operation的输入参数和输出参数可以看作是QueryRequest和QueryResponse么?
    就是java的method可以按如下的形式构造么?
    public QueryResponse queryRequest(QueryRequest qr) {
        QueryResponse q = new QueryResponse();
        return q;
    }