开发者社区> 问答> 正文

关于调用webservice接口问题?报错

try {
            String endpoint = "http://localhost/smsmachine/services/smsweb?wsdl";
            // 直接引用远程的wsdl文件
            // 以下都是套路
            Service service = new Service();
            Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(endpoint);
            call.setOperationName("notifySmsDeliveryReport");// WSDL里面描述的接口名称
            call.addParameter("userName", org.apache.axis.encoding.XMLType.XSD_DATE, javax.xml.rpc.ParameterMode.IN);// 接口的参数
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);// 设置返回类型
//            String temp = "测试人员";
            DeliveryReport temp = new DeliveryReport();
            String result = (String) call.invoke(new Object[] { temp });
            // 给方法传递参数,并且调用方法
            System.out.println("result is " + result);
        } catch (Exception e) {
            System.err.println(e.toString());

        }

报错
java.io.IOException: No serializer found for class aaaa.DeliveryReport in registry org.apache.axis.encoding.TypeMappingDelegate@8931cf


展开
收起
爱吃鱼的程序员 2020-06-14 18:21:12 656 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    <imgsrc="http://www.oschina.net/js/ke/plugins/emoticons/images/41.gif"alt="">呵呵返回的是对象 吧?没有序列化

    2020-06-14 18:21:29
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
fibjs 模块重构从回调到协程--陈垒 立即下载
fibjs 模块重构从回调到协程 立即下载
建立联系方法之一 立即下载