1 Reply Latest reply on Jul 26, 2007 10:48 AM by chui

    Cannot obtain java type mapping

    gapesteguia

      I want to use the following code in order to inkoke the USZip web service, but I got the exception:

      org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://www.webserviceX.NET}>GetInfoByZIP

      I'm using jboss-4.2.1.GA. Could anyone help me ?.

      Thanks


      public class CallWS {
       String result;
       public String CallUSZipCode() {
       try
      
       {
      
       URL url = new URL("http://www.webservicex.net/uszip.asmx?wsdl");
       String targetNamespace = "http://www.webserviceX.NET";
       QName serviceName = new QName(targetNamespace, "USZip");
       QName portName = new QName(targetNamespace, "USZipHttpGet");
       QName operationName = new QName(targetNamespace, "getInfoByZip");
      
       // create service
       ServiceFactory factory = ServiceFactory.newInstance();
      
       Service service = factory.createService(url, serviceName);
      
       // create call
       Call call = service.createCall(portName, operationName);
       // invoke the remote web service
       result = (String) call.invoke(new Object[] {"75080"});
       //System.out.println(result);
      
       } catch(Exception e){
       System.out.println(e);
       result = e.toString();
       }
      
       return (result);
      }
      }
      


        • 1. Re: Cannot obtain java type mapping
          chui

          Maybe you need to use a mapping.xml file... If so, you shouldn't use ServiceFactory because it doesn't support invoking with the mapping file url (or at least it didn't). Mapping, however, is possible with ServiceFactoryImpl, which comes with JBoss AS.

          I'm new to 4.2.1 and I've never invoked that service, but I hope this answer can help you ^^

          Cya!