Forum Stats

  • 3,780,642 Users
  • 2,254,420 Discussions
  • 7,879,404 Comments

Discussions

Problems to expose A Business Service as REST

User_LHD97
User_LHD97 Member Posts: 12 Blue Ribbon
edited Jun 30, 2015 3:12PM in SOA Suite Discusssions

Hi Guys!

              I have 3 services in My OSB 12c Cluster. Both have the Business and Proxy Services Running OK. The services are deployed at JBoss 4.2.1 as WebServices and have the WSDL files available....

              Now I am trying to expose such services as Restiful Services..... I follow the Basic steps (at Jdeveloper 12c).

  1. Right Click at BusinessServices>>Service BUS>>Expose as REST
  2. Define the Verbs and Resources....
  3. and Deploy at the service BUS.

            The Problems happens in the test console of RESTProxy:  When I chose the Resource, Method and the Response THe JBOSS server return to me the error message:

The invocation resulted in an error: .

 <err:RestError xmlns:err="http://www.bea.com/wli/sb/errors">
       <err:errorMessage>
            Unsupported content type: application/xml; charset=utf-8
       </err:errorMessage>
 </err:RestError>


With The follow Response Metadata

<xml-fragment>
         <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports"               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                 <http:Content-Type>application/xml</http:Content-Type>
          </tran:headers>
          <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
</xml-fragment>


At JBOSS´s log level the Error is observed as follow:

2015-06-29 17:01:33,308 DEBUG [org.jboss.ws.core.server.AbstractServiceEndpointServlet] doPost: /corewebservices/ServiceAWebServiceImpl

2015-06-29 17:01:33,308 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: [email protected] (Thread http-10.17.5.137-8080-7)

2015-06-29 17:01:33,308 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] BEGIN handleRequest: jboss.ws:context=corewebservices,endpoint=ServiceAWebService

2015-06-29 17:01:33,308 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=application/xml; charset=utf-8]

2015-06-29 17:01:33,308 DEBUG [org.jboss.ws.metadata.umdm.EndpointMetaData] Configure SOAPBinding

2015-06-29 17:01:33,308 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception

  1. javax.xml.soap.SOAPException: Unsupported content type: application/xml; charset=utf-8

        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:157)

        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:662)

2015-06-29 17:01:33,314 DEBUG [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] Cannot obtain fault meta data for: class javax.xml.soap.SOAPException

2015-06-29 17:01:33,314 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] END handleRequest: jboss.ws:context=corewebservices,endpoint=ServiceAWebService

2015-06-29 17:01:33,317 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] popMessageContext: [email protected] (Thread http-10.17.5.137-8080-7)

When I edit the teste parameters adding 'GET' as the 'http-method'

  • I don´t recive a response;
  • the response metadata is;
<xml-fragment>
  <tran:headers xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <http:Content-Type>text/xml</http:Content-Type>
  </tran:headers>
  <tran:response-code xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
  <tran:response-message xmlns:tran="http://www.bea.com/wli/sb/transports">OK</tran:response-message>
  <tran:encoding xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
  <http:http-response-code xmlns:http="http://www.bea.com/wli/sb/transports/http">200</http:http-response-code>
</xml-fragment>


  • And at JBOSS´s log level I don´t recive any error message.

Looking at the oracle support channael, I don´t find this error, but a fews erros wich looks like similars for old versions of the OSB. Most of them use Patchs for fixing this probelm.

I don´t know what to do any more!

Tagged:
This discussion has been closed.