English 中文(简体)
自动生成的WSDL中缺少字段
原标题:Missing fields in auto generated WSDL

我在Eclipse中为java EE开发人员编写了一个java类,并使用web服务向导将其作为web服务提供。

我试图从java客户端调用其中的方法,因此我需要soap操作和名称空间,但找不到我的方法的soap操作。名称空间设置为默认名称空间。SOAP操作URL应该是什么?如果我手动设置它们,Eclipse中的客户端测试就会很顺利。

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
   <element name="login">
    <complexType>
     <sequence>
      <element name="email" type="xsd:string"/>
      <element name="passwd" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="loginResponse">
    <complexType>
     <sequence>
      <element name="loginReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getCourses">
    <complexType/>
   </element>
   <element name="getCoursesResponse">
    <complexType>
     <sequence>
      <element name="getCoursesReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getCourseMarks">
    <complexType>
     <sequence>
      <element name="courseID" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>
   <element name="getCourseMarksResponse">
    <complexType>
     <sequence>
      <element name="getCourseMarksReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getStudentMarks">
    <complexType>
     <sequence>
      <element name="id" type="xsd:int"/>
     </sequence>
    </complexType>
   </element>
   <element name="getStudentMarksResponse">
    <complexType>
     <sequence>
      <element name="getStudentMarksReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="listTopics">
    <complexType/>
   </element>
   <element name="listTopicsResponse">
    <complexType>
     <sequence>
      <element name="listTopicsReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getTopicRegistrants">
    <complexType>
     <sequence>
      <element name="topicName" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getTopicRegistrantsResponse">
    <complexType>
     <sequence>
      <element name="getTopicRegistrantsReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
  </schema>
 </wsdl:types>

   <wsdl:message name="getStudentMarksRequest">

      <wsdl:part element="impl:getStudentMarks" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="listTopicsResponse">

      <wsdl:part element="impl:listTopicsResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getCourseMarksRequest">

      <wsdl:part element="impl:getCourseMarks" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getCourseMarksResponse">

      <wsdl:part element="impl:getCourseMarksResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getCoursesResponse">

      <wsdl:part element="impl:getCoursesResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getTopicRegistrantsResponse">

      <wsdl:part element="impl:getTopicRegistrantsResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getCoursesRequest">

      <wsdl:part element="impl:getCourses" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getTopicRegistrantsRequest">

      <wsdl:part element="impl:getTopicRegistrants" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="listTopicsRequest">

      <wsdl:part element="impl:listTopics" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getStudentMarksResponse">

      <wsdl:part element="impl:getStudentMarksResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="loginRequest">

      <wsdl:part element="impl:login" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="loginResponse">

      <wsdl:part element="impl:loginResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:portType name="Services">

      <wsdl:operation name="login">

         <wsdl:input message="impl:loginRequest" name="loginRequest">

       </wsdl:input>

         <wsdl:output message="impl:loginResponse" name="loginResponse">

       </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getCourses">

         <wsdl:input message="impl:getCoursesRequest" name="getCoursesRequest">

       </wsdl:input>

         <wsdl:output message="impl:getCoursesResponse" name="getCoursesResponse">

       </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getCourseMarks">

         <wsdl:input message="impl:getCourseMarksRequest" name="getCourseMarksRequest">

       </wsdl:input>

         <wsdl:output message="impl:getCourseMarksResponse" name="getCourseMarksResponse">

       </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getStudentMarks">

         <wsdl:input message="impl:getStudentMarksRequest" name="getStudentMarksRequest">

       </wsdl:input>

         <wsdl:output message="impl:getStudentMarksResponse" name="getStudentMarksResponse">

       </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="listTopics">

         <wsdl:input message="impl:listTopicsRequest" name="listTopicsRequest">

       </wsdl:input>

         <wsdl:output message="impl:listTopicsResponse" name="listTopicsResponse">

       </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getTopicRegistrants">

         <wsdl:input message="impl:getTopicRegistrantsRequest" name="getTopicRegistrantsRequest">

       </wsdl:input>

         <wsdl:output message="impl:getTopicRegistrantsResponse" name="getTopicRegistrantsResponse">

       </wsdl:output>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="ServicesSoapBinding" type="impl:Services">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="login">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="loginRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="loginResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getCourses">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getCoursesRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getCoursesResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getCourseMarks">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getCourseMarksRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getCourseMarksResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getStudentMarks">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getStudentMarksRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getStudentMarksResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="listTopics">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="listTopicsRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="listTopicsResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="getTopicRegistrants">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getTopicRegistrantsRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getTopicRegistrantsResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="ServicesService">

      <wsdl:port binding="impl:ServicesSoapBinding" name="Services">

         <wsdlsoap:address location="http://localhost:8080/semisterproject/services/Services"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
问题回答

The soap action is not necessarily required to call a web service...it depends on the implementation of operation selection algorithm (could, for instance, use the makeup of the request body). However, if the generated eclipse code is using annotations, you should be able to specify the desired soap action for the method in question using the @WebMethod annotation action attribute, as in @WebMethod(action="MyAction"). You can find a bit of documentation at this address: http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.wsfep.multiplatform.doc%2Finfo%2Fae%2Fae%2Frwbs_jaxwsannotations.html If this does not help, please post the relevant code to provide additional context.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签