Apache cfx 中使用 SOAP1.2

第一次使用apache cfx发现自动生成的wsdl是SOAP 1.1版本的。

Google上说加@BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)就可以,事实并非如此.

最后才发现cfx目前不支持自动生成soap1.2的wsdl,只能通过cfx的工具java2ws通过加参数-soap12去生成soap12的wsdl.

在spring的配置文件中使用wsdlLocation去设置手动生成的wsdl文件。wsdlLocation支持WEB-INF或classpath:方式配置。

 

visual studio 中使用 soap1.1 的方法 修改配置文件

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="ServiceHelloPortBinding" />
                <binding name="dogSoapBinding" />
                <binding name="UserServiceSoapBinding" />
            </basicHttpBinding>
            <customBinding>
                <binding name="UserServiceImplPort">
                    <textMessageEncoding messageVersion="Soap11" />
                    <httpTransport />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:9002/Service/ServiceHello"
                binding="basicHttpBinding" bindingConfiguration="ServiceHelloPortBinding"
                contract="ServiceReference1.ServiceHello" name="ServiceHelloPort" />
            <endpoint address="http://localhost:8080/ng/services/dog" binding="basicHttpBinding"
                bindingConfiguration="dogSoapBinding" contract="ServiceReference2.dog"
                name="dog" />
            <endpoint address="http://127.0.0.1/soap/user" binding="basicHttpBinding"
                bindingConfiguration="UserServiceSoapBinding" contract="ServiceReference3.UserService"
                name="UserServiceImplPort" />
        </client>
    </system.serviceModel>
</configuration>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值