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

  • Problem with receiving response

    Hi,

    I'm trying to do my first ws project from official tutorial and I have a problem.

    I've created server and client. Server code you can see on spring-ws tutorial ( chapter 3).

    Client code:

    Code:
    WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
    		webServiceTemplate.setDefaultUri("http://localhost:8080/holidayService");
    		String MESSAGE = "<HolidayRequest xmlns=\"http://mycompany.com/hr/schemas\"><Holiday><StartDate>2006-07-03</StartDate><EndDate>2006-07-07</EndDate></Holiday><Employee><Number>42</Number><FirstName>Arjen</FirstName><LastName>Poutsma</LastName></Employee></HolidayRequest>";
    		
    		StreamSource source = new StreamSource(new StringReader(MESSAGE));
            StreamResult result = new StreamResult(System.out);
            webServiceTemplate.sendSourceAndReceiveToResult(source, result);

    When I'm trying to run this client, I got an error:

    Code:
    [ INFO] 19:55:54 SaajSoapMessageFactory - Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
    [DEBUG] 19:55:54 SaajSoapMessageFactory - Using MessageFactory class [com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl]
    [DEBUG] 19:55:54 WebServiceTemplate - Opening [org.springframework.ws.transport.http.HttpUrlConnection@1a8c4e7] to [http://localhost:8080/holidayService]
    [DEBUG] 19:55:54 sent - Sent request [SaajSoapMessage {http://mycompany.com/hr/schemas}HolidayRequest]
    [DEBUG] 19:55:54 received - Received response [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}Fault] for request [SaajSoapMessage {http://mycompany.com/hr/schemas}HolidayRequest]
    [DEBUG] 19:55:54 WebServiceTemplate - Received Fault message for request [SaajSoapMessage {http://mycompany.com/hr/schemas}HolidayRequest]
    Exception in thread "main" org.springframework.ws.soap.client.SoapFaultClientException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: 
    	at org.springframework.ws.soap.client.core.SoapFaultMessageResolver.resolveFault(SoapFaultMessageResolver.java:37)
    	at org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:738)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:564)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:502)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:457)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:403)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:394)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:384)
    	at Main.main(Main.java:19)
    And I really don't know what I should do with this...

    I'm sure that this is easy to fix but I'm beginner ...

    Thx in advance

  • #2
    Maybe I should change this directory : "http://mycompany.com/hr/schemas" ?
    If yes then what should be in this directory ( which files ) ?

    Anybody know how can I fix this ?

    Project is from tutorial : "holidayService"

    Comment

    Working...
    X