生成的存根可讀我已經創建了一個簡單類型WSDL與int類型或空白是不是由WSDL2Java的
<xsd:simpleType name="IntOrBlank"> <xsd:union memberTypes="xsd:int"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value=""/> </xsd:restriction> </xsd:simpleType> </xsd:union> </xsd:simpleType>
然後我創建使用的WSDL2Java從Axis2中,發送作品存根和接收似乎直到我嘗試從這種類型獲取整數值。我的代碼是這樣的:
IntOrBlank get_part_custom_field7 = each_record [0] .get_part_custom_field7(); Object object = get_part_custom_field7.getObject();
該對象現在爲空。 eventhough SOAP消息即將在作爲
<bm:_part_custom_field7>9</bm:_part_custom_field7>
這根本不回答問題。在這種情況下使用工會有什麼選擇? – 2011-06-28 15:01:00
@mR_fr:另一種方法是將需求更改爲不需要'union',否則不要使用存根,而是直接處理XML。在編程語言環境中,'union'沒有多大意義。 – 2011-06-28 15:15:13