CXF WebService框架,发布服务,targetNamespace问题

萌B 萌B 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
1 服务点接口。

@WebService
public interface IHelloWorld {
public String getHellow( @WebParam(name="name") String name);
}

2 实现类

@WebService(endpointInterface="com.web.hellow.IHelloWorld",serviceName="Hellow")
public class HelloWorld implements IHelloWorld {
public String getHellow(String name) {
String str="你好,世界;你好,"+name;
return str;
}
}

3 暴露Web服务

public static void main(String[] args) {
String address="http://localhost:8000/hellow";
HelloWorld hellow = new HelloWorld();
Endpoint.publish(address, hellow);
}

以上生成正确wsdl,如下


targetNamespace为默认(包名倒置)
=============================================================
以上都没问题,我要修改targetNamespace为“http://aaa/”,代码如下

@WebService(targetNamespace="http://aaa/")
public interface IHelloWorld {
public String getHellow( @WebParam(name="name") String name);
}

-暴露服务生成wsdl如下

有如下几个问题:
1.targetNamespace并没有修改,而绿色划线处namespace被修改
2.wsdl的内容发生了很大变化

希望大神详细一些说明一下


...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
萌B
Web 开发 81,108 成员 341,721 内容