I have a web service that I am calling using a client generated using the wsdl2java tool from Apache CXF. Everything was working well until we moved the web service behind https. Now I'm getting a NullPointerException when I try to get the Port.
I'm pretty sure that it's not a problem with the server's certificate since I can get the WSDL for the web service.
Specs: Apache CXF 2.7.6 Glassfish 3.1.2.2
Here is my client code:
public final static QName BasicHttpEndpoint2 = new QName("http://tempuri.org/", "BasicHttpEndpoint2");
@WebEndpoint(name = "BasicHttpsEndpoint")
public IAppts getBasicHttpsEndpoint()
{
return super.getPort(BasicHttpsEndpoint, IAppts.class);
}
And here is part StackTrace I'm getting:
Caused by: java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:78)
at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
at com.sun.xml.wss.jaxws.impl.RMPolicyResolver.getResourceReader(RMPolicyResolver.java:114)
at com.sun.xml.wss.jaxws.impl.RMPolicyResolver.unmarshalPolicy(RMPolicyResolver.java:107)
at com.sun.xml.wss.jaxws.impl.RMPolicyResolver.getOperationLevelPolicy(RMPolicyResolver.java:98)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.buildProtocolPolicy(SecurityTubeBase.java:1298)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.collectPolicies(SecurityTubeBase.java:774)
at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.<init>(SecurityTubeBase.java:274)
at com.sun.xml.wss.jaxws.impl.SecurityClientTube.<init>(SecurityClientTube.java:152)
at com.sun.xml.wss.provider.wsit.SecurityTubeFactory.__AW_createTube(SecurityTubeFactory.java:285)
at com.sun.xml.wss.provider.wsit.SecurityTubeFactory.createTube(SecurityTubeFactory.java)
at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.__AW_createClient(TubelineAssemblerFactoryImpl.java:130)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java)
at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:314)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:286)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:230)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:245)
at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:91)
at com.sun.xml.ws.client.WSServiceDelegate.getStubHandler(WSServiceDelegate.java:725)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:703)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:387)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:363)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:345)
at javax.xml.ws.Service.getPort(Service.java:134)
at trs.webservice.utilities.Appts.getBasicHttpsEndpoint(Appts.java:99)