getEntityMetadata causes java.lang.NullPointerException

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
matthewv.vtq
User
Posts: 1
Joined: Wed Dec 31, 1969 8:00 pm

getEntityMetadata causes java.lang.NullPointerException

Post by matthewv.vtq » Tue Sep 18, 2012 2:30 pm

Hello, I am trying to call getEntityMetadata on the Candidate entity and I'm getting an error. Here are the vitals:

API 2.5 (https://api.bullhornstaffing.com/webservices-2.5/?wsdl)
PHP 5.3.3-7+squeeze14

PHP Code:

Code: Select all

$find_request = array(
	'session' => $this->_API_sessionKey,
	'entityName' => $entity
);
		
$findResult = $this->_BHclient->getEntityMetadata($find_request);
PHP error: Notice: Undefined variable: findResult...

SOAP Request:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://apiservice.bullhorn.com/"><SOAP-ENV:Body><ns1:getEntityMetadata><session>rO0ABXVyAAJbQqzzF...</session><entityName>Candidate</entityName></ns1:getEntityMetadata></SOAP-ENV:Body></SOAP-ENV:Envelope>
SOAP Response:

Code: Select all

<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"><faultcode>S:Server</faultcode><faultstring>java.lang.NullPointerException</faultstring><detail><ns2:exception xmlns:ns2="http://jax-ws.dev.java.net/" class="java.lang.NullPointerException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false"><ns2:stackTrace><ns2:frame class="com.bullhorn.dataservice.api.meta.ApiPropertyMeta" file="ApiPropertyMeta.java" line="179" method="initializeApiPropertyMeta"/><ns2:frame class="com.bullhorn.dataservice.api.meta.ApiPropertyMeta" file="ApiPropertyMeta.java" line="29" method="<init>"/><ns2:frame class="com.bullhorn.dataservice.api.meta.ApiEntityMeta" file="ApiEntityMeta.java" line="64" method="initializeApiEntityMetadata"/><ns2:frame class="com.bullhorn.dataservice.api.meta.ApiEntityMeta" file="ApiEntityMeta.java" line="49" method="<init>"/><ns2:frame class="com.bullhorn.dataservice.api.ApiDataServiceImpl" file="ApiDataServiceImpl.java" line="711" method="getEntityMetadata"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke"/><ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke"/><ns2:frame class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke"/><ns2:frame class="org.springframework.aop.support.AopUtils" file="AopUtils.java" line="307" method="invokeJoinpointUsingReflection"/><ns2:frame class="org.springframework.aop.framework.ReflectiveMethodInvocation" file="ReflectiveMethodInvocation.java" line="182" method="invokeJoinpoint"/><ns2:frame class="org.springframework.aop.framework.ReflectiveMethodInvocation" file="ReflectiveMethodInvocation.java" line="149" method="proceed"/><ns2:frame class="org.springframework.remoting.support.RemoteInvocationTraceInterceptor" file="RemoteInvocationTraceInterceptor.java" line="77" method="invoke"/><ns2:frame class="org.springframework.aop.framework.ReflectiveMethodInvocation" file="ReflectiveMethodInvocation.java" line="171" method="proceed"/><ns2:frame class="org.springframework.aop.framework.JdkDynamicAopProxy" file="JdkDynamicAopProxy.java" line="204" method="invoke"/><ns2:frame class="$Proxy185" line="unknown" method="getEntityMetadata"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke"/><ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke"/><ns2:frame class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke"/><ns2:frame class="org.springframework.remoting.support.RemoteInvocation" file="RemoteInvocation.java" line="205" method="invoke"/><ns2:frame class="org.springframework.remoting.support.DefaultRemoteInvocationExecutor" file="DefaultRemoteInvocationExecutor.java" line="38" method="invoke"/><ns2:frame class="org.springframework.remoting.support.RemoteInvocationBasedExporter" file="RemoteInvocationBasedExporter.java" line="78" method="invoke"/><ns2:frame class="org.springframework.remoting.support.RemoteInvocationBasedExporter" file="RemoteInvocationBasedExporter.java" line="114" method="invokeAndCreateResult"/><ns2:frame class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter" file="HttpInvokerServiceExporter.java" line="74" method="handleRequest"/><ns2:frame class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter" file="HttpRequestHandlerAdapter.java" line="49" method="handle"/><ns2:frame class="org.springframework.web.servlet.DispatcherServlet" file="DispatcherServlet.java" line="875" method="doDispatch"/><ns2:frame class="org.springframework.web.servlet.DispatcherServlet" file="DispatcherServlet.java" line="807" method="doService"/><ns2:frame class="org.springframework.web.servlet.FrameworkServlet" file="FrameworkServlet.java" line="571" method="processRequest"/><ns2:frame class="org.springframework.web.servlet.FrameworkServlet" file="FrameworkServlet.java" line="511" method="doPost"/><ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="710" method="service"/><ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="803" method="service"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="290" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame class="org.jboss.web.tomcat.filters.ReplyHeaderFilter" file="ReplyHeaderFilter.java" line="96" method="doFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="235" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame class="com.intergral.fusionreactor.filter.FusionReactorFilter" file="FusionReactorFilter.java" line="376" method="b"/><ns2:frame class="com.intergral.fusionreactor.filter.FusionReactorFilter" file="FusionReactorFilter.java" line="254" method="c"/><ns2:frame class="com.intergral.fusionreactor.filter.FusionReactorFilter" file="FusionReactorFilter.java" line="164" method="doFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="235" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame class="org.apache.catalina.core.StandardWrapperValve" file="StandardWrapperValve.java" line="230" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardContextValve" file="StandardContextValve.java" line="175" method="invoke"/><ns2:frame class="org.jboss.web.tomcat.security.SecurityAssociationValve" file="SecurityAssociationValve.java" line="179" method="invoke"/><ns2:frame class="org.jboss.web.tomcat.security.JaccContextValve" file="JaccContextValve.java" line="84" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardHostValve" file="StandardHostValve.java" line="128" method="invoke"/><ns2:frame class="org.apache.catalina.valves.ErrorReportValve" file="ErrorReportValve.java" line="104" method="invoke"/><ns2:frame class="org.jboss.web.tomcat.service.jca.CachedConnectionValve" file="CachedConnectionValve.java" line="157" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardEngineValve" file="StandardEngineValve.java" line="109" method="invoke"/><ns2:frame class="org.apache.catalina.connector.CoyoteAdapter" file="CoyoteAdapter.java" line="241" method="service"/><ns2:frame class="org.apache.coyote.http11.Http11Processor" file="Http11Processor.java" line="844" method="process"/><ns2:frame class="org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler" file="Http11Protocol.java" line="580" method="process"/><ns2:frame class="org.apache.tomcat.util.net.JIoEndpoint$Worker" file="JIoEndpoint.java" line="447" method="run"/><ns2:frame class="java.lang.Thread" file="Thread.java" line="662" method="run"/><ns2:frame class="org.springframework.remoting.support.RemoteInvocationUtils" file="RemoteInvocationUtils.java" line="47" method="fillInClientStackTraceIfPossible"/><ns2:frame class="org.springframework.remoting.support.RemoteInvocationResult" file="RemoteInvocationResult.java" line="115" method="recreate"/><ns2:frame class="org.springframework.remoting.support.RemoteInvocationBasedAccessor" file="RemoteInvocationBasedAccessor.java" line="85" method="recreateRemoteInvocationResult"/><ns2:frame class="org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor" file="HttpInvokerClientInterceptor.java" line="147" method="invoke"/><ns2:frame class="org.springframework.aop.framework.ReflectiveMethodInvocation" file="ReflectiveMethodInvocation.java" line="171" method="proceed"/><ns2:frame class="org.springframework.aop.framework.JdkDynamicAopProxy" file="JdkDynamicAopProxy.java" line="204" method="invoke"/><ns2:frame class="$Proxy296" line="unknown" method="getEntityMetadata"/><ns2:frame class="com.bullhorn.apiservice.impl.DataService" file="DataService.java" line="320" method="getEntityMetadata"/><ns2:frame class="com.bullhorn.apiservice.ApiServiceImpl" file="ApiServiceImpl.java" line="85" method="getEntityMetadata"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke"/><ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke"/><ns2:frame class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke"/><ns2:frame class="com.sun.xml.ws.api.server.InstanceResolver$1" file="InstanceResolver.java" line="246" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="146" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="257" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="598" method="__doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="557" method="_doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="542" method="doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="439" method="runSync"/><ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="243" method="process"/><ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="471" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="244" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="135" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate" file="WSServletDelegate.java" line="129" method="doGet"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate" file="WSServletDelegate.java" line="160" method="doPost"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSSpringServlet" file="WSSpringServlet.java" line="52" method="doPost"/><ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="710" method="service"/><ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="803" method="service"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="290" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame class="com.bullhorn.apiservice.WsdlFilter" file="WsdlFilter.java" line="43" method="doFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="235" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame class="org.jboss.web.tomcat.filters.ReplyHeaderFilter" file="ReplyHeaderFilter.java" line="96" method="doFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="235" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame class="com.intergral.fusionreactor.filter.FusionReactorFilter" file="FusionReactorFilter.java" line="376" method="b"/><ns2:frame class="com.intergral.fusionreactor.filter.FusionReactorFilter" file="FusionReactorFilter.java" line="254" method="c"/><ns2:frame class="com.intergral.fusionreactor.filter.FusionReactorFilter" file="FusionReactorFilter.java" line="164" method="doFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="235" method="internalDoFilter"/><ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame class="org.apache.catalina.core.StandardWrapperValve" file="StandardWrapperValve.java" line="230" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardContextValve" file="StandardContextValve.java" line="175" method="invoke"/><ns2:frame class="org.jboss.web.tomcat.security.SecurityAssociationValve" file="SecurityAssociationValve.java" line="179" method="invoke"/><ns2:frame class="org.jboss.web.tomcat.security.JaccContextValve" file="JaccContextValve.java" line="84" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardHostValve" file="StandardHostValve.java" line="128" method="invoke"/><ns2:frame class="org.apache.catalina.valves.ErrorReportValve" file="ErrorReportValve.java" line="104" method="invoke"/><ns2:frame class="org.jboss.web.tomcat.service.jca.CachedConnectionValve" file="CachedConnectionValve.java" line="157" method="invoke"/><ns2:frame class="org.apache.catalina.core.StandardEngineValve" file="StandardEngineValve.java" line="109" method="invoke"/><ns2:frame class="org.apache.catalina.connector.CoyoteAdapter" file="CoyoteAdapter.java" line="241" method="service"/><ns2:frame class="org.apache.coyote.http11.Http11Processor" file="Http11Processor.java" line="844" method="process"/><ns2:frame class="org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler" file="Http11Protocol.java" line="580" method="process"/><ns2:frame class="org.apache.tomcat.util.net.JIoEndpoint$Worker" file="JIoEndpoint.java" line="447" method="run"/><ns2:frame class="java.lang.Thread" file="Thread.java" line="619" method="run"/></ns2:stackTrace></ns2:exception></detail></S:Fault></S:Body></S:Envelope>
I've tried it with and without privateLabelId and it makes no difference.

Thanks a million.

P.S. the API example looks a little messed up (123privateLabelId>):

Code: Select all

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:apis="http://apiservice.bullhorn.com/">

   <soapenv:Header/>

   <soapenv:Body>

      <apis:getEntityMetadata>

         <session>key</session>

         <entityName>Candidate</entityName>

         <privateLabelId>123privateLabelId>

      </apis:getEntityMetadata>

   </soapenv:Body>

</soapenv:Envelope>

jroorda
User
Posts: 28
Joined: Wed Dec 31, 1969 8:00 pm

Re: getEntityMetadata causes java.lang.NullPointerException

Post by jroorda » Thu Sep 20, 2012 2:07 pm

Hello matthewv.vtq ,
This is Justin from Support.
Unfortunately this is a bug in the 2.5 SOAP API.
The operation is in the WSDL and all the parameters matched with a request requiring session, entity, and PL ID however with all the correct information the operation was never actually built for the 2.5 API.
If you use the 2.0 WSDL and API for this operation instead everything will work.

I apologize for the inconvenience.

Post Reply