2011-01-07 39 views
2

所以我有一個web服務,它從sql中的表中獲取一個標誌,它起作用。我現在試圖添加功能來設置相同的標誌。如果我只有一個輸入(即用戶名或標誌值),它可以很好地工作。但是,如果我嘗試將2個元素作爲輸入,當我的AXIS嘗試部署時,出現以下錯誤:AXIS:OperationDesc沒有同步到一個方法

org.jboss.axis.InternalException:java.lang.Exception:setDeskFlag的OperationDesc未同步到PWEndPoint的一種方法。

這裏是我的WSDL的修剪的版本:

<complexType name="getPWFlagRequest"> 
    <sequence> 
    <element name="alias" type="xsd:string" /> 
    </sequence> 
    </complexType> 

    <complexType name="getPWFlagResponse"> 
    <sequence> 
    <element name="result" type="xsd:string" /> 
    </sequence> 
    </complexType> 

    <complexType name="setPWFlagRequest"> 
    <sequence> 
    <element name="id" type="xsd:string" /> 
    <!-- Having this line gives the OperationDesc Synch Error --> 
    <element name="flag" type="xsd:string" /> 
    </sequence> 
    </complexType> 

    <complexType name="setPWFlagResponse"/> 

    <element name="getPWFlagRequest" type="types:getPWFlagRequest" /> 
    <element name="getPWFlagResponse" type="types:getPWFlagResponse" /> 

    <element name="setPWFlagRequest" type="types:setPWFlagRequest" /> 
    <element name="setPWFlagResponse" type="types:setPWFlagResponse" /> 
</schema> 
</types> 

<message name="PWEndPoint_getPWFlagRequest" > 
    <part name="parameter" element="types:getPWFlagRequest"/> 
</message> 
<message name="PWEndPoint_getPWFlagResponse"> 
    <part name="result" element="types:getPWFlagResponse"/> 
</message> 

<message name="PWEndPoint_setPWFlagRequest" > 
    <part name="parameters" element="types:setPWFlagRequest"/> 
</message> 
<message name="PWEndPoint_setPWFlagResponse"/> 

<portType name="PWEndPoint"> 
    <operation name="getPWFlag" > 
     <input message="service:PWEndPoint_getPWFlagRequest"/> 
     <output message="service:PWEndPoint_getPWFlagResponse"/> 
    </operation> 
    <operation name="setPWFlag" > 
     <input message="service:PWEndPoint_setPWFlagRequest"/> 
     <output message="service:PWEndPoint_setPWFlagResponse"/> 
    </operation> 
</portType> 


<binding name="PWResetBinding" type="service:PWEndPoint"> 
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
    <operation name="getPWFlag" > 
    <soap:operation soapAction="getPWFlag" /> 
    <input> 
    <soap:body use="literal" /> 
    </input> 
    <output> 
    <soap:body use="literal" /> 
    </output> 
    </operation> 
    <operation name="setPWFlag" > 
    <soap:operation soapAction="setPWFlag" /> 
    <input> 
    <soap:body /> 
    </input> 
    <output> 
    <soap:body use="literal" /> 
    </output> 
    </operation> 
</binding> 


<service name="PWService"> 
    <port name="PWEndPointPort" binding="service:PWResetBinding"> 
    <soap:address location="@[email protected]" /> 
    </port> 
</service> 

什麼我百思不得其解的是,它說,它有同步到PWEndPoint的方法的問題,而是由產生的Java2WSDL PWEndPoint。這裏是創建的界面:

public interface PWEndPoint extends java.rmi.Remote { 
    public java.lang.String getPWFlag(java.lang.String alias) throws 
     java.rmi.RemoteException; 
    public void setPWFlag(java.lang.String id, java.lang.String flag) throws 
    java.rmi.RemoteException; 
} 

爲什麼有2個輸入參數導致它無法正確部署?

回答

1

我找到了問題的根源。使用Document編碼時存在一個問題,以及我如何定義複雜類型。

我將它切換爲使用RPC,並修改了我如何定義解決問題的SetPWFlagRequest。