简体   繁体   中英

Missing fields in auto generated WSDL

I wrote a java class in Eclipse for Java EE developers and used a webservice wizard to make it available as a web service.

I'm trying to invoke the methods in it from a java client, so I need the soap action and namespace, but can't find the SOAP action for my methods. The name space is set to defaultname space. What should the SOAP action URL be? Should I set them manually, the client test in Eclipse just goes well.

<?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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM