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

Thread: Echo response missing

  1. #1
    Join Date
    Jun 2007
    Posts
    18

    Default Echo response missing

    hi,

    I new to Spring WS. I have deployed the Echo sample in JBoss and am able to communicate with it from my client. However the soap response from the web service is missing the text content "hello" when I call the web service deployed on JBoss 4.2.0. It works fine in Tomcat 5.5. I have added the latest xercesimpl.jar, xalan.jar and serializer.jar to the war, since I read somewhere that these files in JBoss could cause conflicts. But the problem still persists. Please advice.

    The response I get is
    <?xml version="1.0" encoding="UTF-8"?><echoResponse xmlns="http://www.springframework.org/spring-ws/samples/echo"/>

    Thanks,
    Seema

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

    Default

    JBoss' implementation of SAAJ (the underlying J2EE library used by Spring-WS) has some issues. See this thread for a work around.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Jun 2007
    Posts
    18

    Default JBoss-SpringWS problem

    Thanks, Arjen. As mentioned in that post, I tried to add this section to my spring -ws-servlet.xml.
    Code:
    <bean id="messageFactory"
    class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl" />
    <bean id="messageContextFactory" 
    class="org.springframework.ws.soap.saaj.SaajSoapMessageContextFactory">
    <property name="messageFactory" ref="messageFactory" />
    </bean>
    <bean id="messageEndpointHandlerAdapter"
    class="org.springframework.ws.transport.http.MessageEndpointHandlerAdapter">
    <property name="messageContextFactory" ref="messageContextFactory"/>
    </bean>
    But now I'm getting another error.
    Exception in thread "main" org.springframework.ws.soap.SoapMessageCreationExc eption: Could not create message from InputStream: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionI mpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
    Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionI mpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
    at com.sun.xml.internal.messaging.saaj.soap.MessageIm pl.identifyContentType(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.soap.MessageIm pl.<init>(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.Me ssage1_1Impl.<init>(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.soap.ver1_1.SO APMessageFactory1_1Impl.createMessage(Unknown Source)
    at org.springframework.ws.soap.saaj.SaajSoapMessageFa ctory.createWebServiceMessage(SaajSoapMessageFacto ry.java:155)
    at org.springframework.ws.transport.AbstractWebServic eConnection.receive(AbstractWebServiceConnection.j ava:50)
    at org.springframework.ws.client.core.WebServiceTempl ate.receiveResponse(WebServiceTemplate.java:404)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:359)
    at org.springframework.ws.client.core.WebServiceTempl ate.doSendAndReceive(WebServiceTemplate.java:310)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:255)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:246)
    at org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:236)
    at org.springframework.ws.samples.echo.client.sws.Ech oClient.echo(EchoClient.java:40)
    at org.springframework.ws.samples.echo.client.sws.Ech oClient.main(EchoClient.java:48)

    Please advice.

    Thanks,
    Seema

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

    Default

    It seems like whatever is sent to the server is not XML, but text/html. You can use something like https://tcpmon.dev.java.net/ to find out what is sent to the server.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  5. #5
    Join Date
    Jun 2007
    Posts
    18

    Default

    I used tcpmon to capture the messages, like you suggested. This is the message getting sent from the echo client.

    POST /EchoServer HTTP/1.1
    Accept-Encoding: gzip
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Content-Type: text/xml; charset=utf-8
    Content-Length: 241
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.6.0_01
    Host: localhost:7001
    Connection: keep-alive

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><echoRequest xmlns="http://www.springframework.org/spring-ws/samples/echo">Hello</echoRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>

    Is this correct? This is the same echo client that comes in the samples folder, I have not modified any code in it. But I could not find the jar files for the client, the lib folder in the client was empty. Maybe something is wrong with the jar files I have? Can you tell me where I can download the correct jar files for the client?

    Thanks
    Seema

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

    Default

    The client should run out of the box, the lib folder is no longer necessary. As a matter of fact, it's not even there in RC2. Are you using RC2?
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  7. #7
    Join Date
    Jun 2007
    Posts
    18

    Default Downloaded RC2,but same problem

    hi Arjen,

    I have downloaded RC2 and replaced my files, but the result is the same. Here is the SOAP request that is sent from the client.
    Code:
    POST /EchoServer HTTP/1.1
    Accept-Encoding: gzip
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Content-Type: text/xml; charset=utf-8
    Content-Length: 241
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.6.0_01
    Host: localhost:7001
    Connection: keep-alive
    
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><echoRequest xmlns="http://www.springframework.org/spring-ws/samples/echo">Hello</echoRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
    The response from the server seems to have junk characters.
    Code:
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)/Tomcat-5.5
    Content-Type: text/xml;charset=UTF-8
    Transfer-Encoding: chunked
    Date: Tue, 19 Jun 2007 01:50:11 GMT
    
    b4
    <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><echoResponse xmlns='http://www.springframework.org/spring-ws/samples/echo'/>
    1a
    </env:Body></env:Envelope>
    0
    Please let me know the work around for this problem. If you have a WAR file that works in JBoss, can I download it and use the same settings?

    Thanks,
    Seema

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

    Default

    AH, right, so the problem is on the client side, I didn't get that earlier. One more thing you could try is to use the CommonsHttpMessageSender instead of the default HttpUrlConnectionMessageSender. Just set the message sender bean on the template, there is a property for it.

    Or if you create a JIRA issue, I will try and reproduce it.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  9. #9
    Join Date
    Jun 2007
    Posts
    18

    Default

    Why do you say that the problem is at the client end? The response from the server has junk characters, right? Morover, I tried with other clients as well. Anyway, I will try what you suggested.

    Thanks,
    Seema

  10. #10
    Join Date
    Jun 2007
    Posts
    18

    Default

    I'm not sure what you mean by the message sender bean? Can you elaborate on which bean's settings I need to modify?

    Thanks,
    Seema

Posting Permissions

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