Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: WebServiceTransportException

  1. #1
    Join Date
    Jan 2008
    Posts
    4

    Default WebServiceTransportException

    I've followed the tutorial carefully and was able to access the WSDL from a browser. I'm building the client which seems very simple but the result ends in:

    <02.01 09:14:50> <SaajSoapMessageFactory.java:111> <Creating SAAJ 1.2 MessageFactory>
    Exception in thread "main" org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
    at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:483)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:407)
    at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:358)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:304)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendSourceAndReceiveToResult(WebServiceTemplat e.java:289)
    at reservationClientSpring.clientTest.main(clientTest .java:17)

    This does not appear to be a classpath error and I have not been able to track down a cause (what isn't it finding?). The MessageFactory, MessageSender and DefaultUri are all being injected correctly (ie. wst is initialized). The following is the client code:

    private WebServiceTemplate wst = new WebServiceTemplate();

    public String call(String message) {
    StreamSource source = new StreamSource(new StringReader(message));
    StreamResult result = new StreamResult();
    wst.sendSourceAndReceiveToResult(source, result);
    return result.toString();
    }

    public void setDefaultUri(String defaultUri) { wst.setDefaultUri(defaultUri); }
    public void setMessageFactory(WebServiceMessageFactory messageFactory) { wst.setMessageFactory(messageFactory); }
    public void setMessageSender(WebServiceMessageSender messageSender) { wst.setMessageSender(messageSender); }

    I have tried both the SAAJ and Axiom message factories, the Spring and Jakarta message senders. The following are the config entries:

    <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMe ssageFactory" />

    <bean id="clientTest" class="reservationClientSpring.ClientTest">
    <property name="defaultUri" value="http://localhost:8080/reservationService"/>
    <property name="messageFactory" ref="messageFactory"/>
    <property name="messageSender">
    <bean class="org.springframework.ws.transport.http.HttpU rlConnectionMessageSender">
    <!-- <property name="url" value="http://localhost:8080/reservationService"/> -->
    </bean>
    </property>
    </bean>

    Interesting to note that the 'url' property resulted in an error (so I commented it out).
    Last edited by maneri; Feb 1st, 2008 at 03:36 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4

    Default No endpoint mapping found for [SaajSoapMessage statusRequest]

    I noticed this message from the service (as opposed to the client) which is leading me in a different direction. Even though 'statusRequest' exists the client does not seem to see it. I had my endpoint mapped as:

    <property name="mappings">
    <props>
    <prop key="{http://localhost:8080/reservationService}statusRequest">reservationEndpo int</prop>
    </props>
    </property>

    I also tried:

    <prop key="{http://localhost:8080/WEB-INF/shemas}statusRequest">reservationEndpoint</prop>

    but ended up using:

    <property name="defaultEndpoint" ref="reservationEndpoint"/>

    I'm not sure what the proper URI is supposed to be.
    Last edited by maneri; Feb 4th, 2008 at 10:29 AM.

  3. #3
    Join Date
    Mar 2008
    Posts
    2

    Default

    I'm getting a similar message. How does one debug this? What is not being found?



    org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
    at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:483)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:407)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 264)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 252)

  4. #4
    Join Date
    Jan 2008
    Posts
    4

    Default Debug

    There was no debug help, simply trial and error. I used the default mapping method which is acceptable for me (for now). The URI I'm using is http://localhost:8080/reservationService

  5. #5
    Join Date
    Mar 2008
    Posts
    2

    Default

    Our error turned out to be because the devloper was using global class variables to form the request object and send it. When I moved the global variables from the class level to the method the user of the client called to send the request, everything worked.

  6. #6
    Join Date
    Jan 2008
    Location
    Pisa, Italy
    Posts
    23

    Default org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]

    Quote Originally Posted by OldSchoolio View Post
    Our error turned out to be because the devloper was using global class variables to form the request object and send it. When I moved the global variables from the class level to the method the user of the client called to send the request, everything worked.
    What?!? b

    I also have the same error and I don't know how to get through this!
    What did you do? I've no global variables... please, can you show me your code?

    Cheers,
    Ivan

  7. #7
    Join Date
    Jan 2008
    Location
    Pisa, Italy
    Posts
    23

    Default org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]

    That's error is driving me crazy!
    It's the whole day I'm trying to get rid of this error:

    org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
    at org.springframework.ws.client.core.WebServiceTempl ate.handleError(WebServiceTemplate.java:475)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:399)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 256)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 244)
    at org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 236)
    at org.homelinux.elabor.nemo.webservice.NemoWebServic eClient.loadNetworkMap(NemoWebServiceClient.java:1 3)
    at org.homelinux.elabor.nemo.webservice.NemoWebServic eClientTestCase.testLoadNetworkMapClient(NemoWebSe rviceClientTestCase.java:26)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:164 )
    ............

    but I don't understand which is the problem!

    On the server side the wsdl is dynamically created and published correctly.
    But when I try to use my WebService I obtain that error above.
    It happens when I invoke the marshalSendAndReceive method of my client (that extends WebServiceGatewaySupport).

    I also checked the paylodMapping and it's ok...

    Where's the problem?!
    Please, help!

    Thank you anyway!
    Ivan

  8. #8
    Join Date
    Jan 2008
    Location
    Pisa, Italy
    Posts
    23

    Default org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]

    No lucky today

    I tried to restart with another webservice but I have the very same problem:

    Code:
    org.springframework.ws.client.WebServiceTransportException: Not Found [404]
    	at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:483)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:407)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:264)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:252)
    	at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:244)
    	at org.homelinux.elabor.forecast.consumer.ForecastClient.forecast(ForecastClient.java:15)
    It happens any time I call the marshalSendAndReceive method.
    I installed the Log4J facility and here it is a more talkative error:

    Code:
    2008-03-21 00:16:28,636 WARN [org.springframework.ws.server.EndpointNotFound] - No endpoint mapping found for [SaajSoapMessage ForecastRequest]
    So the problem seems to be that there is no endpoint mapping but I'm pretty sure I configured the endpoint and the beans fine:

    Here is the xml:

    Code:
    	<bean id="forecastEndpoint"
    		class="org.homelinux.elabor.forecast.service.ForecastEndpoint">
    		<property name="forecastService" ref="forecastService" />
    	</bean>
    
    	<bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
    		<constructor-arg ref="marshaller" />
    	</bean>
    
    	<bean id="payloadMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping" />
    and here is the Endpoint code:

    Code:
    @Endpoint
    public class ForecastEndpoint {
    	
    	private ForecastService forecastService;
    
    	public void setForecastService(ForecastService forecastService) {
    		this.forecastService = forecastService;
    	}
    	
    	@PayloadRoot(localPart="forecastRequest", namespace="http://elabor.homelinux.org/forecast/schemas")
    	public ForecastResponse forecast(ForecastRequest request) {
    		String location = request.getLocation();
    		String weather = this.forecastService.forecast(location);
    		ForecastResponse response = new ForecastResponse();
    		response.setWeather(location + ": " + weather);
    		return response;
    	}
    }
    Please... I really need help! :'(
    If you need more info I'll be glad to post it!

    Ivan

  9. #9
    Join Date
    Jan 2008
    Location
    Pisa, Italy
    Posts
    23

    Default Example of WebService

    If someone wants to have a look this is the sample webservice...

    Regards,
    Ivan
    Attached Files Attached Files

  10. #10
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    It seems like your SOAP request is missing the http://elabor.homelinux.org/forecast/schemas namespace. You can tell by the log statement:

    [code]
    2008-03-21 00:16:28,636 WARN [org.springframework.ws.server.EndpointNotFound] - No endpoint mapping found for [SaajSoapMessage ForecastRequest]
    [code]

    which should look like

    [code]
    2008-03-21 00:16:28,636 WARN [org.springframework.ws.server.EndpointNotFound] - No endpoint mapping found for [SaajSoapMessage {http://elabor.homelinux.org/forecast/schema}ForecastRequest]
    [code]

    You might also want to consider using a tool like tcpmon to look at the SOAP message as sent across the wire.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

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