
Originally Posted by
oleg.zhurakousky
Actually, this issue has already been addressed. See -
https://jira.springsource.org/browse/INT-1677
If you try the latest snapshot you can now use 'path' attribute to specify the path and its variables (e.g., path="/gateway/fname/{f}/lname/{l}) and the 'id' has been re-factored to be xsd:string so it is just a name that would be used for mapping. So now you can simply have two different gateways with different names.
Is the above configuration really working. The following is my configuration and I keep getting no mapping found error and the response errors out with HTTP status 404 Not Found. I am having hard time getting this to work. I would really appreciate if someone could throw some light into what might be the root cause.
SI application Context snippet.
Code:
<int-http:inbound-gateway id="inboundCustomerRestfulPhotoRequestGateway"
supported-methods="GET, POST"
request-channel="customerRestfulPhotoRequest"
reply-channel="customerRestfulPhotoResponse"
mapped-response-headers="Return-Status, Return-Status-Msg, HTTP_RESPONSE_HEADERS"
view-name="/photo"
path="/services/cis/fname/{fname}/lname/{lname}/dln/{dln}/dob/{dob}/photo"
reply-timeout="50000" >
<int-http:header name="fname" expression="#pathVariables.fname"/>
<int-http:header name="lname" expression="#pathVariables.lname"/>
<int-http:header name="dln" expression="#pathVariables.dln"/>
<int-http:header name="dob" expression="#pathVariables.dob"/>
</int-http:inbound-gateway>
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="order" value="1" />
<property name="defaultContentType" value="application/xml"/>
<property name="ignoreAcceptHeader" value="true" />
<property name="favorParameter" value="true"/>
<property name="mediaTypes">
<map>
<entry key="json" value="application/json" />
<entry key="xml" value="application/xml" />
</map>
</property>
<property name="defaultViews">
<list>
<bean
class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" />
<bean class="org.springframework.web.servlet.view.xml.MarshallingView">
<constructor-arg ref="marshaller"/>
</bean>
</list>
</property>
</bean>
Server Log Snippet:
Code:
2011-11-14 17:29:40,987 DEBUG [org.springframework.security.access.vote.AffirmativeBased] - Voter: org.springframework.security.web.access.expression.WebExpressionVoter@14bbd50, returned: 1
2011-11-14 17:29:41,050 DEBUG [org.springframework.security.web.access.intercept.FilterSecurityInterceptor] - Authorization successful
2011-11-14 17:29:41,050 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.integration.internalMessagingAnnotationPostProcessor'
2011-11-14 17:29:41,050 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'org.springframework.integration.config.IdGeneratorConfigurer#0'
2011-11-14 17:29:41,050 DEBUG [org.springframework.security.web.access.intercept.FilterSecurityInterceptor] - RunAsManager did not change Authentication object
2011-11-14 17:29:41,050 DEBUG [org.springframework.security.web.FilterChainProxy] - /services/cis/fname/Rahul/lname/Bose/dln/1234567/dob/2011-10-11/photo reached end of additional filter chain; proceeding with original chain
2011-11-14 17:29:41,097 DEBUG [org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet with name 'Destiny Customer Information Search Restful Web Service' processing POST request for [/cis-ws/services/cis/fname/Rahul/lname/Bose/dln/1234567/dob/2011-10-11/photo]
2011-11-14 17:29:41,097 WARN [org.springframework.web.servlet.PageNotFound] - No mapping found for HTTP request with URI [/cis-ws/services/cis/fname/Rahul/lname/Bose/dln/1234567/dob/2011-10-11/photo] in DispatcherServlet with name 'Destiny Customer Information Search Restful Web Service'
2011-11-14 17:29:41,097 DEBUG [org.springframework.security.web.context.HttpSessionSecurityContextRepository] - The HttpSession is currently null, and the HttpSessionSecurityContextRepository is prohibited from creating an HttpSession (because the allowSessionCreation property is false) - SecurityContext thus not stored for next request
2011-11-14 17:29:41,097 DEBUG [org.springframework.web.servlet.DispatcherServlet] - Successfully completed request
Thanks,
Vigil