我的 wsdl 中有以下绑定和服务元素:
<wsdl:binding name="MyServiceSOAP11Binding" type="impl:MyServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getProjects4Me">
<soap:operation soapAction="getProjects4Me" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="MyServiceHttpBinding" type="impl:MyServicePortType">
<http:binding verb="POST"/>
<wsdl:operation name="getProjects4Me">
<http:operation location="MyService/getProjects4Me"/>
<wsdl:input>
<mime:content type="text/xml" part="getProjects4Me"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="getProjects4Me"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MyService">
<wsdl:port name="MyServiceSOAP11port_http" binding="impl:MyServiceSOAP11Binding">
<soap:address location="http://shop.my.com:80//services/MyService"/>
</wsdl:port>
<wsdl:port name="MyServiceHttpport" binding="impl:MyServiceHttpBinding">
<http:address location="http://shop.my.com:80/services/MyService"/>
</wsdl:port>
</wsdl:service>
当我在上述 wsdl 上使用 wsimport 时,它会为“MyServiceSOAP11port_http”生成代码,但不会为“MyServiceHttpport”生成代码。我错过了什么吗?
我的 wsimport ANT 任务:
<target name="wsimport">
<exec executable="${jdk.home}/bin/wsimport">
<arg line="-keep -s ../wsimportsrc -p com.sample -verbose
-d ../wsimportclasses ../wsdl_xsd/MyService.xml"/>
</exec>
</target>