5 Replies Latest reply on Nov 14, 2013 1:01 PM by Leandro Andrade

    Unsupported content type: application/x-www-form-urlencoded

    Florian Bauer Newbie

      I try to create a SOAP- connection between jboss-ws and an AJAX- Client (WebBrowser). The WebService is proper deployed.
      If I start a AJAX-Request to the WebService's URL then I will get the following exception:

      09:59:04,171 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      javax.xml.soap.SOAPException: Unsupported content type: application/x-www-form-urlencoded
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:240)
       at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:179)
       at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:197)
       at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)
      


        • 1. Re: Unsupported content type: application/x-www-form-urlenco
          Alessio Soldano Newbie

          MessageFactoryImpl is throwing that exception since it only supports text/xml and application/soap+xml content types. I'd suggest to check your ajax client's requests.

          Alessio Soldano
          http://www.javalinux.it

          • 2. Re: Unsupported content type: application/x-www-form-urlenco
            Florian Bauer Newbie

            yes it sounds like a problem with the content-type. But I set the HTTP- HEADER with

            'Content-Type':'text/xml'


            And I tried the following encode variations:

            plain:
            <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><getHalloWorld xmlns="http://hibernate.base.dooris.com/jaws"></getHalloWorld></soap:Body></soap:Envelope>


            escape:
            %3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csoap%3AEnvelope%20xmlns%3Asoap%3D%22http%3A//schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoap%3ABody%3E%3CgetHalloWorld%20xmlns%3D%22http%3A//hibernate.base.dooris.com/jaws%22%3E%3C/getHalloWorld%3E%3C/soap%3ABody%3E%3C/soap%3AEnvelope%3E



            encodeURI:
            %3C?xml%20version=%221.0%22%20encoding=%22UTF-8%22?%3E%3Csoap:Envelope%20xmlns:soap=%22http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoap:Body%3E%3CgetHalloWorld%20xmlns=%22http://hibernate.base.dooris.com/jaws%22%3E%3C/getHalloWorld%3E%3C/soap:Body%3E%3C/soap:Envelope%3E


            and encodeURIComponent:
            %3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csoap%3AEnvelope%20xmlns%3Asoap%3D%22http%3A%2F%2Fschemas.xmlsoap.org%2Fsoap%2Fenvelope%2F%22%3E%3Csoap%3ABody%3E%3CgetHalloWorld%20xmlns%3D%22http%3A%2F%2Fhibernate.base.dooris.com%2Fjaws%22%3E%3C%2FgetHalloWorld%3E%3C%2Fsoap%3ABody%3E%3C%2Fsoap%3AEnvelope%3E



            my HTTP-HEADER :
            Request Headers
            Host 18.nvmodules.netvibes.com
            User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
            Accept text/javascript, text/html, application/xml, text/xml, */*
            Accept-Language de
            Accept-Encoding gzip,deflate
            Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
            Keep-Alive 300
            Connection close
            Content-Type text/xml
            X-Requested-With XMLHttpRequest
            Referer http://18.nvmodules.netvibes.com/api/uwa/frame/uwa_netvibes.php?id=18&moduleUrl=http%3A%2F%2Fwww.loom-gmbh.de%2Fdemo%2Fwidget_webservice.php&url=http%3A%2F%2Fwww.dooris.de%2Fnetvibes%2Fcontent1.htm&NVdomain=www.netvibes.com&NVthemeUrl=%2Fthemes%2Fcoriander%2Fscreen.css&NVlang=de_DE&NVlocale=de&NVcommType=TUAcallback&NVwidgetDomain=18.nvmodules.netvibes.com&NVsubspaceDomain=netvibes.com
            Content-Length 324
            Pragma no-cache
            Cache-Control no-cache
            


            always the same exception with IE and MOZILLA

            is there any example in the web, how to call a jboss-webservice by browser?

            • 3. Re: Unsupported content type: application/x-www-form-urlenco
              Florian Bauer Newbie

              there was a problem with the proxy...

              thank you for your help!

              • 4. Re: Unsupported content type: application/x-www-form-urlenco
                Shameer.P.K. Newbie

                Florian,

                I am also facing the same problem on weblogic 8.1, with spring-webservices. Could you elaborate, how have you resolved this issue ?

                Thanks

                • 5. Re: Unsupported content type: application/x-www-form-urlencoded
                  Leandro Andrade Newbie

                  Can you remember which proxy problem was ? I'm facing the same problem.

                   

                  My regards