> My client code is:
>
> ClassPathXmlApplicationContext context = new
> ClassPathXmlApplicationContext(new String[] { "cxf-client.xml" });
> QueryServicePortType port = context.getBeanFactory().getBean("utClient");
> port.search("query");
>
> What should I do to get the UsernameToken policy in the wsdl working? Sorry,
> the examples I find on the web are confusing.
That should be all that you need to do PROVIDING you have all the required CXF
jars for that. That would include the cxf-rt-ws-policy, cxf-rt-ws-addr, and
cxf-rt-ws-security.
Dan
On Wednesday, August 17, 2011 9:40:08 AM Penmatsa, Vinay wrote:
> Hi,
> I have the wsdl for a service from which I generated the client stubs. I
> have the following configuration:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:http="http://cxf.apache.org/transports/http/configuration"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:cxf="http://cxf.apache.org/core"
> xmlns:p="http://cxf.apache.org/policy"
> xmlns:sec="http://cxf.apache.org/configuration/security"
> xsi:schemaLocation=" http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
> http://cxf.apache.org/transports/http/configuration
> http://cxf.apache.org/schemas/configuration/http-conf.xsd
> http://cxf.apache.org/configuration/security
> http://cxf.apache.org/schemas/configuration/security.xsd
> http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
> http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd">
>
> <jaxws:client
> xmlns:ns1="http://webservice.ns.com"
> id="utClient"
> serviceClass="com.ns.webservice.QueryServicePortType"
> serviceName="ns1:QueryServiceService"
> endpointName="ns1:QueryServicePortSoap11"
> address="http://localhost:9101/services/Soap11Endpoint"
>
>
> <jaxws:properties>
> <entry key="ws-security.username" value="buyer42" />
> <entry key="ws-security.password" value="password" />
> <entry key="ws-security.callback-handler"
> value="com.cxftest.client.ClientPasswordCallback"/> </jaxws:properties>
>
> </jaxws:client>
>
> </beans>
>
> My client code is:
>
> ClassPathXmlApplicationContext context = new
> ClassPathXmlApplicationContext(new String[] { "cxf-client.xml" });
> QueryServicePortType port = context.getBeanFactory().getBean("utClient");
> port.search("query");
>
> What should I do to get the UsernameToken policy in the wsdl working? Sorry,
> the examples I find on the web are confusing.
>
>
> Thanks
> Vinay
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com