0 Replies Latest reply on Oct 26, 2004 11:08 AM by aagmon

    facing the nullPointer-Port error using application client

      hi
      i dont mean to repost this exception , i think that here the situation is a bit different :

      application client using rpc/lit service throwing this exception:
      (service is working fine with a servlet client -with almost same code)

      [java] 2004-10-26 17:41:41,962 ERROR org.jboss.webservice.client.PortProxy[main] - Port error
       [java] java.lang.NullPointerException
       [java] at java.util.Hashtable.put(Unknown Source)
       [java] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
       [java] at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:262)
       [java] at org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:655)
       [java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:432)
       [java] at org.apache.axis.Message.getContentType(Message.java:498)
       [java] at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:387)


      now its a simple service method using only one argument - a custom type made of 2 strings .. here is the client and the wsdl

      client



      System.out.println("looking...");
      
       InitialContext ctx = getContext();
      
       System.out.println("got context looking up service");
      
       javax.xml.rpc.Service service = (javax.xml.rpc.Service)
       ctx.lookup("java:comp/env/service/CustomerEchoService");
      
       System.out.println("getting port");
      
       repeaterEndpoint endpoint = (repeaterEndpoint)
       service.getPort(repeaterEndpoint.class);
      
       System.out.println("got port");
      
       Customer c = new Customer();
       c.setName("john");
       c.setLast("smith");
      
       System.out.println("calling service");
      
       Customer a =
       endpoint.echoCustomer(c);


      client output

      [java] looking...
       [java] got context looking up service
       [java] getting port
       [java] got port
       [java] calling service
       [java] 2004-10-26 17:41:41,962 ERROR org.jboss.webservice.client.PortProxy[main] - Port error
       [java] java.lang.NullPointerException
       [java] at java.util.Hashtable.put(Unknown Source)
       [java] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(Unknown Source)
       [java] at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:262)
       [java] at org.apache.axis.MessagePart.getAsSOAPEnvelope(MessagePart.java:655)
       [java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:432)
       [java] at org.apache.axis.Message.getContentType(Message.java:498)
       [java] at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:387)
       [java] at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:127)
       [java] at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:73)
       [java] at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:162)
       [java] at org.apache.axis.SimpleChain.invoke(SimpleChain.java:125)
       [java] at org.jboss.webservice.client.ClientEngine.invoke(ClientEngine.java:126)
       [java] at org.apache.axis.client.Call.invokeEngine(Call.java:3039)
       [java] at org.apache.axis.client.Call.invoke(Call.java:3024)
       [java] at org.apache.axis.client.Call.invoke(Call.java:2619)
       [java] at org.apache.axis.client.Call.invoke(Call.java:2524)
       [java] at org.apache.axis.client.Call.invokeInternal(Call.java:1976)
       [java] at org.apache.axis.client.Call.invoke(Call.java:1917)
       [java] at org.jboss.webservice.client.CallImpl.invoke(CallImpl.java:175)
       [java] at org.apache.axis.client.AxisClientProxy.invoke(AxisClientProxy.java:251)
       [java] at $Proxy2.echoCustomer(Unknown Source)
       [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       [java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       [java] at java.lang.reflect.Method.invoke(Unknown Source)



      WSDL


      <?xml version="1.0" encoding="UTF-8"?>
      
      <definitions name="CustomerEchoService" targetNamespace="http://com.alon.beans/service" xmlns:tns="http://com.alon.beans/service" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://com.alon.beans/service/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
       <types>
       <schema targetNamespace="http://com.alon.beans/service/types" xmlns:tns="http://com.alon.beans/service/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
       <complexType name="Customer">
       <sequence>
       <element name="last" type="string" nillable="true"/>
       <element name="name" type="string" nillable="true"/></sequence></complexType></schema></types>
       <message name="repeaterEndpoint_echoCustomer">
       <part name="Customer_1" type="ns2:Customer"/></message>
       <message name="repeaterEndpoint_echoCustomerResponse">
       <part name="result" type="ns2:Customer"/></message>
       <portType name="repeaterEndpoint">
       <operation name="echoCustomer" parameterOrder="Customer_1">
       <input message="tns:repeaterEndpoint_echoCustomer"/>
       <output message="tns:repeaterEndpoint_echoCustomerResponse"/></operation></portType>
       <binding name="repeaterEndpointBinding" type="tns:repeaterEndpoint">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
       <operation name="echoCustomer">
       <soap:operation soapAction=""/>
       <input>
       <soap:body use="literal" namespace="http://com.alon.beans/service"/></input>
       <output>
       <soap:body use="literal" namespace="http://com.alon.beans/service"/></output></operation></binding>
       <service name="CustomerEchoService">
       <port name="repeaterEndpointPort" binding="tns:repeaterEndpointBinding">
       <soap:address location="http://213.8.11.44:8080/echoCustomer/CustomerEchoService"/></port></service></definitions>