webService傳遞參數後返回的是null

http://localhost:8080/axis2/services/SimpleService/getGreeting?name=abc

<ns:getGreetingResponse xmlns:ns="http://ws.apache.org/axis2">
<return>你好null</return>
</ns:getGreetingResponse>

返回的不是abc而是null

然後查看wsdl文件

<xs:element name="getGreeting">
- <xs:complexType>
- <xs:sequence>
  <xs:element minOccurs="0" name="args0" nillable="true" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
- <xs:element name="getGreetingResponse">

發現參數名字被wsdl轉換成args0了,然後重新傳遞試試
http://localhost:8080/axis2/services/SimpleService/getGreeting?args0=abc

<ns:getGreetingResponse xmlns:ns="http://ws.apache.org/axis2">
<return>你好abc</return>
</ns:getGreetingResponse>

已經解決

發佈了44 篇原創文章 · 獲贊 17 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章