• WebService wsdl没有types的问题


    刚学WebService就遇到一个问题,按视屏敲的代码,它生成的wsdl页面与自己的不一样,我的没有types,结构完全不同了

    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <!--
     Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. 
    -->
    <!--
     Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. 
    -->
    <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://impl.service.kiwifly.cn/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://impl.service.kiwifly.cn/" name="MyServiceImplService">
    <import namespace="http://service.kiwifly.cn/" location="http://localhost:8888/ns?wsdl=1"/>
    <binding xmlns:ns1="http://service.kiwifly.cn/" name="MyServiceImplPortBinding" type="ns1:IMyService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="add">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    <operation name="minus">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="MyServiceImplService">
    <port name="MyServiceImplPort" binding="tns:MyServiceImplPortBinding">
    <soap:address location="http://localhost:8888/ns"/>
    </port>
    </service>
    </definitions>
    百度了一下也有人遇到了这个问题,找了一会,终于找到了答案,原来接口实现类与接口必须要在一个包下面,否则就会出现这种情况,我的目录结构

    改成


    再重新发布就可以了!

    <span style="font-size:10px;">This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <!--
     Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. 
    -->
    <!--
     Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. 
    -->
    <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.kiwifly.cn/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://service.kiwifly.cn/" name="MyServiceImplService">
    <types>
    <xsd:schema>
    <xsd:import namespace="http://service.kiwifly.cn/" schemaLocation="http://localhost:8888/ns?xsd=1"/>
    </xsd:schema>
    </types>
    <message name="add">
    <part name="parameters" element="tns:add"/>
    </message>
    <message name="addResponse">
    <part name="parameters" element="tns:addResponse"/>
    </message>
    <message name="minus">
    <part name="parameters" element="tns:minus"/>
    </message>
    <message name="minusResponse">
    <part name="parameters" element="tns:minusResponse"/>
    </message>
    <portType name="IMyService">
    <operation name="add">
    <input message="tns:add"/>
    <output message="tns:addResponse"/>
    </operation>
    <operation name="minus">
    <input message="tns:minus"/>
    <output message="tns:minusResponse"/>
    </operation>
    </portType>
    <binding name="MyServiceImplPortBinding" type="tns:IMyService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="add">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    <operation name="minus">
    <soap:operation soapAction=""/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="MyServiceImplService">
    <port name="MyServiceImplPort" binding="tns:MyServiceImplPortBinding">
    <soap:address location="http://localhost:8888/ns"/>
    </port>
    </service>
    </definitions></span>

  • 相关阅读:
    StringBuider 在什么条件下使用效率更高?
    Hibernate 与 Mybatis 如何共存?打破你的认知!
    牛逼!OpenJDK 源码要迁移到 GitHub 了!
    别在网上乱找代码了,找了一段代码突然爆了!!!
    8 条关于 Web 前端性能的优化建议
    关于 equals 和 hashCode,看这一篇真的够了!
    Python web之Python如何调用REST服务?
    ArcGIS Server如何发布gp服务
    ArcGIS坐标单位转换(米和度分秒之间是如何转换的?)
    ArcGIS MapServer和FeatureServer的区别
  • 原文地址:https://www.cnblogs.com/kiwifly/p/4435862.html
Copyright © 2020-2023  润新知