Announcement Announcement Module
Collapse
No announcement yet.
WebServiceTransportException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 04:36 PM.

  • #2
    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, 11:29 AM.

    Comment


    • #3
      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)

      Comment


      • #4
        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

        Comment


        • #5
          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.

          Comment


          • #6
            org.springframework.ws.client.WebServiceTransportE xception: Not Found [404]

            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

            Comment


            • #7
              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

              Comment


              • #8
                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

                Comment


                • #9
                  Example of WebService

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

                  Regards,
                  Ivan

                  Comment


                  • #10
                    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.

                    Comment


                    • #11
                      Solved

                      Yes, you were right!

                      The problem was in the castor mapping.xml file. The resource object marshalling did not contain the qualified namespace.

                      Thank you very much for your reply!
                      Ivan

                      Comment


                      • #12
                        Webservices transport exception

                        Even I get the same error what did u fix in the mapping.xml to fix the name space issue?

                        Thanks

                        Comment


                        • #13
                          Originally posted by eradan View Post
                          Yes, you were right!

                          The problem was in the castor mapping.xml file. The resource object marshalling did not contain the qualified namespace.

                          Thank you very much for your reply!
                          Ivan

                          Hi
                          i got the same error. how did you fixed it?
                          thanks in advacne,
                          Vipin

                          Comment


                          • #14
                            I have same problem

                            Can anyone tell me how this problem is solved , I really tried hard but in vain.

                            Comment


                            • #15
                              I have same issue! What am I doing wrong I've been at this for 3 days now.

                              I'm getting the following error in my Tomcat logfile:

                              WARNING: No endpoint mapping found for [SaajSoapMessage AGSRequest]

                              The message I am sending is as follows:

                              POST /JC3IEDM_App/agsToJc3iedm.ws HTTP/1.1
                              Accept-Encoding: gzip
                              Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
                              SOAPAction: ""
                              Content-Type: text/xml; charset=utf-8
                              Content-Length: 209
                              Cache-Control: no-cache
                              Pragma: no-cache
                              User-Agent: Java/1.6.0_14
                              Host: localhost:8082
                              Connection: keep-alive

                              <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><AGSRequest>
                              <Base64AGS>PEFHUy8+</Base64AGS>
                              </AGSRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

                              This is being automatically generated by the WebServiceTemplate. I notice that the target namespace is not specified in this message even though it is in the xml for the request as follows:

                              DOMSource request = new DOMSource(xml);
                              DOMResult result = new DOMResult();
                              webServiceTemplate.sendSourceAndReceiveToResult(re quest, result);

                              xml.toString() on the above gives us:
                              <AGSRequest xmlns="com.detica.jc3iedm">
                              <Base64AGS>PEFHUy8+</Base64AGS>
                              </AGSRequest>

                              My Endpoint is mapped with the following code:

                              @PayloadRoot(localPart="AGSRequest", namespace="com.detica.jc3iedm")

                              And the spring-ws-servlet.xml is as follows:

                              <bean id="agsToJc3iedm" class="org.springframework.ws.wsdl.wsdl11.DefaultW sdl11Definition"
                              portTypeName="agsToJc3iedm"
                              p:locationUri="http://localhost:8082/JC3IEDM_App/agsToJc3iedm.ws"
                              p:targetNamespace="com.detica.jc3iedm">
                              <property name="schema">
                              <bean class="org.springframework.xml.xsd.SimpleXsdSchema ">
                              <property name="xsd" value="classpath:/AGSRequest.xsd"/>
                              </bean>
                              </property>
                              </bean>

                              <bean id="agsToJc3iedmEndpoint"
                              class="com.detica.jc3iedm.webservice.AgsToJc3iedmE ndpoint" />

                              <bean id="payloadMapping"
                              class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping" />

                              Any help would be really appreciated as I am completekly out of ideas now.

                              Comment

                              Working...
                              X