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).
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.
org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
Quote:
Originally Posted by
OldSchoolio
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:confused:
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
org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]
That's error is driving me crazy! :mad: :mad: :mad:
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
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