0 Replies Latest reply on Mar 24, 2007 5:51 AM by santhoshitha gokul

    NoSuchMethodError in clientside of a jaxws ws

    santhoshitha gokul Newbie

      Hi,
      I am using jbossws1.2.0 on jboss as 4.0.5, and jdk 1.6.0. i have a web service that contains methods that accept arrays of custom classes as one of its parameters, and returns an array of strings. in the wsdl generated i see that separate classes are generated for the arrays of the custom objects and strings. objects of these classes are instead taken as parameters from the client. basically the wsdl contains separate complextypes created for the arrays of the custom objects and strings. when i do a wsdl to java generation on the client i see an sei and a service class that contains a get(service)port method. apart from these there are namespace and package mapping classes.

      i would like to use a static stub at the client side, since my client is a standalone java app, that acts as an adapter and interacts with other apps in my organization. how do i get a static stub that implements the sei on the clientside using the jaxws tools provided by jboss? as of now i have a cleint that tries to obtain the port by instanciating the service class and invoking the webservice method. since there is no impl on the client side, i get a NoSuchMethodError.
      i have also tried using the dynamic proxy invocation from my client and get an exception there too. the exception reads, Cannot obtain java type mapping for: {http://datamodel.nm_update}securityAttributesArray, where http://datamodel.nm_update is my target namespace and securityAttributeArray is the complex type generated in the wsdl for the array of custom objects, which is the webservice method's parameter.
      below is a section of the wsdl generated for my ws.

      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="NmUpdateService_Service" targetNamespace="http://datamodel.nm_update" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://jaxb.dev.java.net/array" xmlns:tns="http://datamodel.nm_update" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

      <xs:schema targetNamespace="http://jaxb.dev.java.net/array" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType final="#all" name="stringArray">
      <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="xs:string"/>
      </xs:sequence>
      </xs:complexType>
      </xs:schema>
      <xs:schema targetNamespace="http://datamodel.nm_update" version="1.0" xmlns:tns="http://datamodel.nm_update" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:complexType name="securityAttributes">
      <xs:sequence>
      <xs:element minOccurs="0" name="colName" type="xs:string"/>
      <xs:element name="index" type="xs:int"/>
      <xs:element name="spn" type="xs:int"/>
      <xs:element minOccurs="0" name="value" type="xs:anyType"/>
      </xs:sequence>
      </xs:complexType>
      <xs:complexType final="#all" name="securityAttributesArray">
      <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="item" nillable="true" type="tns:securityAttributes"/>
      </xs:sequence>
      </xs:complexType>
      </xs:schema>












      the java name of the webservice method is updateAttributes, and wsdl name is NmUpdateService_updateAttributesResponse.

      1) could the nosuchmethoderror be because of incomplete/wrong mapping of type names from wsdl to java?

      2) what could the reason for the inability to map between the securityattributesarray object from to java to wsdl be during invocation from the client?

      3)will the provider and dispatch APIs help in any way for dynamic invocation?

      any help is much appreciated. thanks.