zoukankan      html  css  js  c++  java
  • axis调用cxf的webservice注意事项

    需要注意的是:

     1.wsdl显示部分内容

    <?xml version="1.0" ?>
    - <wsdl:definitions name="ArchiveFileServiceImplService" targetNamespace="http://impl.ws.file.lantop.im.avicit/" xmlns:ns1="http://ws.file.lantop.im.avicit/" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://impl.ws.file.lantop.im.avicit/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    1,cxf服务端定义webservice接口的时候,要在接口类上注解@WebService(targetNamespace="http://xxxx.xxxx.webservice.xxxxx.com.cn"); 命名空间必不可缺,否则抛异常如下:
    org.apache.cxf.interceptor.Fault: Unexpected wrapper element {http://service.jx4a.services.ismp.sitech.com}addUser found.   Expected {http://service.master.webservice.venustech.com.cn}addUser.

      例如:

      @WebService(targetNamespace="http://impl.ws.file.lantop.im.avicit/")
      public interface ArchiveFileService {}


    2,public String addUser(@WebParam(name="requestData") String requestXml); 定义的方法名,也要加上注解@WebParam,否则抛异常如下:
    org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"", local:"xxxxx"). Expected elements are <{}arg0>

      例如:

      @WebMethod(operationName = "uploadAttachment")
      @WebResult(name = "result")
      public int uploadAttachment(@WebParam(name = "fileId") String fileId, @WebParam(name = "buffer") byte[] buffer, @WebParam(name = "offset") int           offset,@WebParam(name = "dataId") String dataId);

  • 相关阅读:
    【bzoj 2159】Crash 的文明世界
    【bzoj 4833】[Lydsy1704月赛]最小公倍佩尔数
    【解题报告】网络流24题
    【bzoj 4449】[Neerc2015]Distance on Triangulation
    【ARC 063F】Snuke's Coloring 2
    【LOJ 6041】「雅礼集训 2017 Day7」事情的相似度
    【AGC 005F】Many Easy Problems
    【AGC 002F】Leftmost Ball
    替罪羊树
    状压dp
  • 原文地址:https://www.cnblogs.com/PengChengLi/p/8073666.html
Copyright © 2011-2022 走看看