1 Reply Latest reply on May 2, 2007 12:38 PM by Brian Paik

    JBoss JAXRPC SOAP client type mapping problem

    Brian Paik Newbie

      hi, i've been stuck on this issue for a few days and have no idea what's causing the following stack track:

      org.jboss.ws.WSException: Cannot obtain java type mapping for: {urn:grainger-com:xi:addrval_webservice:types}>AddrRequest
      at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.processDocElement(JAXRPCMetaDataBuilder.java:627)
      at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildParameterMetaDataDoc(JAXRPCMetaDataBuilder.java:886)
      at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.setupOperationsFromWSDL(JAXRPCMetaDataBuilder.java:214)
      at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaDataInternal(JAXRPCClientMetaDataBuilder.java:216)
      at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:133)
      at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:85)
      at org.jboss.ws.core.jaxrpc.client.ServiceImpl.(ServiceImpl.java:111)
      at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
      at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)

      i'm using JBoss 4.0.5 on jdk 1.4 (i have no choice but to use jdk 1.4 and thus can't use the newer ws api). my wsdl looks like the following:

      <?xml version="1.0"?>

      <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:p1="urn:me-com:xi:addrval_webservice"
      xmlns:p2="urn:me-com:xi:addrval_webservice:types"
      targetNamespace="urn:me-com:xi:addrval_webservice"
      name="MI_Request_To_Grp1">
      <wsdl:types>
      <xsd:schema targetNamespace="urn:me-com:xi:addrval_webservice:types">
      <xsd:element name="AddrRequest">
      <xsd:complexType name="Request">
      <xsd:all>
      <xsd:element name="InputKeyValue" type="xsd:string" />
      <xsd:element name="FirmName" type="xsd:string" />
      <xsd:element name="AddressLine1" type="xsd:string" />
      <xsd:element name="City" type="xsd:string" />
      ...
      </xsd:all>
      </xsd:complexType>
      </xsd:element>
      <xsd:element name="AddrResponse">
      <xsd:complexType name="Response">
      <xsd:all>
      <xsd:element name="Status" type="xsd:string" />
      <xsd:element name="StatusCode" type="xsd:string" />
      <xsd:element name="StatusDescription" type="xsd:string" />
      <xsd:element name="InputKeyValue" type="xsd:string" />
      <xsd:element name="FirmName" type="xsd:string" />
      <xsd:element name="AddressLine1" type="xsd:string" />
      <xsd:element name="AddressLine2" type="xsd:string" />
      <xsd:element name="AddressLine3" type="xsd:string" />
      <xsd:element name="AddressLine4" type="xsd:string" />
      <xsd:element name="City" type="xsd:string" />
      <xsd:element name="StateProvince" type="xsd:string" />
      <xsd:element name="PostalCode" type="xsd:string" />
      ...
      </xsd:all>
      </xsd:complexType>
      </xsd:element>
      </xsd:schema>
      </wsdl:types>
      <wsdl:message name="getRequest">
      <wsdl:part name="body" element="p2:AddrRequest"/>
      </wsdl:message>
      <wsdl:message name="returnResponse">
      <wsdl:part name="body" element="p2:AddrResponse"/>
      </wsdl:message>
      <wsdl:portType name="MI_Request_To_Grp1PortType">
      <wsdl:operation name="MI_Request_To_Grp1">
      <wsdl:input message="p1:getRequest"/>
      <wsdl:output message="p1:returnResponse"/>
      </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="MI_Request_To_Grp1Binding" type="p1:MI_Request_To_Grp1PortType">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
      <wsdl:operation name="MI_Request_To_Grp1">
      <soap:operation style="document" soapAction="http://someservicehere.com/soap1.1"/>
      <wsdl:input>
      <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal"/>
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="BusService_Grp1AddrVal_WebService">
      <wsdl:port name="MI_Request_To_Grp1Port" binding="p1:MI_Request_To_Grp1Binding">
      <soap:address location="http://me.com"/>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>

      wstools successfully generates the java files for the 2 objects, the service and remote interfaces. however, the debug logging shows the following similar errors:

      org.jboss.ws.tools.helpers.MappingFileGeneratorHelper:getJavaTypeAsString:758 - Typemapping lookup failed for {urn:grainger-com:xi:addrval_webservice:types}AddrRequest
      org.jboss.ws.tools.helpers.MappingFileGeneratorHelper:getJavaTypeAsString:759 - Falling back to identifier generation
      org.jboss.ws.tools.helpers.MappingFileGeneratorHelper:getJavaTypeAsString:758 - Typemapping lookup failed for {urn:grainger-com:xi:addrval_webservice:types}AddrResponse
      org.jboss.ws.tools.helpers.MappingFileGeneratorHelper:getJavaTypeAsString:759 - Falling back to identifier generation

      although i have used wstools to generate the java classes, i am not using the JBoss generated jaxrpc-mapping.xml to create the service instance. the following is my java code:

      ServiceFactoryImpl factory = new ServiceFactoryImpl();
      QName namespace = new QName("urn:me-com:xi:addrval_webservice", "BusService_Grp1AddrVal_WebService");
      ServiceImpl service = null;
      try {
      service = (ServiceImpl) factory.createService(this.getURL(wsdlLocation), namespace);
      } catch (ServiceException sex) {
      // whoops
      }
      return service;

      it appears that the JBoss api cannot successfully find the elements from the messages. why would that be?

      i have validated my wsdl vs. the w3c specifications (or at least i think i have) and the wsdl can successfully hit the service via XmlSpy.