【问题标题】:WebSphere modifies my WSDL when deploying a web service (JAX-WS)WebSphere 在部署 Web 服务 (JAX-WS) 时修改了我的 WSDL
【发布时间】:2016-08-24 15:03:21
【问题描述】:

每当我在 WebSphere(使用管理员控制台)中部署我的 Web 服务(作为 .WAR)时,它似乎都会修改其 WSDL 以将其分离为 WSDL 和 XSD(基本上删除了 WSDL 类型的内联)。它还将其重命名为 GetGedDoc.wsdl(原名为 GetGedDocumentService.wsdl)。

我对此没有任何真正的问题,但 XSD 重命名了所有参数 arg0、arg1 等...并使它们全部可选。

如何防止这种非常烦人的行为?

我真的不知道您可以使用什么代码来诊断问题,但无论如何这是我的 WSDL。

<?xml version="1.0" encoding="UTF-8"?><!-- Generated by JAX-WS RI (http://jax-ws.java.net). 
    RI's version is JAX-WS RI 2.2.10 svn-revision#IBM 2.2.10-12/21/2015 12:33:25 
    PM(foreman)-. -->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" name="GetGedDocumentService"
    targetNamespace="http://cm.web.dsidiff.fr/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://cm.web.dsidiff.fr/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
    xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <types>
        <xsd:schema targetNamespace="http://cm.web.dsidiff.fr/">
            <xsd:element name="parameters" type="tns:getDocument"/>
            <xsd:complexType name="getDocument">
                <xsd:sequence>
                    <xsd:element minOccurs="1" name="pid" type="xsd:string" />
                    <xsd:element minOccurs="1" name="login" type="xsd:string" />
                    <xsd:element minOccurs="1" name="pwd" type="xsd:string" />
                    <xsd:element minOccurs="1" name="numClient" type="xsd:string" />
                    <xsd:element minOccurs="0" name="numCompte" type="xsd:string" />
                    <xsd:element minOccurs="0" name="itemType" type="xsd:string" />
                    <xsd:element minOccurs="0" name="typeDoc" type="xsd:string" />
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="result" type="xsd:string" />
        </xsd:schema>
    </types>
    <message name="getDocument">
        <part element="tns:parameters" name="parameters" />
    </message>
    <message name="getDocumentResponse">
        <part element="tns:result" name="result" />
    </message>
    <portType name="GetGedDocService">
        <operation name="getDocument">
            <input message="tns:getDocument"/>
            <output message="tns:getDocumentResponse" />
        </operation>
    </portType>
    <binding name="GetGedDocSOAP" type="tns:GetGedDocService">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
        <operation name="getDocument">
            <soap:operation soapAction="http://localhost:9080/DSI_CMDK_WS/getDocument" />
            <input>
                <soap:body use="literal" />
            </input>
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
    </binding>
    <service name="GetGedDocService">
        <port binding="tns:GetGedDocSOAP" name="GetGedDocSOAP">
            <soap:address location="http://localhost:9080" />
        </port>
    </service>
</definitions>

【问题讨论】:

标签: java web-services wsdl websphere jax-ws


【解决方案1】:

有几种可能性。如果您的 @Webservice 注释不包含 wsdlLocation 属性,那么 WebSphere 不知道您的 wsdl 并且正在生成一个。

当 wsdl 与应用程序打包在一起时,WebSphere 将检查它并将其与代码进行比较。如果由于某种原因它与代码不兼容(操作或参数不匹配,或者命名空间不匹配等),那么它将被忽略并生成另一个。

如果它倾向于第二个,则 com.ibm.ws.websvcs.*=all 的痕迹可能会提供信息。

【讨论】:

  • 有道理!我将如何进行“跟踪 com.ibm.ws.websvcs.*=all”?我对 Eclipse/Rational/WebSphere 非常缺乏经验。
  • 在管理控制台中,故障排除 -> 日志和跟踪 ->(服务器) -> 更改详细信息级别,选择“运行时”选项卡,将 *=info 更改为 *=info:com.ibm。 ws.websvcs.*=全部。如果您希望它在服务器重新启动时保持不变,请选中“保存对配置的更改”复选框。点击确定,点击保存。输出将在 trace.log 中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多