0 Replies Latest reply on Jun 6, 2006 8:38 AM by Alexander Kirsch

    Problems with complex Exceptions

    Alexander Kirsch Newbie

      Hallo,

      I tried to define a complex exception in the following WSDL

      
      <?xml version="1.0" encoding="UTF-8"?>
      
      <wsdl:definitions
       name="SessionWebService"
       xmlns:types="urn:sedna.ser.de/ns"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema"
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
       xmlns:tns="urn:sedna.ser.de"
       targetNamespace="urn:sedna.ser.de" >
      
       <wsdl:types>
       <xsd:schema targetNamespace="urn:sedna.ser.de/ns" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <xsd:element name="SednaException">
       <xsd:complexType>
       <xsd:sequence>
       <xsd:element name="sednaErrorCode" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false"/>
       <xsd:element name="errorLevel" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false"/>
       <xsd:element name="className" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true"/>
       <xsd:element name="elementId" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true"/>
       <xsd:element name="displayInfo" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="false"/>
       </xsd:sequence>
       </xsd:complexType>
       </xsd:element>
       </xsd:schema>
       </wsdl:types>
      
       <wsdl:message name="SednaExceptionFault">
       <wsdl:part name="fault" element="types:SednaException"/>
       </wsdl:message>
      
       <wsdl:message name="SessionServiceWS_login">
       <wsdl:part name="loginname" type="xsd:string" />
       <wsdl:part name="password" type="xsd:string" />
       </wsdl:message>
       <wsdl:message name="SessionServiceWS_loginResponse">
       <wsdl:part name="result" type="types:StringArray" />
       </wsdl:message>
      
       <wsdl:portType name="SessionServiceWS">
      
       <wsdl:operation name="login" parameterOrder="loginname password">
       <wsdl:input message="tns:SessionServiceWS_login" />
       <wsdl:output message="tns:SessionServiceWS_loginResponse" />
       <wsdl:fault name="SednaException" message="tns:SednaExceptionFault" />
       </wsdl:operation>
      
       </wsdl:portType>
      
       <wsdl:binding name="SessionServiceWSBinding" type="tns:SessionServiceWS">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
       <wsdl:operation name="login">
       <soap:operation soapAction="" />
       <wsdl:input>
       <soap:body use="literal" namespace="urn:sedna.ser.de" />
       </wsdl:input>
       <wsdl:output>
       <soap:body use="literal" namespace="urn:sedna.ser.de" />
       </wsdl:output>
       <wsdl:fault name="SednaException">
       <soap:fault name="SednaException" use="literal"/>
       </wsdl:fault>
       </wsdl:operation>
       </wsdl:binding>
      
       <wsdl:service name="SessionWebService">
       <wsdl:port name="SessionServiceWSPort" binding="tns:SessionServiceWSBinding">
       <soap:address location="REPLACE_WITH_ACTUAL_URL" />
       </wsdl:port>
       </wsdl:service>
      
      </wsdl:definitions>
      
      


      I used the wscompile tool from the jax-rpc ri the generate the java classes and the jax-rpc mapping files for a JSR-109 POJO Endpoint without any problem. If I try to deploy it on a JBoss 4.0.4GA I got the following errors.

      
      2006-06-06 13:56:11,026 WARN [org.jboss.ws.metadata.JSR109MetaDataBuilder] Cannot obtain java type mapping for: {urn:sedna.ser.de/ns}>SednaException
      
      2006-06-06 13:56:12,213 DEBUG [org.jboss.ws.metadata.JSR109ServerMetaDataBuilder] END buildMetaData:
      UnifiedMetaData:
       securityDomain: null
      
      
      ServiceMetaData:
       name={urn:sedna.ser.de}SessionWebService
       wsdName=SessionWebService
       wsdlFile=WEB-INF/wsdl/SessionWebService.wsdl
       jaxrpcFile=WEB-INF/ses_mapping.xml
       publishLocation=null
       properties=null
      
      TypesMetaData:
       [complexType={urn:sedna.ser.de/ns}StringArray,javaType=com.ser.sedna.services.transfer.types.StringArray]
       [complexType={urn:sedna.ser.de/ns}SednaException,javaType=com.ser.sedna.services.transfer.types.SednaException]
       [complexType={urn:sedna.ser.de/ns}StringArray>value[0,unbounded],javaType=java.lang.String[]]
       [complexType={urn:sedna.ser.de}SednaExceptionFault,javaType=com.ser.sedna.services.transfer.types.SednaException]
      <schema targetNamespace='urn:sedna.ser.de/ns' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='urn:sedna.ser.de/ns' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
       <complexType name='StringArray'>
       <sequence>
       <element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='string'/>
       </sequence>
       </complexType>
       <element name='SednaException'>
       <complexType>
       <sequence>
       <element name='sednaErrorCode' type='string'/>
       <element name='errorLevel' type='string'/>
       <element name='className' nillable='true' type='string'/>
       <element name='elementId' nillable='true' type='string'/>
       <element name='displayInfo' type='string'/>
       </sequence>
       </complexType>
       </element>
      </schema>
      
      
      ServerEndpointMetaData:
       name={urn:sedna.ser.de}SessionServiceWSPort
       id=jboss.ws:di=sedna.ear/sedna-transfer-service-ws.war,port=SessionServiceWSPort,service=SessionWebService
       address=http://KIRSCH-XP:8080/sedna-transfer-service-ws/SessionServiceWS
       linkName=SessionServiceWS
       implName=null
       seiName=com.ser.sedna.services.transfer.ws.SessionServiceWS
       annotated=false
       portComponentName=SessionServiceWS
       contextRoot=/sedna-transfer-service-ws
       urlPattern=/SessionServiceWS
       configFile=META-INF/standard-jbossws-endpoint-config.xml
       configName=Standard Endpoint
       authMethod=null
       transportGuarantee=null
       properties=null
      
      OperationMetaData:
       xmlName={urn:sedna.ser.de}login
       javaName=login
       style=rpc/literal
       oneWay=false
       soapAction=
      ParameterMetaData:
       xmlName=loginname
       xmlType={http://www.w3.org/2001/XMLSchema}string
       javaType=java.lang.String
       mode=IN
       inHeader=false
      ParameterMetaData:
       xmlName=password
       xmlType={http://www.w3.org/2001/XMLSchema}string
       javaType=java.lang.String
       mode=IN
       inHeader=false
      ReturnMetaData:
       xmlName=result
       xmlType={urn:sedna.ser.de/ns}StringArray
       javaType=com.ser.sedna.services.transfer.types.StringArray
       mode=OUT
       inHeader=false
      FaultMetaData
       xmlName={urn:sedna.ser.de/ns}SednaException
       xmlType={urn:sedna.ser.de/ns}>SednaException
       javaType=org.jboss.ws.jaxrpc.UnqualifiedFaultException
      
      


      As far as I understand is the mapping information existent in jax-rpc mapping file.

      
      <?xml version="1.0" encoding="UTF-8"?>
      <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      version="1.1"
      xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
       <package-mapping>
       <package-type>com.ser.sedna.services.transfer.ws</package-type>
       <namespaceURI>urn:sedna.ser.de</namespaceURI>
       </package-mapping>
       <package-mapping>
       <package-type>com.ser.sedna.services.transfer.types</package-type>
       <namespaceURI>urn:sedna.ser.de/ns</namespaceURI>
       </package-mapping>
       <package-mapping>
       <package-type>com.ser.sedna.services.transfer.types</package-type>
       <namespaceURI>urn:sedna.ser.de/ns</namespaceURI>
       </package-mapping>
       <java-xml-type-mapping>
       <java-type>com.ser.sedna.services.transfer.types.StringArray</java-type>
       <root-type-qname xmlns:typeNS="urn:sedna.ser.de/ns">typeNS:StringArray</root-type-qname>
       <qname-scope>complexType</qname-scope>
       <variable-mapping>
       <java-variable-name>value</java-variable-name>
       <xml-element-name>value</xml-element-name>
       </variable-mapping>
       </java-xml-type-mapping>
       <java-xml-type-mapping>
       <java-type>com.ser.sedna.services.transfer.types.SednaException</java-type>
       <root-type-qname xmlns:typeNS="urn:sedna.ser.de/ns">typeNS:SednaException</root-type-qname>
       <qname-scope>complexType</qname-scope>
       <variable-mapping>
       <java-variable-name>sednaErrorCode</java-variable-name>
       <xml-element-name>sednaErrorCode</xml-element-name>
       </variable-mapping>
       <variable-mapping>
       <java-variable-name>errorLevel</java-variable-name>
       <xml-element-name>errorLevel</xml-element-name>
       </variable-mapping>
       <variable-mapping>
       <java-variable-name>className</java-variable-name>
       <xml-element-name>className</xml-element-name>
       </variable-mapping>
       <variable-mapping>
       <java-variable-name>elementId</java-variable-name>
       <xml-element-name>elementId</xml-element-name>
       </variable-mapping>
       <variable-mapping>
       <java-variable-name>displayInfo</java-variable-name>
       <xml-element-name>displayInfo</xml-element-name>
       </variable-mapping>
       </java-xml-type-mapping>
       <java-xml-type-mapping>
       <java-type>java.lang.String[]</java-type>
       <anonymous-type-qname>urn:sedna.ser.de/ns:StringArray>value[0,unbounded]</anonymous-type-qname>
       <qname-scope>complexType</qname-scope>
       </java-xml-type-mapping>
       <exception-mapping>
       <exception-type>com.ser.sedna.services.transfer.types.SednaException</exception-type>
       <wsdl-message xmlns:exMsgNS="urn:sedna.ser.de">exMsgNS:SednaExceptionFault</wsdl-message>
       <constructor-parameter-order>
       <element-name>sednaErrorCode</element-name>
       <element-name>errorLevel</element-name>
       <element-name>className</element-name>
       <element-name>elementId</element-name>
       <element-name>displayInfo</element-name>
       </constructor-parameter-order>
       </exception-mapping>
       <service-interface-mapping>
       <service-interface>com.ser.sedna.services.transfer.ws.SessionWebService</service-interface>
       <wsdl-service-name xmlns:serviceNS="urn:sedna.ser.de">serviceNS:SessionWebService</wsdl-service-name>
       <port-mapping>
       <port-name>SessionServiceWSPort</port-name>
       <java-port-name>SessionServiceWSPort</java-port-name>
       </port-mapping>
       </service-interface-mapping>
       <service-endpoint-interface-mapping>
       <service-endpoint-interface>com.ser.sedna.services.transfer.ws.SessionServiceWS</service-endpoint-interface>
       <wsdl-port-type xmlns:portTypeNS="urn:sedna.ser.de">portTypeNS:SessionServiceWS</wsdl-port-type>
       <wsdl-binding xmlns:bindingNS="urn:sedna.ser.de">bindingNS:SessionServiceWSBinding</wsdl-binding>
       <service-endpoint-method-mapping>
       <java-method-name>login</java-method-name>
       <wsdl-operation>login</wsdl-operation>
       <method-param-parts-mapping>
       <param-position>0</param-position>
       <param-type>java.lang.String</param-type>
       <wsdl-message-mapping>
       <wsdl-message xmlns:wsdlMsgNS="urn:sedna.ser.de">wsdlMsgNS:SessionServiceWS_login</wsdl-message>
       <wsdl-message-part-name>loginname</wsdl-message-part-name>
       <parameter-mode>IN</parameter-mode>
       </wsdl-message-mapping>
       </method-param-parts-mapping>
       <method-param-parts-mapping>
       <param-position>1</param-position>
       <param-type>java.lang.String</param-type>
       <wsdl-message-mapping>
       <wsdl-message xmlns:wsdlMsgNS="urn:sedna.ser.de">wsdlMsgNS:SessionServiceWS_login</wsdl-message>
       <wsdl-message-part-name>password</wsdl-message-part-name>
       <parameter-mode>IN</parameter-mode>
       </wsdl-message-mapping>
       </method-param-parts-mapping>
       <wsdl-return-value-mapping>
       <method-return-value>com.ser.sedna.services.transfer.types.StringArray</method-return-value>
       <wsdl-message xmlns:wsdlMsgNS="urn:sedna.ser.de">wsdlMsgNS:SessionServiceWS_loginResponse</wsdl-message>
       <wsdl-message-part-name>result</wsdl-message-part-name>
       </wsdl-return-value-mapping>
       </service-endpoint-method-mapping>
       </service-endpoint-interface-mapping>
      </java-wsdl-mapping>
      
      


      So is this a bug in the JBossWS Implementation or is something wrong in my setup.

      Thank you!