Announcement Announcement Module
Collapse
No announcement yet.
No endpoint mapping found for SaajSoapMessage ... EncryptedData Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No endpoint mapping found for SaajSoapMessage ... EncryptedData

    Hi all,

    I'm facing the issue WARN - No endpoint mapping found for [SaajSoapMessage {http://www.w3.org/2001/04/xmlenc#}EncryptedData] when trying to encrypt a SOAP message using my own keystore with X509 standard.

    I have developed a producer and consumer and both of them were working fine if the SOAP message is signed using my own keystore with x509.
    But when I added encryption for the SOAP message, I got that error.

    Here is my client configuration
    - securityPolicy-client.xml
    <xwss:SecurityConfiguration dumpMessages="true"
    xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">

    <xwss:Sign includeTimestamp="false">
    <xwss:X509Token certificateAlias="client" />
    </xwss:Sign>

    <xwss:RequireSignature requireTimestamp="false" />

    <!-- ******************************* -->
    <xwss:Encrypt>
    <xwss:X509Token certificateAlias="client" keyReferenceType="Identifier"/>
    <xwss:KeyEncryptionMethod algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
    <xwssataEncryptionMethod algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
    </xwss:Encrypt>

    <xwss:RequireEncryption />
    </xwss:SecurityConfiguration>

    - ws-client.xml
    <bean id="keyStore"
    class="org.springframework.ws.soap.security.suppor t.KeyStoreFactoryBean">
    <property name="password" value="changeit" />
    <property name="location" value="classpath:client.jks" />
    </bean>

    <bean id="keyStoreHandler"
    class="org.springframework.ws.soap.security.xwss.c allback.KeyStoreCallbackHandler">
    <property name="keyStore" ref="keyStore" />
    <property name="trustStore" ref="keyStore" />
    <property name="privateKeyPassword" value="changeit" />
    <property name="defaultAlias" value="client" />
    </bean>

    <bean id="wsSecurityInterceptor"
    class="org.springframework.ws.soap.security.xwss.X wsSecurityInterceptor">
    <property name="policyConfiguration" value="classpath:securityPolicy-client.xml" />
    <property name="callbackHandlers">
    <list>
    <ref bean="keyStoreHandler" />
    </list>
    </property>
    </bean>

    Here is my server configuration
    - securityPolicy-server.xml
    <xwss:SecurityConfiguration dumpMessages="true"
    xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">

    <xwss:Sign includeTimestamp="false">
    <xwss:X509Token certificateAlias="service" />
    </xwss:Sign>

    <xwss:RequireSignature requireTimestamp="false" />

    <!-- ******************************* -->
    <xwss:Encrypt>
    <xwss:X509Token certificateAlias="service" keyReferenceType="Identifier"/>
    <xwss:KeyEncryptionMethod algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"/>
    <xwssataEncryptionMethod algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
    </xwss:Encrypt>

    <xwss:RequireEncryption />
    </xwss:SecurityConfiguration>

    - ws-service.xml
    <bean id="keyStoreHandler"
    class="org.springframework.ws.soap.security.xwss.c allback.KeyStoreCallbackHandler">
    <property name="trustStore" ref="trustStore" />
    <!-- <property name="keyStore" ref="trustStore" /> -->
    <!--
    <property name="privateKeyPassword" value="changeit" />
    <property name="defaultAlias" value="service" />
    -->
    </bean>

    <bean id="trustStore"
    class="org.springframework.ws.soap.security.suppor t.KeyStoreFactoryBean">
    <property name="location" value="classpath:service.jks" />
    <property name="password" value="changeit" />
    </bean>

    <bean id="wsSecurityInterceptor"
    class="org.springframework.ws.soap.security.xwss.X wsSecurityInterceptor">
    <property name="policyConfiguration" value="classpath:securityPolicy-server.xml" />
    <property name="secureResponse" value="false" />
    <property name="callbackHandlers">
    <list>
    <ref bean="keyStoreHandler" />
    </list>
    </property>
    </bean>

    Please see below for the details of logs

    Exception in thread "main" org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
    at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:627)
    at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:551)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:502)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 351)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 345)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 337)
    at com.copart.c2.sample.ws.client.SaleListInvoker.sen dSOAPMessage(SaleListInvoker.java:31)
    at com.copart.c2.sample.ws.client.SaleListClientTest. main(SaleListClientTest.java:12)
    ....
    146298 INFO - Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
    146564 INFO - FrameworkServlet 'ws': initialization completed in 8611 ms
    148095 WARN - No endpoint mapping found for [SaajSoapMessage {http://www.w3.org/2001/04/xmlenc#}EncryptedData]
    236388 WARN - No endpoint mapping found for [SaajSoapMessage {http://www.w3.org/2001/04/xmlenc#}EncryptedData]
    259547 WARN - No endpoint mapping found for [SaajSoapMessage {http://www.w3.org/2001/04/xmlenc#}EncryptedData]





    Any help would be much appreciated,

    Thanks a lot

  • #2
    Can you show your endpoint mapping bean please?

    Comment


    • #3
      Thanks Tareq for your response.

      Here is my endpoint mapping.

      package com.test.sample.application.endpoint;

      @Endpoint
      public class MarshallingTestListEndpoint
      {
      private static final String GET_TESTDETAIL_REQUEST = "GetTestDetailRequest";

      private static final String NAMESPACE = "http://test.com/sample/testlist/schemas";

      private ObjectFactory objectFactory = new ObjectFactory();

      @PayloadRoot(localPart = GET_TESTDETAIL_REQUEST, namespace = NAMESPACE)
      public JAXBElement<com.test.ws.testlist.schema.TestDetail > getTestDetail(
      GetLotDetailRequest request) throws Exception
      {

      .....
      }

      }


      Originally posted by tareq View Post
      Can you show your endpoint mapping bean please?

      Comment


      • #4
        I think tareq wanted the actually bean information.. not the java class..

        An example is:

        Code:
        <bean id="endpointMappingEncryption"
        		class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
        		<property name="mappings">
        			<props>
        				<prop key="{http://www.blah.com/ws/schemas}helloWorldEncryptionRequest">helloWorldEncryptionEndpoint</prop>
        			</props>
        		</property>
        		<property name="interceptors">
        			<list>
        				<bean
        					class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor" />
        				<ref bean="wsEncryptionInterceptor" />
        			</list>
        		</property>
        	</bean>

        I am also getting the same issue so if anyone could help that would be great!

        Comment


        • #5
          My issue resolved

          My issue had to deal with the fact that i was encrypting the entire message. When i changed my client's encryption security interceptor to add the following:

          Code:
          property name="securementEncryptionParts"
              		value="{Content}{http://www.test.com/ws/schemas}testRequest"/>
          Now it is only encrypting the content section of that request and you don't have to change anything on the server side.

          Comment

          Working...
          X