[jboss-user] [JBossWS] - Unsupported content type: text/html on WS call

chrissy do-not-reply at jboss.com
Thu Nov 20 16:17:20 EST 2008


Hi there.  I am getting the following error in my WS client:

Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. javax.xml.soap.SOAPException: Unsupported content type: text/html. Response: OK/200.
  | 	at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:348)
  | 	at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:137)

I turned on RequestDumperValve to see the header details and I first see my client requesting the WSDL:


12:23:34,084 INFO  [[localhost]] ===============================================================
  | 12:23:34,092 INFO  [[localhost]] REQUEST URI       =/MyServer/MyService
  | 12:23:34,092 INFO  [[localhost]]           authType=null
  | 12:23:34,092 INFO  [[localhost]]  characterEncoding=null
  | 12:23:34,092 INFO  [[localhost]]      contentLength=-1
  | 12:23:34,092 INFO  [[localhost]]        contentType=null
  | 12:23:34,093 INFO  [[localhost]]        contextPath=/MyServer
  | 12:23:34,093 INFO  [[localhost]]             header=user-agent=Java/1.5.0_16
  | 12:23:34,093 INFO  [[localhost]]             header=host=localhost:8080
  | 12:23:34,093 INFO  [[localhost]]             header=accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
  | 12:23:34,093 INFO  [[localhost]]             header=connection=keep-alive
  | 12:23:34,094 INFO  [[localhost]]             locale=en_US
  | 12:23:34,094 INFO  [[localhost]]             method=GET
  | 12:23:34,094 INFO  [[localhost]]          parameter=wsdl=
  | 12:23:34,095 INFO  [[localhost]]           pathInfo=null
  | 12:23:34,095 INFO  [[localhost]]           protocol=HTTP/1.1
  | 12:23:34,095 INFO  [[localhost]]        queryString=wsdl
  | 12:23:34,095 INFO  [[localhost]]         remoteAddr=127.0.0.1
  | 12:23:34,095 INFO  [[localhost]]         remoteHost=127.0.0.1
  | 12:23:34,095 INFO  [[localhost]]         remoteUser=null
  | 12:23:34,096 INFO  [[localhost]] requestedSessionId=null
  | 12:23:34,096 INFO  [[localhost]]             scheme=http
  | 12:23:34,096 INFO  [[localhost]]         serverName=localhost
  | 12:23:34,096 INFO  [[localhost]]         serverPort=8080
  | 12:23:34,096 INFO  [[localhost]]        servletPath=/MyService
  | 12:23:34,096 INFO  [[localhost]]           isSecure=false
  | 12:23:34,096 INFO  [[localhost]] ---------------------------------------------------------------
  | 12:23:34,642 INFO  [[localhost]] ---------------------------------------------------------------
  | 12:23:34,642 INFO  [[localhost]]           authType=null
  | 12:23:34,648 INFO  [[localhost]]      contentLength=-1
  | 12:23:34,659 INFO  [[localhost]]        contentType=text/xml
  | 12:23:34,694 INFO  [[localhost]]             header=X-Powered-By=Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
  | 12:23:34,695 INFO  [[localhost]]             header=Content-Type=text/xml
  | 12:23:34,702 INFO  [[localhost]]             header=Transfer-Encoding=chunked
  | 12:23:34,702 INFO  [[localhost]]             header=Date=Thu, 20 Nov 2008 20:23:34 GMT
  | 12:23:34,702 INFO  [[localhost]]            message=null
  | 12:23:34,703 INFO  [[localhost]]         remoteUser=null
  | 12:23:34,703 INFO  [[localhost]]             status=200
  | 12:23:34,703 INFO  [[localhost]] ===============================================================

and then I see the Soap Request:

