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
http://www.example.org/NewWSDLFile --> Consider this as Your Name Space
@WebEndpoint(name = "MyServiceSOAP11port_http")
public NewWSDLFile getNewWSDLFileSOAP1() {
return super.getPort(new QName("http://www.example.org/NewWSDLFile/",
"MyServiceSOAP11port_http"), NewWSDLFile.class);
}
and
@WebEndpoint(name = "MyServiceHttpport")
public NewWSDLFile getNewWSDLFileSOAP(WebServiceFeature... features) {
return super.getPort(new QName("http://www.example.org/NewWSDLFile/",
"MyServiceHttpport"), NewWSDLFile.class, features);
}
Simply having two ports would not mean separate code bases for each port type
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With