首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有http:binding的wsimport

带有http:binding的wsimport
EN

Stack Overflow用户
提问于 2013-02-19 13:36:35
回答 1查看 1.3K关注 0票数 3
代码语言:javascript
复制
<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任务:

代码语言:javascript
复制
  <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>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-19 14:16:05

它确实会生成。你能检查一下*_Service.java文件吗。它们共享相同的QName,但有两个不同的端点。在您的例子中,会有如下代码

代码语言:javascript
复制
 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);
}

代码语言:javascript
复制
 @WebEndpoint(name = "MyServiceHttpport")
 public NewWSDLFile getNewWSDLFileSOAP(WebServiceFeature... features) {
    return super.getPort(new QName("http://www.example.org/NewWSDLFile/", 
   "MyServiceHttpport"), NewWSDLFile.class, features);
}

简单地拥有两个端口并不意味着每个端口类型都有单独的代码库

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14950569

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档