5 Replies Latest reply on Sep 22, 2005 6:25 AM by Andrei Iltchenko

    JAX-RPC Mapping DD, what metadata is used by JBoss?

    Andrei Iltchenko Newbie

      In using the WS subsystem of JBoss, I observed that it ignores a fair amount of metadata supplied in a JAX-RPC Mapping DD. In particular I observed the following:

      1. java-xml-type-mapping. Jboss ignores the xml-element-name element on the assumption that its value is the same as that of java-variable-name. E.g. with the following info in the typemapping DD, JBoss will fail to deserialize incoming requests:

      <java-type>pack.JavaType</java-type>
       <root-type-qname xmlns:typeNS="http://namesp">typeNS:XMLType</root-type-qname>
       <qname-scope>complexType</qname-scope>
       <variable-mapping>
       <java-variable-name>typedElements</java-variable-name>
       <xml-element-name>collectionElements</xml-element-name>
       </variable-mapping>
       </java-xml-type-mapping>


      2. java-xml-type-mapping. JBoss ignores information provided by element bindings in favour of JavaBean introspection. In other words, given the following:

      class St {
       private Interface s;
       Interface getS() { return s; }
       void setS(Interface s) { this.s = s; }
      }
      
      class RefType implements Interface {...}
      
       <xsd:complexType name="St">
       <xsd:all>
       <xsd:element name="s" type="tns:RefType"/>
       </xsd:all>
       </xsd:complexType>
      
       <xsd:complexType name="RefType">
       <xsd:all>
       ...
       </xsd:all>
       </xsd:complexType>


      I want to ensure that the s element of the St complex type is mapped not to the Interface class but to the RefType class. To accomplish that I do the following:

      a) Map XML St to Java St:
      <java-xml-type-mapping>
       <java-type>St</java-type>
       <root-type-qname xmlns:typeNS="http://namesp">typeNS:St</root-type-qname>
       <qname-scope>complexType</qname-scope>
       <variable-mapping>
       <java-variable-name>s</java-variable-name>
       <xml-element-name>s</xml-element-name>
       </variable-mapping>
       </java-xml-type-mapping>


      b) Map XML RefType to Java RefType:
      <java-xml-type-mapping>
       <java-type>RefType</java-type>
       <root-type-qname xmlns:typeNS="http://namesp">typeNS:RefType </root-type-qname>
       <qname-scope>complexType</qname-scope>
       <variable-mapping>
       ...
       </variable-mapping>
       </java-xml-type-mapping>


      c) Map the s element of St to RefType to prevent it from being taken as the Interface class through JavaBean introspection:
      <java-xml-type-mapping>
       <java-type>RefType </java-type>
       <anonymous-type-qname>http://namesp:St>s</anonymous-type-qname>
       <qname-scope>element</qname-scope>
       </java-xml-type-mapping>


      JBoss correctly processes a and b but completely disregards c, thus failing to support this scenario.

      3. exception-mapping. JBoss ignores information provided by constructor-parameter-order...

      It would be very beneficial for the JBoss community if it were clarified what metadata from JAX-RPC Mapping DDs is actually used by JBoss and what ignored.

      Thank you in advance.

      Andrei.




        • 2. Re: JAX-RPC Mapping DD, what metadata is used by JBoss?
          Harald Boehme Newbie

          We observer a similary problem. The MetaData in the generated WSDD file are mostly ignored by the Serializer.

          The follwoing web service:

          <?xml version="1.0" encoding="UTF-8"?>
          
          <definitions
           name="MobtelPhoneLocationService"
           targetNamespace="http://www.asg-platform.org/scenarios/attractionbooking/services/MobtelPhoneLocationService"
           xmlns:tns="http://www.asg-platform.org/scenarios/attractionbooking/services/MobtelPhoneLocationService"
           xmlns="http://schemas.xmlsoap.org/wsdl/"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema"
           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
          
           <types>
           <xsd:schema
           targetNamespace="http://www.asg-platform.org/scenarios/attractionbooking/services/MobtelPhoneLocationService"
           xmlns:tns="http://www.asg-platform.org/scenarios/attractionbooking/services/MobtelPhoneLocationService"
           xmlns:rts="http://asg-platform.org/scenarios/attractionbooking/routes"
           xmlns:cts="http://asg-platform.org/scenarios/attractionbooking/contacts"
           xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          
           <xsd:import
           namespace="http://asg-platform.org/scenarios/attractionbooking/routes"
           schemaLocation="http://tb0.asg-platform.org/~saar/schemas/routes.xsd" />
          
           <xsd:import
           namespace="http://asg-platform.org/scenarios/attractionbooking/contacts"
           schemaLocation="http://tb0.asg-platform.org/~saar/schemas/contacts.xsd" />
          
           <xsd:complexType name="findPhoneLocation">
           <xsd:sequence>
           <xsd:element name="phoneNumber" type="cts:PhoneNumber" nillable="true"/></xsd:sequence></xsd:complexType>
          
           <xsd:complexType name="findPhoneLocationResponse">
           <xsd:sequence>
           <xsd:element name="location" type="rts:Location" nillable="true"/></xsd:sequence></xsd:complexType>
          
           <xsd:element name="findPhoneLocation" type="tns:findPhoneLocation"/>
           <xsd:element name="findPhoneLocationResponse" type="tns:findPhoneLocationResponse"/></xsd:schema></types>
          
           <message name="PhoneLocationEndpoint_findPhoneLocation">
           <part name="parameters" element="tns:findPhoneLocation"/></message>
          
           <message name="PhoneLocationEndpoint_findPhoneLocationResponse">
           <part name="result" element="tns:findPhoneLocationResponse"/></message>
          
           <portType name="PhoneLocationEndpoint">
           <operation name="findPhoneLocation">
           <input message="tns:PhoneLocationEndpoint_findPhoneLocation"/>
           <output message="tns:PhoneLocationEndpoint_findPhoneLocationResponse"/></operation></portType>
          
           <binding name="PhoneLocationEndpointBinding" type="tns:PhoneLocationEndpoint">
           <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
           <operation name="findPhoneLocation">
           <soap:operation soapAction=""/>
           <input>
           <soap:body use="literal"/></input>
           <output>
           <soap:body use="literal"/></output></operation></binding>
          
           <service name="MobtelPhoneLocationService">
           <port name="PhoneLocationEndpointPort" binding="tns:PhoneLocationEndpointBinding">
           <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
          


          Got this SOAPRequest:
          <?xml version="1.0" encoding="UTF-8" ?>
          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
           <soapenv:Header>
           <wsa:MessageID soapenv:mustUnderstand="0">uuid:b80dc2d0-1ee3-11da-baf4-8b01201e0182</wsa:MessageID>
           <wsa:To soapenv:mustUnderstand="0">http://localhost:8080/asg-services-mobtelphonelocationservice-1/PhoneLocationEndpointPort</wsa:To>
           <wsa:From soapenv:mustUnderstand="0">
           <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
           </wsa:From>
           <asg:SvcImplId xmlns:asg="http://www.asg-platform.org/namespaces" soapenv:mustUnderstand="0">5</asg:SvcImplId>
           <asg:SvcInstId xmlns:asg="http://www.asg-platform.org/namespaces" soapenv:mustUnderstand="0">1538</asg:SvcInstId>
           </soapenv:Header>
           <soapenv:Body>
           <findPhoneLocation xmlns="http://www.asg-platform.org/scenarios/attractionbooking/services/MobtelPhoneLocationService">
           <cts:phoneNumber xmlns:cts="http://asg-platform.org/scenarios/attractionbooking/contacts">
           <cts:areaCode xmlns:cts="http://asg-platform.org/scenarios/attractionbooking/attractions">+49</cts:areaCode>
           <cts:countryCode xmlns:cts="http://asg-platform.org/scenarios/attractionbooking/attractions">0331</cts:countryCode>
           <cts:number xmlns:cts="http://asg-platform.org/scenarios/attractionbooking/attractions">12345</cts:number>
           </cts:phoneNumber>
           </findPhoneLocation>
           </soapenv:Body>
          </soapenv:Envelope>
          


          We receive the following SOAPResponse

          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
           <soapenv:Body>
           <ns1:findPhoneLocationResponse xmlns:ns1="http://www.asg-platform.org/scenarios/attractionbooking/services/MobtelPhoneLocationService">
           <location>
           <name>Potsdamer Platz</name>
           <zipcode>10785</zipcode>
           <coordinates>
           <latitude>12.0</latitude>
           <longitude>21.0</longitude>
           </coordinates>
           <city>
           <name>Berlin</name>
           </city>
           <street>
           <name>Potsdamer Platz</name>
           </street>
           </location>
           </ns1:findPhoneLocationResponse>
           </soapenv:Body>
          </soapenv:Envelope>
          


          All prefixes and namespaces of the enclosed Response data are omited and we like to have them for later processing.

          Also debugging shows, that the Serialization favours JavaBean MetaData, which do not provide the full QName. Is this a bug ? and is there some configuration option to enforce all namespaces in SOAPResponse?

          • 3. Re: JAX-RPC Mapping DD, what metadata is used by JBoss?
            Andrei Iltchenko Newbie

            It is a pity that such an important issue still hasn't been commented on by JBoss developers...