JBoss Community

JBOSS5+java6+Cannot obtain java type mapping+setProperty must be overridden by all subclasses of SOAPMessage

created by Ravi Sawlani in JBoss Web Services - View the full discussion

Hi

A Web Service is deployed on jboss-as server of jboss-soa-p.5.0.0 (Server version 5.0.2.GA) running on jdk 1.6.0_30, following is the code and WSDL

 

import javax.jws.WebMethod;

import javax.jws.WebService;

@WebService

public class TestService {

    

      @WebMethod

      public String sayHello(String name){

            String greeting="Welcome......"+name;

            return greeting;

      }

}

 

WSDL :

<definitions name="TestServiceService" targetNamespace="http://testPack/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://testPack/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<types>

<xs:schema targetNamespace="http://testPack/" version="1.0" xmlns:tns="http://testPack/"                 xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="sayHello" type="tns:sayHello" />

  <xs:element name="sayHelloResponse" type="tns:sayHelloResponse" />

<xs:complexType name="sayHello">

<xs:sequence>

  <xs:element minOccurs="0" name="arg0" type="xs:string" />

  </xs:sequence>

  </xs:complexType>

<xs:complexType name="sayHelloResponse">

<xs:sequence>

  <xs:element minOccurs="0" name="return" type="xs:string" />

  </xs:sequence>

  </xs:complexType>

  </xs:schema>

  </types>

<message name="TestService_sayHelloResponse">

  <part element="tns:sayHelloResponse" name="sayHelloResponse" />

  </message>

<message name="TestService_sayHello">

  <part element="tns:sayHello" name="sayHello" />

  </message>

<portType name="TestService">

<operation name="sayHello" parameterOrder="sayHello">

  <input message="tns:TestService_sayHello" />

  <output message="tns:TestService_sayHelloResponse" />

  </operation>

  </portType>

<binding name="TestServiceBinding" type="tns:TestService">

  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

<operation name="sayHello">

  <soap:operation soapAction="" />

<input>  <soap:body use="literal" />  </input>

<output>  <soap:body use="literal" />   </output>

  </operation>

  </binding>

<service name="TestServiceService">

<port binding="tns:TestServiceBinding" name="TestServicePort">

  <soap:address location="http://ipadd:8080/TestWebService" />

  </port>

  </service>

  </definitions>

 

When we call this service through following DII client code :

 

URL url = new URL("http://ipadd:8080/TestWebService?wsdl");

String ns = "http://testPack/";

QName qname = new QName (ns,"TestServiceService");

QName port = new QName (ns, "TestServicePort");

QName operation = new QName(ns, "sayHello");

ServiceFactory factory = ServiceFactory.newInstance();

Service service = factory.createService(url, qname);

Call call = service.createCall(port, operation);

String test1=(String)call.invoke(new Object[]{"XYZ"});

System.out.println("this is the call" +test1);

 

It gives the following java mapping  error :

Exception in thread "main"

org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://testPack/}sayHelloat 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:217)

at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:134)

at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:86)

at org.jboss.ws.core.jaxrpc.client.ServiceImpl.<init>(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)

Instead if Complex Types are removed from previous WSDL and changed to xs:string as shown:

 

<types>

<xs:schema targetNamespace="http://testPack/" version="1.0" xmlns:tns="http://testPack/"                 xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="sayHello" type=" xs:string " />

<xs:element name="sayHelloResponse" type=" xs:string " />

</xs:schema>

</types>

 

Now when we run the DII client again, it does not ask for java mapping but gives an error regarding set Property as shown (when client is running on jdk 1.6.0_30):

 

Exception in thread "main" java.rmi.RemoteException: Call invocation failed; nested exception is:

      java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage

      at org.jboss.ws.core.jaxrpc.client.CallImpl.invokeInternal(CallImpl.java:535)

      at org.jboss.ws.core.jaxrpc.client.CallImpl.invoke(CallImpl.java:275)

 

However when this modified wsdl is called using DII client running on jdk 1.5 the web service is invoked without any error

but the web method do not receive the parameters being passed to it from the DII client.

But when we make stubs using jbossws API and call the web method using stubs, everything works fine irrespective of jdk version.

 

Please HELP ME OUT!!!! :(

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community