1 Reply Latest reply on Feb 14, 2007 3:08 PM by Davide De Benedictis

    Bug? operations from doc-literal BARE to WRAPPED

    Davide De Benedictis Newbie

      Hi all,
      I'm completely stuck on this, please could you confirm thsi is a bug or where I'm wrong?
      I'm using JBossWS1.0.4 as client of an Axis2 service. Until now everything was ok, then...
      I removed two methods from a working POJO class exposed as WS and I started getting a ClassCastException at runtime on my JBoss JSR109 client side calling the remaining methods. Suddendly all my operations are seen as "doc-literal wrapped"

      For example:

       public String getConfigurationFile ()
       {
       return "abracadabra";
       }
      


      This is the Exception trace:

      2007-02-14 15:17:04,896 TRACE [jbossws.SOAPMessage] Incoming Response SOAPMessage
      <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
       <soapenv:Header/>
       <soapenv:Body>
       <ns:getConfigurationFileResponse xmlns:ns='http://neo.spectre.com/xsd'>
       <ns:_return>abracadabra</ns:_return>
       </ns:getConfigurationFileResponse>
       </soapenv:Body>
      </soapenv:Envelope>
      2007-02-14 15:17:04,896 DEBUG [org.jboss.ws.common.CommonSOAPBinding] unbindResponseMessage: {http://neo.spectre.com}getConfigurationFile
      2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.binding.EndpointInvocation] setReturnValue: org.jboss.ws.soap.SOAPBodyElementDoc
      2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.binding.EndpointInvocation] getReturnValue
      2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.soap.SOAPContentElement] getObjectValue [xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse,javaType=class com.spectre.neo.GetConfigurationFileResponse]
      2007-02-14 15:17:04,912 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialize: [xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse,xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse]
      2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialized: com.spectre.neo.GetConfigurationFileResponse
      2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.soap.SOAPContentElement] objectValue: com.spectre.neo.GetConfigurationFileResponse
      2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.binding.EndpointInvocation] transformPayloadValue: org.jboss.ws.soap.SOAPBodyElementDoc -> com.spectre.neo.GetConfigurationFileResponse
      2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.jaxrpc.ParameterWrapping] unwrapResponseParameter: com.spectre.neo.GetConfigurationFileResponse
      2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.jaxrpc.ParameterWrapping] get_return: java.lang.String
      2007-02-14 15:17:04,928 DEBUG [org.jboss.ws.soap.MessageContextAssociation] popMessageContext: org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC@1f7be7b
      2007-02-14 15:17:04,928 ERROR [com.spectre.web.neo.FrontController] Command execute exception
      java.lang.ClassCastException: java.lang.String
       at $Proxy56.getConfigurationFile(Unknown Source)
       at com.spectre.web.neo.adapter.ConfigurationFileAdapter.getData(ConfigurationFileAdapter.java:35)
       at com.spectre.web.neo.commands.FileConfigCommand.execute(FileConfigCommand.java:46)
       at com.spectre.web.neo.FrontController.processRequest(FrontController.java:107)
       at com.spectre.web.neo.FrontController.doGet(FrontController.java:66)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      


      I enabled JBossWS logs and I started digging...

      If I insert again the two methods in my POJO WS and I generate again WSDL and client artifacts, this is the happy day scenario:

      2007-02-14 15:56:45,897 TRACE [jbossws.SOAPMessage] Incoming Response SOAPMessage
      <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
       <soapenv:Header/>
       <soapenv:Body>
       <ns:getConfigurationFileResponse xmlns:ns='http://neo.spectre.com/xsd'>
       <ns:_return>abracadabra</ns:_return>
       </ns:getConfigurationFileResponse>
       </soapenv:Body>
      </soapenv:Envelope>
      2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.common.CommonSOAPBinding] unbindResponseMessage: {http://neo.spectre.com}getConfigurationFile
      2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.binding.EndpointInvocation] setReturnValue: org.jboss.ws.soap.SOAPBodyElementDoc
      2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.binding.EndpointInvocation] getReturnValue
      2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.soap.SOAPContentElement] getObjectValue [xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse,javaType=class com.spectre.neo.GetConfigurationFileResponse]
      2007-02-14 15:56:45,897 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialize: [xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse,xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse]
      2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.jbossxb.JBossXBDeserializer] deserialized: com.spectre.neo.GetConfigurationFileResponse
      2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.soap.SOAPContentElement] objectValue: com.spectre.neo.GetConfigurationFileResponse
      2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.binding.EndpointInvocation] transformPayloadValue: org.jboss.ws.soap.SOAPBodyElementDoc -> com.spectre.neo.GetConfigurationFileResponse
      2007-02-14 15:56:45,912 DEBUG [org.jboss.ws.soap.MessageContextAssociation] popMessageContext: org.jboss.ws.jaxrpc.handler.SOAPMessageContextJAXRPC@126b165
      2007-02-14 15:56:45,912 DEBUG [com.spectre.web.neo.adapter.ConfigurationFileAdapter] reply: abracadabra
      


      I compared the two WSDL before and after the two method inserted and nothing is changed for the getConfigurationFile() method. (I can post them, if needed).
      Looking into the JBoss logs I discovered that on the correct scenario all operations are seen as doc-literal BARE


      OperationMetaData:
       qname={http://neo.spectre.com}getConfigurationFile
       javaName=getConfigurationFile
       style=document/literal/BARE
       oneWay=false
       soapAction=urn:getConfigurationFile
      ReturnMetaData:
       xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse
       xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse
       javaType=com.spectre.neo.GetConfigurationFileResponse
       mode=OUT
       inHeader=false
       wrappedVariables=[]
       wrappedTypes=[]
       wrappedElementNames=[]


      When I'm getting thw ClassCastException the same operation is seen as doc-literal WRAPPED:

      OperationMetaData:
       qname={http://neo.spectre.com}getConfigurationFile
       javaName=getConfigurationFile
       style=document/literal/WRAPPED
       oneWay=false
       soapAction=urn:getConfigurationFile
      ReturnMetaData:
       xmlName={http://neo.spectre.com/xsd}getConfigurationFileResponse
       xmlType={http://neo.spectre.com/xsd}>getConfigurationFileResponse
       javaType=com.spectre.neo.GetConfigurationFileResponse
       mode=OUT
       inHeader=false
       wrappedVariables=[_return]
       wrappedTypes=[]
       wrappedElementNames=[]
      


      thank you in advance



        • 1. Re: Bug? operations from doc-literal BARE to WRAPPED
          Davide De Benedictis Newbie

          These are the two WSDL for the working example and not.
          As I can see the getConfigurationFile() method part is not changed.

          <wsdl:definitions xmlns:axis2="http://neo.spectre.com" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns0="http://neo.spectre.com/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://neo.spectre.com">
          <wsdl:documentation>NEOServizi</wsdl:documentation>
          <wsdl:types>
          <xs:schema xmlns:ns="http://neo.spectre.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://neo.spectre.com/xsd">
          <xs:element name="getConfigurationFileResponse">
          <xs:complexType>
          <xs:sequence>
          <xs:element name="_return" nillable="true" type="xs:string"/>
          </xs:sequence>
          </xs:complexType>
          </xs:element>
          <xs:element name="getProcessorInfo">
          <xs:complexType>
          <xs:sequence>
          <xs:element name="processorInstance" nillable="true" type="xs:string"/>
          </xs:sequence>
          </xs:complexType>
          </xs:element>
          <xs:element name="getProcessorInfoResponse">
          <xs:complexType>
          <xs:sequence>
          <xs:element maxOccurs="unbounded" name="_return" nillable="true" type="xs:string"/>
          </xs:sequence>
          </xs:complexType>
          </xs:element>
          <xs:element name="getProcessorInstancesResponse">
          <xs:complexType>
          <xs:sequence>
          <xs:element maxOccurs="unbounded" name="_return" nillable="true" type="xs:string"/>
          </xs:sequence>
          </xs:complexType>
          </xs:element>
          </xs:schema>
          </wsdl:types>
          <wsdl:message name="getProcessorInfoMessage">
          <wsdl:part name="part1" element="ns0:getProcessorInfo"/>
          </wsdl:message>
          <wsdl:message name="getProcessorInfoResponse">
          <wsdl:part name="part1" element="ns0:getProcessorInfoResponse"/>
          </wsdl:message>
          <wsdl:message name="getConfigurationFileMessage"/>
          <wsdl:message name="getConfigurationFileResponse">
          <wsdl:part name="part1" element="ns0:getConfigurationFileResponse"/>
          </wsdl:message>
          <wsdl:message name="getProcessorInstancesMessage"/>
          <wsdl:message name="getProcessorInstancesResponse">
          <wsdl:part name="part1" element="ns0:getProcessorInstancesResponse"/>
          </wsdl:message>
          <wsdl:portType name="NEOServiziPortType">
          <wsdl:operation name="getProcessorInfo">
          <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getProcessorInfoMessage" wsaw:Action="urn:getProcessorInfo"/>
          <wsdl:output message="axis2:getProcessorInfoResponse"/>
          </wsdl:operation>
          <wsdl:operation name="getConfigurationFile">
          <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getConfigurationFileMessage" wsaw:Action="urn:getConfigurationFile"/>
          <wsdl:output message="axis2:getConfigurationFileResponse"/>
          </wsdl:operation>
          <wsdl:operation name="getProcessorInstances">
          <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getProcessorInstancesMessage" wsaw:Action="urn:getProcessorInstances"/>
          <wsdl:output message="axis2:getProcessorInstancesResponse"/>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="NEOServiziSOAP11Binding" type="axis2:NEOServiziPortType">
          <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
          <wsdl:operation name="getProcessorInfo">
          <soap:operation soapAction="urn:getProcessorInfo" style="document"/>
          <wsdl:input>
          <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="getConfigurationFile">
          <soap:operation soapAction="urn:getConfigurationFile" style="document"/>
          <wsdl:input>
          <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="getProcessorInstances">
          <soap:operation soapAction="urn:getProcessorInstances" style="document"/>
          <wsdl:input>
          <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:binding name="NEOServiziSOAP12Binding" type="axis2:NEOServiziPortType">
          <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
          <wsdl:operation name="getProcessorInfo">
          <soap12:operation soapAction="urn:getProcessorInfo" style="document"/>
          <wsdl:input>
          <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap12:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="getConfigurationFile">
          <soap12:operation soapAction="urn:getConfigurationFile" style="document"/>
          <wsdl:input>
          <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap12:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="getProcessorInstances">
          <soap12:operation soapAction="urn:getProcessorInstances" style="document"/>
          <wsdl:input>
          <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap12:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:binding name="NEOServiziHttpBinding" type="axis2:NEOServiziPortType">
          <http:binding verb="POST"/>
          <wsdl:operation name="getProcessorInfo">
          <http:operation location="getProcessorInfo"/>
          <wsdl:input>
          <mime:content type="text/xml"/>
          </wsdl:input>
          <wsdl:output>
          <mime:content type="text/xml"/>
          </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="getConfigurationFile">
          <http:operation location="getConfigurationFile"/>
          <wsdl:input>
          <mime:content type="text/xml"/>
          </wsdl:input>
          <wsdl:output>
          <mime:content type="text/xml"/>
          </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="getProcessorInstances">
          <http:operation location="getProcessorInstances"/>
          <wsdl:input>
          <mime:content type="text/xml"/>
          </wsdl:input>
          <wsdl:output>
          <mime:content type="text/xml"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="NEOServizi">
          <wsdl:port name="NEOServiziSOAP11port_http" binding="axis2:NEOServiziSOAP11Binding">
          <soap:address location="http://127.0.0.1:8380/axis2-neo/services/NEOServizi"/>
          </wsdl:port>
          <wsdl:port name="NEOServiziSOAP12port_http" binding="axis2:NEOServiziSOAP12Binding">
          <soap12:address location="http://127.0.0.1:8380/axis2-neo/services/NEOServizi"/>
          </wsdl:port>
          <wsdl:port name="NEOServiziHttpport1" binding="axis2:NEOServiziHttpBinding">
          <http:address location="http://127.0.0.1:8380/axis2-neo/rest/NEOServizi"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>



          This is the wsdl where I get the strange behaviour:


          <wsdl:definitions xmlns:axis2="http://neo.spectre.com" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns0="http://neo.spectre.com/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://neo.spectre.com">
          <wsdl:documentation>NEOServizi</wsdl:documentation>
          <wsdl:types>
          <xs:schema xmlns:ns="http://neo.spectre.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://neo.spectre.com/xsd">
          <xs:element name="getConfigurationFileResponse">
          <xs:complexType>
          <xs:sequence>
          <xs:element name="_return" nillable="true" type="xs:string"/>
          </xs:sequence>
          </xs:complexType>
          </xs:element>
          </xs:schema>
          </wsdl:types>
          <wsdl:message name="getConfigurationFileMessage"/>
          <wsdl:message name="getConfigurationFileResponse">
          <wsdl:part name="part1" element="ns0:getConfigurationFileResponse"/>
          </wsdl:message>
          <wsdl:portType name="NEOServiziPortType">
          <wsdl:operation name="getConfigurationFile">
          <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getConfigurationFileMessage" wsaw:Action="urn:getConfigurationFile"/>
          <wsdl:output message="axis2:getConfigurationFileResponse"/>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="NEOServiziSOAP11Binding" type="axis2:NEOServiziPortType">
          <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
          <wsdl:operation name="getConfigurationFile">
          <soap:operation soapAction="urn:getConfigurationFile" style="document"/>
          <wsdl:input>
          <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:binding name="NEOServiziSOAP12Binding" type="axis2:NEOServiziPortType">
          <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
          <wsdl:operation name="getConfigurationFile">
          <soap12:operation soapAction="urn:getConfigurationFile" style="document"/>
          <wsdl:input>
          <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap12:body use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:binding name="NEOServiziHttpBinding" type="axis2:NEOServiziPortType">
          <http:binding verb="POST"/>
          <wsdl:operation name="getConfigurationFile">
          <http:operation location="getConfigurationFile"/>
          <wsdl:input>
          <mime:content type="text/xml"/>
          </wsdl:input>
          <wsdl:output>
          <mime:content type="text/xml"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="NEOServizi">
          <wsdl:port name="NEOServiziSOAP11port_http" binding="axis2:NEOServiziSOAP11Binding">
          <soap:address location="http://127.0.0.1:8380/axis2-neo/services/NEOServizi"/>
          </wsdl:port>
          <wsdl:port name="NEOServiziSOAP12port_http" binding="axis2:NEOServiziSOAP12Binding">
          <soap12:address location="http://127.0.0.1:8380/axis2-neo/services/NEOServizi"/>
          </wsdl:port>
          <wsdl:port name="NEOServiziHttpport1" binding="axis2:NEOServiziHttpBinding">
          <http:address location="http://127.0.0.1:8380/axis2-neo/rest/NEOServizi"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>