bamboojohn 2016-05-04 08:20 采纳率: 0%
浏览 1281

java cxf webservice整合问题

jws代码:
@Service("iom4crm")
@WebService(targetNamespace = "http://service.iom.test.com/", serviceName="IOM4CRM")
public class Iom4Crm implements IIom4Crm{
@Override
@WebMethod(operationName = "exchange")
public String exchange(@WebParam(targetNamespace = "http://service.iom.test.com/")String data) {
}
}

cxf配置:
<?xml version="1.0" encoding="UTF-8"?>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />    
 <!-- 测试-->
<jaxws:endpoint id="IOM4CRM" implementor="#iom4crm"
  address="/IOM4CRM">
  <jaxws:features>
      <bean class="org.apache.cxf.feature.LoggingFeature" />
  </jaxws:features>
</jaxws:endpoint>
    </beans>

    问题:
    服务能正常发布,也能调用,但是生成的服务,请求格式soap报文为:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.iom.test.com/">

soapenv:Header/
soapenv:Body
ser:exchange
<!--Optional:-->
ser:arg0?/ser:arg0
/ser:exchange
/soapenv:Body

/soapenv:Envelope

现在想要请求的报文

soapenv:Header/
soapenv:Body
ns1:exchange
<!--Optional:-->
ns1:arg0?/ns1:arg0
/ns1:exchange
/soapenv:Body

/soapenv:Envelope

即命名空间前缀有ser修改为ns1,这个ser我也没设置,不知道哪里可以修改设置

  • 写回答

2条回答 默认 最新

  • bamboojohn 2016-05-04 08:24
    关注

    目前格式为:发布服务后,请求的soap报文格式为

    ```
    soapenv:Header/
    soapenv:Body
    ser:exchange
    <!--Optional:-->
    ser:arg0?/ser:arg0
    /ser:exchange
    /soapenv:Body
    /soapenv:Envelope

    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题