开发者社区 问答 正文

关于调用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 687 分享
分享
版权
举报
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 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答标签:
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等