我创建了一个简单的类型
<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>
然后我使用来自axis2的wsdl2java创建存根,发送工作和接收似乎工作,直到我尝试从这种类型获取整数值。我的代码是这样的:
IntOrBlank get_part_custom_field7 = each_record[0].get_part_custom_field7(); 对象对象 = get_part_custom_field7.getObject();
该对象现在为空。即使 SOAP 消息是作为
<bm:_part_custom_field7>9</bm:_part_custom_field7>