1 2 Previous Next 20 Replies Latest reply on Jan 18, 2008 5:38 AM by pipo323400 Go to original post
      • 15. Re: Cannot obtain java type mapping for: {http://org.mazurek
        jason.greene

        JSR-181 by itself is server side only. When you develop a client to talk to a JSR-181 endpoint, you have to consume the wsdl using a tool (wstools), and generate a mapping file. You also can not reuse any of the annotated interfaces because the client and server are fundamentally disconnected, they might be different.

        JAX-WS solves this problem by describing how to use the annotations on the client side. When we release a Java EE 5 compliant server (jbossws 2.0) you will be able to do this. Until then you will have to use the standard Java EE 1.4 client API.

        -Jason

        • 16. Re: Cannot obtain java type mapping for: {http://org.mazurek
          sandello

          What I should do to connect some public webservice in the Internet (like http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=48)?
          I create small client method:

           @Test
           public void weather() {
           QName serviceQName = new QName("http://www.webserviceX.NET", "GlobalWeather");
          
           try {
           ServiceFactory factory = ServiceFactory.newInstance();
           assertNotNull(factory);
          
           String endpoint = "http://www.webservicex.net/globalweather.asmx?wsdl";
           URL url = new URL(endpoint);
           assertNotNull(url);
          
           Service service = factory.createService(url, serviceQName);
           assertNotNull(service);
          
           Call call = service.createCall();
          
           QName methodQName = new QName("http://www.webserviceX.NET", "GetWeather");
           call.setOperationName(methodQName);
           assertFalse(call.isParameterAndReturnSpecRequired(methodQName));
          
           call.setTargetEndpointAddress(endpoint);
          
           QName typeName = call.getPortTypeName();
           assertNotNull(typeName);
          
           System.out.println(typeName);
          
           call.invoke(new Object[] {"London", "UK"});
          
          
           } catch (Exception e) {
           e.printStackTrace(); File | Settings | File Templates.
           }
           }
          


          When I try to execute this I receive exception:
          org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://www.webserviceX.NET}>GetWeather
           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.<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)
           at com.company.ws.client.TestWS.weather(TestWS.java:131)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
           at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
           at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
           at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
           at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
           at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
           at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
           at
          


          Where I should get jaxrpc-mapping.xml for this public ws?

          • 18. Re: Cannot obtain java type mapping for: {http://org.mazurek
            poyge394

             

             URL wsdlLocation = new URL("http://example.org/my.wsdl");
             QName serviceName = new QName("http://example.org/sample", "MyService");
             Service service = Service.create(wsdlLocation, serviceName);
            



            Service.create does not exists.

            • 19. Re: Cannot obtain java type mapping for: {http://org.mazurek
              paoletto

               

              "thomas.diesler@jboss.com" wrote:
              Your DII client does not have a jaxrpc-mapping.xml. You can use

              ServiceFactoryImpl.createService(wsdlURL, serviceName, mappingURL)
              



              how is this approach changed now?

              • 20. Re: Cannot obtain java type mapping for: {http://org.mazurek
                pipo323400

                Hi,

                I have been working several days with this issue. At last this problem is caused in the Client application. In my case a web app. It was not able to recognize the type that the server was returning (ArrayList in this case).

                Another important thing, correct me if I am wrong, is that Web Services Soap Messages not support ArrayList directly, so if you would like to use it you must implement an ArrayList by yourself. A pretty hard work. The thing that I have done is to return an Array (suported by the Web Services) of my own objects, that I have mapped previously.

                My solution was to create a Web Service Client using Eclipse Wtp. It creates a EAR that includes all the necessary stuff for map the user types.

                1 2 Previous Next