1 Reply Latest reply on Feb 12, 2005 11:49 AM by Thomas Diesler

    Document literal services

    Dan Smith Newbie

      I'm new to JBossWS, but have experience using AXIS. I'm having trouble with using document/literal for my web services in JBossWS. I have written a very simple service (as a standard JSE not an EJB): 1 method that takes a String parameter and no return value.

      I can easily expose and use this as a rpc/literal service and consume it from a java client (using wscompile). However .NET doesn't support rpc/literal.. so I need doc literal. This is where things get frustrating...

      I rebuild my service with the same config.xml, and webservices.xml file using wscompile. I assume these files are fine, since they work for rpc literal.

      wscompile -gen:server -mapping WEB-INF/mapping.xml -d WEB-INF/wsdl -cp ./bin -f:documentliteral config.xml

      Then I put all the files in the right place in the WEB-INF directory and WAR it up. It deploys fine, and I can view the WSDL and create a client... BUT when I try to invoke the client I get an exception (from both .NET and Java). From the .NET client I get this:


      Unhandled Exception: System.InvalidOperationException: Client found response con
      tent type of 'text/html;charset=utf-8', but expected 'text/xml'.
      The request failed with the error message:
      --
      <html><head><title>Apache Tomcat/5.0.28 - Error report</title><style><!--H1 {fon
      t-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:
      22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525
      D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;backgro
      und-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;col
      or:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:w
      hite;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;backgroun
      d:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR
      {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="
      1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that p
      revented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.l
      ang.NullPointerException
      org.apache.axis.encoding.DeserializationContextImpl.getTypeMapping(Deser
      ializationContextImpl.java:604)
      org.apache.axis.encoding.DeserializationContextImpl.getDeserializer(Dese
      rializationContextImpl.java:564)
      org.apache.axis.encoding.DeserializationContextImpl.getDeserializerForTy
      pe(DeserializationContextImpl.java:596)
      org.apache.axis.message.SOAPFaultBuilder.onStartChild(SOAPFaultBuilder.j
      ava:370)
      org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseria
      lizationContextImpl.java:1166)
      org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

      org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
      Source)
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
      patcher.dispatch(Unknown Source)
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
      wn Source)
      org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      javax.xml.parsers.SAXParser.parse(Unknown Source)
      org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializatio
      nContextImpl.java:258)
      org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:657)
      org.apache.axis.Message.getSOAPEnvelope(Message.java:430)
      org.apache.axis.Message.getContentType(Message.java:496)
      org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:1041)

      org.jboss.webservice.server.ServiceEndpointServlet.doPost(ServiceEndpoin
      tServlet.java:84)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.j
      ava:370)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilte
      r.java:75)
      </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available
      in the Apache Tomcat/5.0.28 logs.</u>


      I get the same type of error from a java client created using wscompile.

      Am I missing something about doc/lit here? The documentation available on how to perform this for doc/lit is sparse and poor...

      I thought I might have to specify a serializer/deserializer but I have no complex types.

      Thanks for the help... this is driving me nuts