在Mule(CXF)中使用https / ssl Web服务

时间:2012-09-27 13:01:15

标签: ssl https cxf mule

我在MULE 3.3.0 CE中通过https / ssl使用.NET Web服务时出现此问题。我希望有人有个好主意来解决这个问题。 这在Mule外面很好用,使用CXF库(2.5.1)和相同的JRE(7)Mule使用。然后我想Mule也使用我已经安装了信任证书的jre密钥库。

我用wsdl2java生成了代理类。 该服务使用Web服务安全性UsernameToken,配置文件1.1。服务和服务器不受我的控制(这是一项公共服务)。

我知道我不使用mule出站传输来连接服务。我只是尝试从java类中创建和使用该服务。尝试了其他骡子配置,但没有运气。

这是我的mule-config:

<flow name="flow1" >
        <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8080/server" doc:name="HTTP endpoint"/>
        <jersey:resources doc:name="ServerResources RESTful service">
            <component class="my.code.ServerResourceImpl"/>
        </jersey:resources>
</flow>    

Innside ServerResourceImpl类我这样做:

service = new xWebService();
port = service.getBasicHttpBindingBalanseWebService();

Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
            reqContext.put("ws-security.username", "username");
            reqContext.put("ws-security.password", "password");

String s = port.test();

我可以成功创建服务,但是我对测试方法的调用失败并出现此错误: javax.xml.ws.soap.SOAPFaultException: An error occurred when verifying security for the message

任何有用的提示或想法都很受欢迎。谢谢

0 个答案:

没有答案