Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: M5 ws-handler error

  1. #1

    Default M5 ws-handler error

    I am upgrading from M3 snapshot to M5 for web service target .
    This is working fine in the old version.
    Here is the config :

    Code:
    <ws-handler id="holidaycalendar" uri="${holiday.webservice.url}" />
    
    <service-activator input-channel="holidayRequestChannel"
    	          ref="holidaycalendar"/>
    Is this config correct ? I didnt see any concrete example of ws-handler in the docs.

    I see the following exception :

    Code:
    org.springframework.ws.client.WebServiceTransportException: Not Found [404]
    	at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:590)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:514)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:465)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:420)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:366)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:357)
    	at org.springframework.integration.ws.handler.SimpleWebServiceHandler.doHandle(SimpleWebServiceHandler.java:67)
    	at org.springframework.integration.ws.handler.AbstractWebServiceHandler.handle(AbstractWebServiceHandler.java:74)
    	at org.springframework.integration.endpoint.HandlerEndpoint$HandlerInvokingTarget.send(HandlerEndpoint.java:136)
    	at org.springframework.integration.endpoint.TargetEndpoint.handleMessage(TargetEndpoint.java:103)
    	at org.springframework.integration.endpoint.TargetEndpoint.poll(TargetEndpoint.java:111)
    	at org.springframework.integration.endpoint.EndpointPoller.visitEndpoint(EndpointPoller.java:25)
    	at org.springframework.integration.endpoint.AbstractEndpoint.doSend(AbstractEndpoint.java:252)
    	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:225)
    	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:213)
    	at org.springframework.integration.dispatcher.AbstractDispatcher.sendMessageToTarget(AbstractDispatcher.java:74)
    	at org.springframework.integration.dispatcher.BroadcastingDispatcher.send(BroadcastingDispatcher.java:44)
    What could be the issue..

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Based on that stack trace, it actually appears to be working correctly, but you are receiving a 404 (not found). Can you double check that the URL you are passing is reachable?

    -Mark

  3. #3

    Default

    Yes..it is..
    It also works fine with the M3 snapshot version and ws-target config.

    I have SI M5 and Spring 1.5.3 .
    Do I need to upgrade to Spring 1.5.4A and Spring-WS 1.5.1.A for this to work ?

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    With Spring Integration M5, you should be using the following versions:
    Spring Framework: 2.5.4.A
    Spring Web Services: 1.5.1.A

    Please try those versions. However, the stack trace does show the correct series of methods being invoked and a 404 being received. Are there any other differences at all between your M3 version and this one? Are they pointing to the same properties file for that property placeholder you are using for the URL?

  5. #5

    Default

    We are wary of using intermediate versions i.e 1.5.4A etc and were hoping that M5 would be backward compatible with Spring 1.5.3 that we were using.

    Also.. no..there is no other difference in the other 2 versions that I can see and the property is fine as I had tried with the actual value in the uri too with the same error.

    One thing I would like is to have the config rechecked by you , as I dont see any example of the ws-handler (the one in Ref includes channel element which is actually not allowed in the ws-handler definition)

    Am I using the service-activator appropriately ?

    Code:
    <ws-handler id="holidaycalendar" uri="${holiday.webservice.url}" />
    <service-activator input-channel="holidayRequestChannel"
    	          ref="holidaycalendar"/>

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Spring 2.5.4.A is not an intermediate version (nor Spring-WS 1.5.1.A). To understand the meaning of the 'A' there, please read this entry from the SpringSource Enterprise Bundle Repository FAQ: https://www.springsource.com/repository/app/faq#q12

    The WebServiceDemo in the Spring Integration samples provides a working example of the ws-handler element. You can check it out in the org.springframework.integration.samples JAR file (and the associated 'sources' JAR), but here is the configuration:
    Code:
    <beans:beans xmlns="http://www.springframework.org/schema/integration"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:beans="http://www.springframework.org/schema/beans"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    			http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    			http://www.springframework.org/schema/integration
    			http://www.springframework.org/schema/integration/spring-integration-ws-1.0.xsd">
    
    	<message-bus/>
    
    	<channel id="fahrenheitChannel"/>
    
    	<!-- The service activator receives from the 'fahrenheitChannel',
    	     invokes the handler, and sends the reply Message to the 'celsiusChannel'. -->
    	<service-activator input-channel="fahrenheitChannel"
    	                   ref="temperatureConverter"
    	                   output-channel="celsiusChannel"/>
    
    	<!-- The handler invokes the WebService for the given URI and returns a reply Message. -->
    	<ws-handler id="temperatureConverter" 
    				uri="http://www.w3schools.com/webservices/tempconvert.asmx"/>
    
    	<!-- The response from the service is logged to the console. -->
    	<channel-adapter id="celsiusChannel" target="console"/>
    
    	<console-target id="console"/>
    
    </beans:beans>
    Are you providing a 'returnAddress' on the Message that you are sending to the ws-handler? If not, you probably want to specify an "output-channel" attribute.

  7. #7

    Default

    I tried with the Spring 1.5.4.A and spring -ws 1.5.1.A and still see the same issues. Has anything changed in the underlying implementation of WebServiceTemplate class ? I upped the log level and see the following now :
    Code:
    10:53:32,427 DEBUG [WebServiceTemplate] Opening [org.springframework.ws.transport.http.HttpUrlConnection@3e0339] to [http://myserver001/SDSServices/WebService/Gfp1.ASMX]
    10:53:32,521 DEBUG [sent] Sent request [SaajSoapMessage {http://www.my.sds.gfp1/}GetUSBankHolidays]
    10:53:33,411 DEBUG [WebServiceTemplate] Received error for request [SaajSoapMessage {http://www.my.sds.gfp1/}GetUSBankHolidays]
    10:53:33,411 WARN  [MessagePublishingErrorHandler] failure occurred in messaging task
    org.springframework.ws.client.WebServiceTransportException: Not Found [404]
    	at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:590)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:514)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:465)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:420)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:366)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:357)
    	at org.springframework.integration.ws.handler.SimpleWebServiceHandler.doHandle(SimpleWebServiceHandler.java:67)
    	at org.springframework.integration.ws.handler.AbstractWebServiceHandler.handle(AbstractWebServiceHandler.java:74)
    What could be the issue..anything about proxy setup etc that changed ?

  8. #8
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    The *only* change in the M5 version involves the configuration of the WebService MessageFactory. Please refer to these two issues for the details:
    http://jira.springframework.org/browse/INT-291
    http://jira.springframework.org/browse/INT-295

    If you need to set the messageFactory, the namespace now supports it. You can add the "message-factory" attribute to your <ws-handler/> element.

    Can you please provide the configuration for your working M3 version of the <ws-target/> element?

  9. #9

    Default

    I got it working now, but in a very weird way .. I was trying to intercept the webservice request through tcpmon and when I have
    -DproxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8988
    it apparently works fine, No 404 , rather a valid response back.

    If I remove the above system properties , it reverts back to 404.

    It seems like when it goes through the proxy , it is routed correctly, but going through pure spring webservice it sees some issues..

    Any explanation of this behavior ??

  10. #10
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    If you are running in an environment that requires a proxy configuration, then those system properties need to be provided. This is not directly related to either Spring Integration or Spring WS but rather the underlying java.net.HttpURLConnection (delegated to by Spring Web Services' default message sender strategy). No changes in Spring Integration or Spring Web Services versions would have affected this, so it seems to be an environmental difference. Are you running the M3 and M5 versions in exactly the same environment and from the same machine with exactly the same URL? Perhaps the run target/startup script for the M3 version already had these -D arguments specified? Any other differences?

    On a related note, you might find this article informative:
    http://gleichmann.wordpress.com/2007...rough-a-proxy/

    Regards,
    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •