This discussion is archived
4 Replies Latest reply: Jul 14, 2013 11:16 PM by user595592 RSS

NPE when working with connections.xml for Web Service client

user595592 Newbie
Currently Being Moderated

Our ADF Web Service clients needs to read the WSDL and End point URL from connections.xml. But this is giving an Error.

 

 

 

Here are the details:

 

 

jdevloper 11.1.1.6.0

Weblogic 10.3.5

OWSM 11.1.1.6

 

 

 

From my ADF based Application I need to call out a web service.

For this I have built a Web Service Proxy and coded to call it from the application.

 

 

Since the app needs to run through the development testing deployment lifecycle and hence be deployed on different environments, we need the ability allow configuration of wsdl and end point URL for the web service call without the need to recompile the app.

We want to leverage the connections.xml for this purpose.

http://docs.oracle.com/cd/E23943_01/web.1111/b31974/web_services.htm#autoId6

 

 

My connection.xml looks like:

   <Reference name="MyService" className="oracle.adf.model.connection.webservice.impl.WebServiceConnectionImpl" xmlns="">

      <Factory className="oracle.adf.model.connection.webservice.api.WebServiceConnectionFactory"/>

      <RefAddresses>

         <XmlRefAddr addrType="WebServiceConnection">

            <Contents>

               <wsconnection description="file:/C:/JDeveloper/mywork/jdev116/DeployTstCnnxtnLov/LovProxy/src/abc/lov/proxy/MyService.wsdl" service="{http://xmlns.oracle.com/Enterprise/HCM/services/MyService.1}MyService">

                  <model name="{http://xmlns.oracle.com/Enterprise/HCM/services/MyService.1}MyService" xmlns="http://oracle.com/ws/model">

                     <service name="{http://xmlns.oracle.com/Enterprise/HCM/services/MyService.1}MyService">

                        <port name="MyService_Port" binding="{http://xmlns.oracle.com/Enterprise/HCM/services/MyService.1}MyService_Binding">

                           <soap addressUrl="http://<machine:port>/PSIGW/PeopleSoftServiceListeningConnector" xmlns="http://schemas.xmlsoap.org/wsdl/soap/"/>

                           <operation name="MyServiceOperation">

                              <soap soapAction="MyServiceOperation.v1" xmlns="http://schemas.xmlsoap.org/wsdl/soap/"/>

                              <output name="MyService_RESP.V1"/>

                              <input name="MyService_REQ.V1"/>

                           </operation>

                        </port>

                     </service>

                  </model>

               </wsconnection>

            </Contents>

         </XmlRefAddr>

      </RefAddresses>

   </Reference>

  

My code in the Service Client Looks like:

  @WebServiceRef

  private static MyService myservice;

 

            Context ctx = ADFContext.getCurrent().getConnectionsContext();

           

            WebServiceConnection wsc =

                (WebServiceConnection)ctx.lookup("MyService");

           

            String urlString = wsc.getWsdlUrlStr();

            System.out.println("WSDL URL: "+urlString);

           

            myservice = wsc.getJaxWSPort(MyService.class);

 

 

            MyService_PortType port = myservice.getMyService_Port();

 

 

  ServiceRequest request = new ServiceRequest();

 

  ServiceResponse response = port.MyServiceOeration(request);

 

The WSDL URL is being read correctly.

 

 

Error:

This error appears to be triggered by the code:

    myservice = wsc.getJaxWSPort(MyService.class);

 

 

java.lang.NullPointerException

        at java.lang.Class.isAssignableFrom(Native Method)

        at oracle.j2ee.ws.common.jaxws.runtime.GenericJavaType.create(GenericJavaType.java:97)

        at oracle.j2ee.ws.common.jaxws.runtime.GenericJavaType.create(GenericJavaType.java:118)

        at oracle.j2ee.ws.common.jaxws.runtime.OperationMappingModeler.processParameters(OperationMappingModeler.java:268)

        at oracle.j2ee.ws.common.jaxws.runtime.OperationMappingModeler.processMethod(OperationMappingModeler.java:155)

        at oracle.j2ee.ws.common.jaxws.runtime.ServiceEndpointRuntimeModeler.buildRuntimeModel(ServiceEndpointRuntimeModeler.java:114)

        at oracle.j2ee.ws.client.jaxws.WsClientProxyFactory.getRuntimeMetadata(WsClientProxyFactory.java:69)

        at oracle.j2ee.ws.client.jaxws.WsClientProxyFactory.createProxy(WsClientProxyFactory.java:126)

        at oracle.j2ee.ws.client.jaxws.WsClientProxyFactory.createProxy(WsClientProxyFactory.java:106)

        at oracle.j2ee.ws.common.jaxws.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:219)

        at oracle.j2ee.ws.common.jaxws.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:249)

        at oracle.adf.model.connection.webservice.impl.WebServiceConnectionImpl.getJaxWSPort(WebServiceConnectionImpl.java:385)

        at abc.lov.proxy.MyService_PortClient.fetchDesc(MyService_PortClient.java:84)

        at abc.lov.ServiceManager.fetchEmplID(ServiceManager.java:13)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points