簡體   English   中英

部署Web服務(JAX-WS)時,WebSphere會修改我的WSDL。

[英]WebSphere modifies my WSDL when deploying a web service (JAX-WS)

每當我(使用管理員控制台)在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>

有兩種可能性。 如果您的@Webservice批注不包含wsdlLocation屬性,那么WebSphere不知道您的wsdl,並且正在生成一個。

當wsdl與應用程序打包在一起時,WebSphere將對其進行檢查並將其與代碼進行比較。 如果由於某種原因它與代碼不兼容(操作或參數不匹配,或者名稱空間不匹配等),則它將被忽略並生成另一個。

如果它傾向於第二個,則com.ibm.ws.websvcs。* = all的痕跡可能會提供信息。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM