NullPointerException using httpapi

Discussions related to HTTPAPI (An HTTP Client Package for RPG programming.) http://www.scottklement.com/httpapi/
Post Reply
Bernd S
Posts: 3
Joined: Thu Jan 26, 2023 10:18 am

NullPointerException using httpapi

Post by Bernd S »

Hi,

i am trying to get Information from a SOAP-Service to our System I.
HTTPAPI Ver 1.45 released 2021-09-20
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R4M0

If i use SOAPUI the Request will work fine and i'll get the expected Result.

My Sample-Programm:

Code: Select all

        ctl-opt option(*srcstmt:*nounref) dftactgrp(*no);
        ctl-opt bnddir('HTTPAPI');

        /copy httpapi_h

        dcl-s UrlHost       varchar(200);
        dcl-s UrlEndPoint   varchar(200);
        dcl-s PostUrl       varchar(254);
        dcl-s PostData      varchar(32000) ;
        dcl-s PostResult    varchar(32000) ;
        dcl-s string char(30);
        dcl-s errorMsg char(256);

        dcl-ds xmlout qualified;
          EmplStat char(5);
        end-ds;

        dcl-pi main extpgm('TEST');
        end-pi;

        http_debug(*ON:'/tmp/soapdebug.txt');
        UrlHost = 'http://segatos01.seg.de:8080';
        UrlEndPoint = '/SES/services/transactionaldata/'+
          'employeeInformation-1.0.wsdl';
        PostUrl = %trim(UrlHost) + %trim(UrlEndPoint);
        PostData = set_GetEmplInformation('070711');
        http_setOption('SoapAction': '"http://atoss.com/'+
         'ses/services/transactionaldata/IsPresent"');

        clear errorMsg;
        clear xmlout;

        MONITOR;
         PostResult = http_string('POST': PostUrl: PostData: 'text/xml');
        ON-ERROR;
            // Insert conditionally executed block here
        // Optionally insert more ON-ERROR statements here
         errorMsg = http_error();
         PostResult = '<Result>Error</Result>';
        ENDMON;

         //Parse Output
        MONITOR;
         xml-into xmlout %xml(PostResult: 'case=any ns=remove ' +
           'path=Envelope/Body/isPresentResponse/isPresentReturn');

        ON-ERROR;
            // Insert conditionally executed block here
        // Optionally insert more ON-ERROR statements here
        ENDMON;

        string =  'Anwesenheitsstatus: ->' + xmlout.EmplStat + '<-';
        dsply string;

        *inlr = *on;

        dcl-proc set_GetEmplInformation;
          dcl-pi set_GetEmplInformation varchar(32000);
            EmplNo char(6) const;
          end-pi;
        dcl-s PostData varchar(32000);
        PostData=''
        +'<soapenv:Envelope +
            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" +
            xmlns:emp="http://atoss.com/ses/services/transactionaldata/+
              employeeInformation-1.0"> +
            <soapenv:Header/>+
             <soapenv:Body>+
               <emp:IsPresentRequest>+
                 <emp:Emplno>$$EMPLNO</emp:Emplno>+
               </emp:IsPresentRequest>+
             </soapenv:Body>+
          </soapenv:Envelope>';

        PostData=%scanrpl('$$EMPLNO':EmplNo:PostData);

        return PostData;

        end-proc; 

I'll get the following Log-File:

Code: Select all

HTTPAPI Ver 1.45 released 2021-09-20
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R4M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry  : 2
DNS resolver options: x'00000136'
DNS default domain: SEG.DE
DNS server found: 10.1.8.35
DNS server found: 10.1.8.27
Nagle's algorithm (TCP_NODELAY) disabled.
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /SES/services/transactionaldata/employeeInformation-1.0.wsdl HTTP/1.1
Host: segatos01.seg.de:8080
User-Agent: http-api/1.45
Content-Type: text/xml
Content-Length: 302


