Tuesday, May 25, 2010

Modify WSDL to get the java client generated right

I have to generate java client for this WSDL. However the bean generated is not what i expect. The reason is the SOAP response format actually looks like this:

<data>
<field id="field1"><field>
<field id="field2"><field>
...
</data>


The bean generated is like this:

public Class Response{
Field[] data;
....
}

I failed to get the value of each . The Field class does not provide a getValue method. Instead it provides getId method which returns the field id.

I had 2 solutions:

1) Modify the generated java web-service client code. (Those serializer, deserializer etc)
2) Modify the WSDL to get the code generated as according to what i want.

I chose the second option.

I commented this segment of the WSDL:

<xsd:element maxOccurs="unbounded" name="field">
<xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1" />
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
</xsd:element>


I replace the above segment with:

<maxoccurs="unbounded" minoccurs="0" name="field" nillable="true" type="xsd:string"/>

Done!

Monday, May 3, 2010

大马来商业圈

劳动节当日,前往马六甲。

堵车严重,从收费站算起大概有整二公里长的车龙吧,塞到南北大道来。借用当年一位部长的逻辑:马来西亚真繁荣、人民真有钱,打汽油像在喝开水。

收费站是一堵,城市内更是大大堵,炎热的天气助长体内火气,直想破口大骂发泄一番。

有一个地区叫爱极乐,真是大大变,比起当年我离开马六甲时多了很多很多的建筑物。

进去绕绕,有一间特大的《买定》商场,气势非凡。商场周围有好多好多的店、好多好多的车、好多好多的友族同胞。

看来 马哈蒂 梦想中的繁荣马来商业区就是那样的了,而 阿里路斯坦 先生已经帮 马哈蒂 完愿了,中央政府和其他州政府也能以这为榜样,马哈蒂 此生无憾矣。