I have following binding and service elements in my 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>
When I use wsimport on the above wsdl, it does generate code for “MyServiceSOAP11port_http” but not for “MyServiceHttpport”. Am I missing something?
My wsimport ANT task:
<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>
It does generate. Can you check the *_Service.java file. They both share the same QName but two different endpoints. In your case there would be code like
and
Simply having two ports would not mean separate code bases for each port type