senddoc(): entered
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:emp="http://atoss.com/ses/services/transactionaldata/employeeInformation-1.0"> <soapenv:Header/><soapenv:Body><emp:IsPresentRequest><emp:Emplno>070711</emp:Emplno></emp:IsPresentRequest></soapenv:Body></soapenv:Envelope>
recvresp(): entered
HTTP/1.1 500 
ASESCompressRequests: true
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
referrer-policy: strict-origin-when-cross-origin
Content-Security-Policy: default-src 'self' *.fpm.atoss.com:* 'unsafe-inline' 'unsafe-eval' data: mailto:
X-Robots-Tag: none
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
SOAPAction: ""
Content-Type: text/xml;charset=utf-8
Content-Length: 289
Date: Thu, 26 Jan 2023 06:07:13 GMT
Connection: close


SetError() #13: HTTP/1.1 500
recvresp(): end with 500
recvdoc parms: identity 289
header_load_cookies() entered
recvdoc(): entered
SetError() #0:
recvdoc(): Receiving 289 bytes.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring xml:lang="en">java.lang.NullPointerException</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
SetError() #13: HTTP/1.1 500
http_close(): entered
Here ist the called .wsdl:

Code: Select all

<wsdl:definitions targetNamespace="http://atoss.com/ses/services/transactionaldata/employeeInformation-1.0">
<wsdl:types>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://atoss.com/ses/services/transactionaldata/employeeInformation-1.0">
<xs:import namespace="http://atoss.com/ses/services/masterdata/types-1.0"/>
<xs:element name="IsPresentRequest">
</xs:element>
<xs:element name="IsPresentResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="isPresentReturn" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetEmployeesWarningRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Credentials" type="wstypes:CredentialsType"/>
<xs:element name="From" type="xs:date"/>
<xs:element name="To" type="xs:date"/>
<xs:sequence maxOccurs="unbounded">
<xs:element minOccurs="0" name="WarningTypes" type="xs:short"/>
</xs:sequence>
<xs:sequence maxOccurs="unbounded">
<xs:element minOccurs="0" name="WarningStates" type="xs:string"/>
</xs:sequence>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Emplnos" type="xs:string"/>
</xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="WarningResponseType">
<xs:sequence>
<xs:element name="Emplno" type="xs:string"/>
<xs:element name="Badgeno" type="xs:string"/>
<xs:element name="WarningState" type="xs:string"/>
<xs:element name="WarningType" type="xs:short"/>
<xs:element name="Date" type="xs:date"/>
<xs:element name="Time" type="xs:int"/>
<xs:element name="BookingRequestCode" type="xs:string"/>
<xs:element name="TerminalId" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="GetEmployeesWarningResponse">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="EmployeesWarnings" type="ws:WarningResponseType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetEmployeeSchedsPlanningPhaseRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Credentials" type="wstypes:CredentialsType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetEmployeeSchedsPlanningPhaseResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="scheds_published" type="xs:date"/>
<xs:element name="scheds_locked" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" jaxb:version="2.0" targetNamespace="http://atoss.com/ses/services/masterdata/types-1.0">
<xs:complexType name="ListServiceRequest">
<xs:sequence>
<xs:element minOccurs="0" name="Credentials" type="ws:CredentialsType"/>
<xs:element minOccurs="0" name="Filter">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="FilterCriteria">
<xs:complexType>
<xs:sequence>
<xs:element name="FieldName" type="xs:string"/>
<xs:element name="FieldValue" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="SelectedFields">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="FieldName" type="xs:string"/>
</xs:sequence>
<xs:attribute default="exclude" name="selectionType" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="include"/>
<xs:enumeration value="exclude"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ListServiceResponse"/>
<xs:complexType name="CredentialsType">
<xs:sequence>
<xs:element name="Logonid" type="xs:string"/>
<xs:element minOccurs="0" name="AbsentEmplno" type="xs:string"/>
<xs:element name="Clientno" type="xs:string"/>
<xs:element minOccurs="0" name="Password" type="xs:string"/>
<xs:element minOccurs="0" name="uuid" type="xs:string"/>
<xs:element minOccurs="0" name="pin" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="UserType">
<xs:sequence>
<xs:element minOccurs="0" name="Logonid" type="xs:string"/>
<xs:element minOccurs="0" name="AcdeptCat" type="xs:string"/>
<xs:element minOccurs="0" name="AcselCat" type="xs:string"/>
<xs:element minOccurs="0" name="AccostCat" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="AcdeptType">
<xs:sequence>
<xs:element minOccurs="0" name="Catid" type="xs:string"/>
<xs:element minOccurs="0" name="DefaultPerm" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
<xs:element minOccurs="0" name="DeptPermList">
<xs:complexType>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element name="DeptPerm">
<xs:complexType>
<xs:sequence>
<xs:element name="Deptno" type="xs:string"/>
<xs:element name="Perm" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="DeptType">
<xs:sequence>
<xs:element minOccurs="0" name="Deptno" type="xs:string"/>
<xs:element minOccurs="0" name="DeptText" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="WorkingPatternType">
<xs:sequence>
<xs:element name="Abbreviation" type="xs:string"/>
<xs:element name="Id" type="xs:string"/>
<xs:element name="TimeFrom" type="xs:int"/>
<xs:element name="TimeTo" type="xs:int"/>
<xs:element name="OnDutyLen" type="xs:int"/>
<xs:element name="Break">
<xs:complexType>
<xs:sequence>
<xs:element name="Prefix" type="xs:string"/>
<xs:element name="Length" type="xs:int"/>
<xs:element name="TimeFrom" type="xs:int"/>
<xs:element name="TimeTo" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EmployType">
<xs:sequence>
<xs:element name="Emplno" type="xs:string"/>
<xs:element minOccurs="0" name="FirstName" type="xs:string"/>
<xs:element minOccurs="0" name="Surname" type="xs:string"/>
<xs:element minOccurs="0" name="Badgeno" type="xs:string"/>
<xs:element minOccurs="0" name="EmployeeCategory" type="xs:string"/>
<xs:element minOccurs="0" name="Factory" type="xs:string"/>
<xs:element minOccurs="0" name="TariffArea" type="xs:string"/>
<xs:element minOccurs="0" name="ManagerEmplno" type="xs:string"/>
<xs:element minOccurs="0" name="Phone" type="xs:string"/>
<xs:element minOccurs="0" name="Handy" type="xs:string"/>
<xs:element minOccurs="0" name="CycleId" type="xs:string"/>
<xs:element minOccurs="0" name="CycleIdStart" type="xs:int"/>
<xs:element minOccurs="0" name="MeanStdWorkTime" type="xs:int"/>
<xs:element minOccurs="0" name="MeanStdWorkTimeWeek" type="xs:int"/>
<xs:element minOccurs="0" name="Deptno" type="xs:string"/>
<xs:element minOccurs="0" name="CostId" type="xs:string"/>
<xs:element minOccurs="0" name="Birthdate" type="xs:string"/>
<xs:element minOccurs="0" name="MachineId" type="xs:string"/>
<xs:element minOccurs="0" name="JobId" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
<xs:element minOccurs="0" name="VariantInvalidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="VariantValidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="StartDate" type="xs:date"/>
<xs:element minOccurs="0" name="ValidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="ValidTo" type="xs:date"/>
<xs:element minOccurs="0" name="SelectOption1" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption2" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption3" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption4" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption5" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption6" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption7" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption8" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption9" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption10" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption11" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption12" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption13" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption14" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption15" type="xs:string"/>
<xs:element minOccurs="0" name="SelectOption16" type="xs:string"/>
<xs:element minOccurs="0" name="attributes" type="ws:FreeAttributesType">
<xs:annotation>
<xs:documentation>The list of attributes of the employee</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ProjnoType">
<xs:sequence>
<xs:element minOccurs="0" name="Projno" type="xs:string"/>
<xs:element minOccurs="0" name="ProjnoText" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
<xs:element minOccurs="0" name="ValidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="ValidTo" type="xs:date"/>
<xs:element minOccurs="0" name="ProjnoLongText" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CttypeType">
<xs:sequence>
<xs:element minOccurs="0" name="Costtype" type="xs:string"/>
<xs:element minOccurs="0" name="CosttypeText" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
<xs:element minOccurs="0" name="ValidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="ValidTo" type="xs:date"/>
<xs:element minOccurs="0" name="CosttypeLongText" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CostnoType">
<xs:sequence>
<xs:element minOccurs="0" name="Costno" type="xs:string"/>
<xs:element minOccurs="0" name="CostnoText" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
<xs:element minOccurs="0" name="ValidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="ValidTo" type="xs:date"/>
<xs:element minOccurs="0" name="CostnoLongText" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="JobType">
<xs:sequence>
<xs:element minOccurs="0" name="MachineId" type="xs:string"/>
<xs:element minOccurs="0" name="JobId" type="xs:string"/>
<xs:element minOccurs="0" name="JobText" type="xs:string"/>
<xs:element minOccurs="0" name="JobAbbrev" type="xs:string"/>
<xs:element minOccurs="0" name="HourlyWages1" type="xs:int"/>
<xs:element minOccurs="0" name="HourlyWages2" type="xs:int"/>
<xs:element minOccurs="0" name="HourlyWages3" type="xs:int"/>
<xs:element minOccurs="0" name="Floater" type="xs:string"/>
<xs:element minOccurs="0" name="CostId" type="xs:string"/>
<xs:element minOccurs="0" name="Deptno" type="xs:string"/>
<xs:element minOccurs="0" name="VariantInvalidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="VariantValidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="MachType">
<xs:sequence>
<xs:element minOccurs="0" name="MachineId" type="xs:string"/>
<xs:element minOccurs="0" name="MachineText" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PmstatType">
<xs:sequence>
<xs:element name="StatusId" type="xs:string"/>
<xs:element name="StatusType" type="xs:string"/>
<xs:element minOccurs="0" name="StatusText" type="xs:string"/>
<xs:element name="State" type="xs:int"/>
<xs:element minOccurs="0" name="Code" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CodeType">
<xs:sequence>
<xs:element minOccurs="0" name="Code" type="xs:string"/>
<xs:element minOccurs="0" name="CodeType" type="xs:string"/>
<xs:element minOccurs="0" name="CodeText" type="xs:string"/>
<xs:element minOccurs="0" name="VariantValidFrom" type="xs:date"/>
<xs:element minOccurs="0" name="VariantInvalidFrom" type="xs:date"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SchedsType">
<xs:sequence>
<xs:element name="SchedsId" type="xs:string"/>
<xs:element minOccurs="0" name="SchedsText" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SeloptType">
<xs:sequence>
<xs:element name="Seloptno" type="xs:string"/>
<xs:element name="Selopt" type="xs:string"/>
<xs:element minOccurs="0" name="SeloptText" type="xs:string"/>
<xs:element minOccurs="0" name="LastModified" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FreeAttributesType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="attribute" type="ws:FreeAttributeType">
<xs:annotation>
<xs:documentation>the attribute</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="FreeAttributeType">
<xs:sequence>
<xs:element name="name" type="ws:AttIdType">
<xs:annotation>
<xs:documentation>the name of the attribute</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="value" type="ws:AttValueType">
<xs:annotation>
<xs:documentation>the value of the attribute</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="AttIdType">
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="20"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="AttValueType">
<xs:restriction base="xs:string">
<xs:minLength value="0"/>
<xs:maxLength value="250"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
</wsdl:types>
<wsdl:message name="IsPresentResponse">
<wsdl:part element="tns:IsPresentResponse" name="IsPresentResponse"/>
</wsdl:message>
<wsdl:message name="GetEmployeesWarningResponse">
<wsdl:part element="tns:GetEmployeesWarningResponse" name="GetEmployeesWarningResponse"/>
</wsdl:message>
<wsdl:message name="GetEmployeeSchedsPlanningPhaseResponse">
<wsdl:part element="tns:GetEmployeeSchedsPlanningPhaseResponse" name="GetEmployeeSchedsPlanningPhaseResponse"/>
</wsdl:message>
<wsdl:message name="GetEmployeeSchedsPlanningPhaseRequest">
<wsdl:part element="tns:GetEmployeeSchedsPlanningPhaseRequest" name="GetEmployeeSchedsPlanningPhaseRequest"/>
</wsdl:message>
<wsdl:message name="GetEmployeesWarningRequest">
<wsdl:part element="tns:GetEmployeesWarningRequest" name="GetEmployeesWarningRequest"/>
</wsdl:message>
<wsdl:message name="IsPresentRequest">
<wsdl:part element="tns:IsPresentRequest" name="IsPresentRequest"/>
</wsdl:message>
<wsdl:portType name="TransactionalDataEmployeeInformation">
<wsdl:operation name="IsPresent">
<wsdl:input message="tns:IsPresentRequest" name="IsPresentRequest"/>
<wsdl:output message="tns:IsPresentResponse" name="IsPresentResponse"/>
</wsdl:operation>
<wsdl:operation name="GetEmployeesWarning">
<wsdl:input message="tns:GetEmployeesWarningRequest" name="GetEmployeesWarningRequest"/>
<wsdl:output message="tns:GetEmployeesWarningResponse" name="GetEmployeesWarningResponse"/>
</wsdl:operation>
<wsdl:operation name="GetEmployeeSchedsPlanningPhase">
<wsdl:input message="tns:GetEmployeeSchedsPlanningPhaseRequest" name="GetEmployeeSchedsPlanningPhaseRequest"/>
<wsdl:output message="tns:GetEmployeeSchedsPlanningPhaseResponse" name="GetEmployeeSchedsPlanningPhaseResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TransactionalDataEmployeeInformationSoap11" type="tns:TransactionalDataEmployeeInformation">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="IsPresent">
<soap:operation soapAction="http://atoss.com/ses/services/transactionaldata/IsPresent"/>
<wsdl:input name="IsPresentRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="IsPresentResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetEmployeesWarning">
<soap:operation soapAction="http://atoss.com/ses/services/transactionaldata/GetEmployeesWarning"/>
<wsdl:input name="GetEmployeesWarningRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="GetEmployeesWarningResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetEmployeeSchedsPlanningPhase">
<soap:operation soapAction="http://atoss.com/ses/services/transactionaldata/GetEmployeeSchedsPlanningPhase"/>
<wsdl:input name="GetEmployeeSchedsPlanningPhaseRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="GetEmployeeSchedsPlanningPhaseResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EmployeeInformation">
<wsdl:port binding="tns:TransactionalDataEmployeeInformationSoap11" name="TransactionalDataEmployeeInformationSoap11">
<soap:address location="http://segatos01.seg.de:8080/SES/services/transactionaldata"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

