未显示JAX-WS类型元素

时间:2011-05-31 17:10:02

标签: java types jax-ws

我会尽量让这个问题变得清晰

我有一个带有多个JAX-WS Web服务的Java EAR项目文件。

每个Web服务都有一个导入模式XSD文件的元素。

如果我访问项目中的wsdl文件,则该元素存在。

如果我从客户端(浏览器)访问相同的wsdl,则不显示该元素。

任何人都知道为什么会这样?

来自项目的WSDL:

...
  // The following lines <types> ate miissing on the WSDL when accessed from the client (browser)
  <types>
    <xsd:schema>
      <xsd:import namespace="http://xxxxx.call/" schemaLocation="Callxxxxx_schema.xsd"/>
    </xsd:schema>
  </types>
  ...
  <service name="Call_xxxxxx">
    <port name="Call_xxxxxPort" binding="tns:Call_xxxxxPortBinding">
      <soap:address location="http://srv-can01-dev.teste.lab:9081/MyModule/Call_xxxxx"/>
    </port>
  </service>
  ...

(相同)客户端的WSDL:

...
  //<types> part missing when accessing from the client (browser)
  ...
  <service name="Call_xxxxx">
    <port name="Call_xxxxxPort" binding="tns:Call_xxxxxPortBinding">
      <soap:address location="http://machineIp:9081/MyModule/Call_xxxxx"/>
    </port>
  </service>
  ...

1 个答案:

答案 0 :(得分:0)

@RedEagle:尝试一些事情让我知道结果: - i)将.wsdl extn文件重命名为.xml文件,并使用浏览器将其打开。看看它是否正常。

ii)从浏览器中查看“查看源”以查看浏览器实际收到的内容。

iii)确保没有基于html或XML的评论标签。

iv)最后,而不是<xsd:import>,在WSDL文件中定义您的XML元素/类型,看看它是否有效。