【问题标题】:AXIS: The OperationDesc was not synchronized to a methodAXIS:OperationDesc 未与方法同步
【发布时间】:2011-06-05 12:42:19
【问题描述】:

所以我有一个从 sql 表中获取标志的 web 服务,它可以工作。我现在正在尝试添加设置相同标志的功能。如果我只有一个输入(即用户名或标志值),它可以完美运行。但是,如果我尝试将 2 个元素作为输入,则在我的 AXIS 尝试部署时会收到以下错误:

org.jboss.axis.InternalException: java.lang.Exception: setPWFlag 的 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="@url@" />
  </port>
 </service>

真正让我感到困惑的是,它说它与 PWEndPoint 中的方法同步有问题,但 PWEndPoint 是由 Java2WSDL 生成的。这是创建的界面:

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个输入参数会导致无法正常部署?

【问题讨论】:

    标签: wsdl axis


    【解决方案1】:

    我找到了问题的根源。使用文档编码以及定义复杂类型的方式存在问题。

    我将它切换为使用 RPC 并修改了我定义 SetPWFlagRequest 的方式,从而解决了问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-06
      • 2017-12-07
      • 1970-01-01
      • 2017-03-18
      相关资源
      最近更新 更多