RAW-Request from SOAPUI:

Code: Select all

POST http://segatos01.seg.de:8080/SES/services/transactionaldata HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://atoss.com/ses/services/transactionaldata/IsPresent"
Content-Length: 347
Host: segatos01.seg.de:8080
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.5 (Java/16.0.1)

<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:emp="http://atoss.com/ses/services/transactionaldata/employeeInformation-1.0">
   <soapenv:Header/>
   <soapenv:Body>
      <emp:IsPresentRequest>
         <emp:Emplno>070711</emp:Emplno>
      </emp:IsPresentRequest>
   </soapenv:Body>
</soapenv:Envelope>
RAW-Response from SOAPUI:

Code: Select all

HTTP/1.1 200 
ASESCompressRequests: true
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
referrer-policy: strict-origin-when-cross-origin
Content-Security-Policy: default-src 'self' *.fpm.atoss.com:* 'unsafe-inline' 'unsafe-eval' data: mailto:
X-Robots-Tag: none
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
SOAPAction: ""
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 26 Jan 2023 09:38:10 GMT
Keep-Alive: timeout=60
Connection: keep-alive

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns11:IsPresentResponse xmlns:ns11="http://atoss.com/ses/services/transactionaldata/employeeInformation-1.0" xmlns:ns10="http://atoss.com/ses/services/transactionaldata/terminalServices-1.0" xmlns:ns12="http://atoss.com/ses/services/transactionaldata/wages-1.0" xmlns:ns2="http://atoss.com/ses/services/masterdata/types-1.0" xmlns:ns3="http://atoss.com/ses/services/transactionaldata/asesCommon-types-1.0" xmlns:ns4="http://atoss.com/ses/services/transactionaldata/workflowServices-1.0" xmlns:ns5="http://atoss.com/ses/services/transactionaldata/timeline-types-1.0" xmlns:ns6="http://atoss.com/ses/services/transactionaldata/timeline-1.0" xmlns:ns7="http://atoss.com/ses/services/transactionaldata/scheduleServices-1.0" xmlns:ns8="http://atoss.com/ses/services/transactionaldata/employeeVacationInformation-1.0" xmlns:ns9="http://atoss.com/ses/services/transactionaldata/zterm-1.0"><ns11:isPresentReturn>true</ns11:isPresentReturn></ns11:IsPresentResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Can anyone please help me?
User avatar
tools400
Posts: 5
Joined: Thu Jul 29, 2021 4:56 am

