Your SOAP request seems to have no security info, can I see your client configuration please.
Your SOAP request seems to have no security info, can I see your client configuration please.
You're right; I'll take a look at my configuration and see if I can see why it is not picking that up. Here is my client config:
Code:<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="wireFxServiceClient" parent="abstractClient" class="com.pnc.wire.web.controller.WireFxServiceClient"> <property name="marshaller" ref="marshaller" /> <property name="unmarshaller" ref="marshaller" /> <property name="interceptors"> <bean class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor"> <property name="securementActions" value="Signature"/> <property name="securementUsername" value="wireUsr"/> <property name="securementPassword" value="wirePass"/> <property name="securementSignatureCrypto"> <bean class="org.springframework.ws.soap.security.wss4j.support.CryptoFactoryBean"> <property name="keyStorePassword" value="wirefx"/> <property name="keyStoreLocation" value="classpath:/WEB-INF/wireFx.jks"/> </bean> </property> </bean> </property> </bean> <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" /> <bean id="abstractClient" abstract="true"> <constructor-arg ref="messageFactory" /> <property name="defaultUri" value="http://localhost:9080/wire/services" /> </bean> <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="classesToBeBound"> <list> <value>com.pnc.wire.fx.model.FxRateRequest</value> <value>com.pnc.wire.fx.model.FxRateResponse</value> </list> </property> </bean> </beans>
vijay you little super star i have been looking for a step by step like this for a week now!
ok i am trying this now with a jaxb marshalled message from the client.
client applicationCtx.xml is
the class looks like thisCode:<bean id="client" class="Client"> <property name="marshaller" ref="marshaller"/> <property name="unmarshaller" ref="marshaller"/> <property name="defaultUri" value="http://localhost:8080/testWS/searchService"/> <property name="interceptors"> <list> <ref local="wsInterceptor"/> </list> </property> </bean> <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> <property name="contextPath" value="uk.co.was.schema"/> </bean> <bean id="wsInterceptor" class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor"> <property name="securementActions" value="UsernameToken"/> <property name="securementUsername" value="Ian"/> <property name="securementPassword" value="password"/> </bean>
and the exception is as followsCode:public static void main(String[] args) { ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml",Client.class); Client client = (Client) ctx.getBean("client",Client.class); client.getPolicies(); } public void getPolicies(){ PolicyHolderRequest req = jaxb.createPolicyHolderRequest(); req.setHolderName("param"); PolicyHolderResponse res = (PolicyHolderResponse) getWebServiceTemplate().marshalSendAndReceive(req); }
clearly something going in the web service template, i looked in the api docs and there is a version of marshalSendReceive that takes the Object and a callbackHandler - however my understanding on the Wss4j interceptor was that it did it for you, any clues anyone?Code:Exception in thread "main" org.springframework.ws.soap.client.SoapFaultClientException: One or more mandatory SOAP header blocks not understood at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:37) at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:668) at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:502) at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:440) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:289) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:283) at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:275) at Client.getPolicies(Client.java:31) at Client.main(Client.java:22)
Hi, i have error during compilation :
WSHandler: wrong part definition: {http://schema.mywebservice.com/xxx}a;
and my code is:
What is the problem ?Code:<property name="securementEncryptionParts" value="{http://schema.mywebservice.com/xxx}a"/>
Thanks.
Due to some insufficient data/credentials. The Security Header was not appended at the client side.
Please verify the digital security generation at the client side !!!
Note:
Keystore & Certificate file are mandatory at client side.
Keystore file is sufficient at server side.
Example Command to generate Certificate File from Key store
keytool -certreq -alias mydomain-keystore keystore.jks -file certi.csr