12:23:38,228 INFO  [[localhost]] ===============================================================
  | 12:23:39,076 INFO  [[localhost]] REQUEST URI       =/
  | 12:23:39,076 INFO  [[localhost]]           authType=null
  | 12:23:39,076 INFO  [[localhost]]  characterEncoding=UTF-8
  | 12:23:39,076 INFO  [[localhost]]      contentLength=-1
  | 12:23:39,076 INFO  [[localhost]]        contentType=text/xml; charset=UTF-8
  | 12:23:39,077 INFO  [[localhost]]        contextPath=
  | 12:23:39,077 INFO  [[localhost]]             header=authorization=Basic Y2hyaXNzeTpwYXNzd29yZA==
  | 12:23:39,077 INFO  [[localhost]]             header=soapaction="http://schemas.mydomain.net/10/myservice/doLogin"
  | 12:23:39,077 INFO  [[localhost]]             header=content-type=text/xml; charset=UTF-8
  | 12:23:39,077 INFO  [[localhost]]             header=jboss-remoting-version=22
  | 12:23:39,077 INFO  [[localhost]]             header=user-agent=JBossRemoting - 2.2.2.SP8
  | 12:23:39,078 INFO  [[localhost]]             header=host=localhost:8080
  | 12:23:39,078 INFO  [[localhost]]             header=accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
  | 12:23:39,078 INFO  [[localhost]]             header=connection=keep-alive
  | 12:23:39,078 INFO  [[localhost]]             header=transfer-encoding=chunked
  | 12:23:39,078 INFO  [[localhost]]             locale=en_US
  | 12:23:39,082 INFO  [[localhost]]             method=POST
  | 12:23:39,083 INFO  [[localhost]]           pathInfo=null
  | 12:23:39,083 INFO  [[localhost]]           protocol=HTTP/1.1
  | 12:23:39,084 INFO  [[localhost]]        queryString=null
  | 12:23:39,084 INFO  [[localhost]]         remoteAddr=127.0.0.1
  | 12:23:39,084 INFO  [[localhost]]         remoteHost=127.0.0.1
  | 12:23:39,084 INFO  [[localhost]]         remoteUser=null
  | 12:23:39,084 INFO  [[localhost]] requestedSessionId=null
  | 12:23:39,084 INFO  [[localhost]]             scheme=http
  | 12:23:39,084 INFO  [[localhost]]         serverName=localhost
  | 12:23:39,085 INFO  [[localhost]]         serverPort=8080
  | 12:23:39,085 INFO  [[localhost]]        servletPath=/index.html
  | 12:23:39,085 INFO  [[localhost]]           isSecure=false
  | 12:23:39,086 INFO  [[localhost]] ---------------------------------------------------------------
  | 12:23:39,087 INFO  [[localhost]] ---------------------------------------------------------------
  | 12:23:39,087 INFO  [[localhost]]           authType=null
  | 12:23:39,087 INFO  [[localhost]]      contentLength=2919
  | 12:23:39,088 INFO  [[localhost]]        contentType=text/html
  | 12:23:39,089 INFO  [[localhost]]             header=X-Powered-By=Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
  | 12:23:39,090 INFO  [[localhost]]             header=ETag=W/"2919-1227047690000"
  | 12:23:39,091 INFO  [[localhost]]             header=Last-Modified=Tue, 18 Nov 2008 22:34:50 GMT
  | 12:23:39,091 INFO  [[localhost]]            message=null
  | 12:23:39,091 INFO  [[localhost]]         remoteUser=null
  | 12:23:39,091 INFO  [[localhost]]             status=200
  | 12:23:39,091 INFO  [[localhost]] ===============================================================
  | 

If you look closely the Request URI in the second request is / and the servlet Path is /index.html.  Which might explain why I am getting text/html returned from the server.  I would assume that the Request URI should be /MyServer/MyService as it is in the WSDL service.  Is my thinking correct?  Can anyone point me in the right direction?  I can provide more details but wanted to keep the original post simple.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191047#4191047

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191047



More information about the jboss-user mailing list