Re: NullPointerException using httpapi

Post by tools400 »

Looks like you sent an empty SOAP action to the server:

SOAPAction: ""

Sending the following SOAP action header should work:

SOAPAction: "http://atoss.com/ses/services/transacti ... /IsPresent"

Thomas.
Bernd S
Posts: 3
Joined: Thu Jan 26, 2023 10:18 am

Re: NullPointerException using httpapi

Post by Bernd S »

Hi Thomas,

i send the SOAPACtion with the following Command:

http_setOption('SOAPAction': '"http://atoss.com/ses/services/transacti ... /IsPresent"');

I'll get the following Debug-File:

Code: Select all

HTTPAPI Ver 1.45 released 2021-09-20
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R4M0

http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry  : 2
DNS resolver options: x'00000136'
DNS default domain: SEG.DE
DNS server found: 10.1.8.35
DNS server found: 10.1.8.27
Nagle's algorithm (TCP_NODELAY) disabled.
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /SES/services/transactionaldata/employeeInformation-1.0.wsdl HTTP/1.1
Host: segatos01.seg.de:8080
User-Agent: http-api/1.45
Content-Type: text/xml
SOAPAction: "http://atoss.com/ses/services/transactionaldata/IsPresent"
Content-Length: 302


senddoc(): entered
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:emp="http://atoss.com/ses/services/transactionaldata/employeeInformation-1.0"> <soapenv:Header/><soapenv:Body><emp:IsPresentRequest><emp:Emplno>070711</emp:Emplno></emp:IsPresentRequest></soapenv:Body></soapenv:Envelope>
recvresp(): entered
HTTP/1.1 500 
ASESCompressRequests: true
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
referrer-policy: strict-origin-when-cross-origin
Content-Security-Policy: default-src 'self' *.fpm.atoss.com:* 'unsafe-inline' 'unsafe-eval' data: mailto:
X-Robots-Tag: none
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
SOAPAction: ""
Content-Type: text/xml;charset=utf-8
Content-Length: 289
Date: Mon, 30 Jan 2023 06:58:06 GMT
Connection: close


SetError() #13: HTTP/1.1 500
recvresp(): end with 500
recvdoc parms: identity 289
header_load_cookies() entered
recvdoc(): entered
SetError() #0:
recvdoc(): Receiving 289 bytes.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring xml:lang="en">java.lang.NullPointerException</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
SetError() #13: HTTP/1.1 500
http_close(): entered
Bernd
Scott Klement
Site Admin
Posts: 796
Joined: Sun Jul 04, 2021 5:12 am

Re: NullPointerException using httpapi

Post by Scott Klement »

You appear to be sending your request to the WSDL URL rather than the endpoint... put the proper URL into your program.
Bernd S
Posts: 3
Joined: Thu Jan 26, 2023 10:18 am

Re: NullPointerException using httpapi

Post by Bernd S »

Hi Scott,

thank you. That was the solution.

Bernd
Post Reply