I was exhausted, because of the Amazon on our WebService course.

I expended nearly 2 days to solve some problems on the interoperation between Java Axis and .Net Client.

The error is always:
No serializer for cn.andy.amazon.AndyItem found in the org.apache.axis Registry.!!!

I should have been spending more time look for Resources.

I think it's due to the version confliction. I down the 1.2RC of Axis and it do nothing.

My Classmate give me a hypelink of axis when asking me solutions.
I look through the page, my god, exactly what I want.

Solution:
Axis know how to serialize javabean, but you should tell him which type is a javabean
to serialize in the server-config.wsdd.

put this in your server-config.wsdd according to your app:

<service name="SmsService" provider="java:RPC">
<parameter name="className" value="lius.axis.demo.SmsService"/>
<parameter name="allowedMethods" value="send"/>
<operation name="send" returnType="ns:Response">
<parameter name="msg" type="ns:Message"/>
</operation>

<!-- 这里定义了方法的参数以及返回值 -->

<typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"  
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns:Message"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:lius.axis.demo.Message" xmlns:ns="SmsService"/>

<typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns:Response"   
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"    type="java:lius.axis.demo.Response" xmlns:ns="SmsService"/>
</service>

Everything goes well now!

Resource:
http://www-900.ibm.com/developerWorks/cn/webservices/ws-deepaxis/index.shtml



版权所有 罗明
posted on 2005-04-07 12:54 罗明 阅读(182) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: