imposter icon indicating copy to clipboard operation
imposter copied to clipboard

SOAP, WSDL: NullPointerException in getPorts

Open reinsch82 opened this issue 2 years ago • 0 comments

I get an NPE with this stack trace:

Daemon Thread [DefaultDispatcher-worker-2 @coroutine#2] (Suspended (exception NullPointerException))	
	Intrinsics.throwJavaNpe() line: 45	
	Intrinsics.checkNotNull(Object) line: 25	
	Wsdl1Parser.kt line: 131	
	Wsdl1Parser.kt line: 79	
	VersionAwareWsdlParser.kt line: 88	
	SoapPluginImpl.kt line: 119	
	SoapPluginImpl.kt line: 106	
	Imposter.kt line: 205	
	Imposter.kt line: 85	
	Imposter.kt line: 128	
	Imposter$start$1(BaseContinuationImpl).resumeWith(Object) line: 33	
	DispatchedTask.kt line: 106	
	CoroutineScheduler.kt line: 570	
	CoroutineScheduler.kt line: 750	
	CoroutineScheduler.kt line: 677	
	CoroutineScheduler.kt line: 664	

These are the variables at Wsdl1Parser.kt line: 131:

variable value
this Wsdl1Parser (id=102)
$i$a$-map-Wsdl1Parser$getPorts$1 0
node Element (id=105)
item$iv$iv Element (id=105)
$i$f$mapTo 0
$this$mapTo$iv$iv Collections$UnmodifiableRandomAccessList<E> (id=113)
destination$iv$iv ArrayList<E> (id=121)
$i$f$map 0
$this$map$iv Collections$UnmodifiableRandomAccessList<E> (id=113)
serviceNode Element (id=125)

the WSDL file:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:fsc-svc="http://schemas.fabasoft.com/websvc/FSCCI_1_1001_CIWebService/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:stk="http://schemas.microsoft.com/soap-toolkit/wsdl-extension" targetNamespace="http://schemas.fabasoft.com/websvc/FSCCI_1_1001_CIWebService/">
  <wsdl:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.fabasoft.com/websvc/FSCCI_1_1001_CIWebService/" xmlns:tns="http://schemas.fabasoft.com/websvc/FSCCI_1_1001_CIWebService/" elementFormDefault="qualified">
      <xs:complexType name="FSCCI_1_1001_JobProperty">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="1" name="FSCCI_1_1001_jtptype" type="xs:string"/>
          <xs:element minOccurs="0" maxOccurs="1" name="FSCCI_1_1001_jtpname" type="xs:string"/>
          <xs:element minOccurs="0" maxOccurs="1" name="FSCCI_1_1001_jtpvalue" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
      <xs:complexType name="ArrayOfFSCCI_1_1001_JobProperty">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="unbounded" name="FSCCI_1_1001_JobProperty" type="tns:FSCCI_1_1001_JobProperty"/>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="CreateNewJob">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="jobtemplateid" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="jobproperties" type="tns:ArrayOfFSCCI_1_1001_JobProperty"/>
            <xs:element minOccurs="0" maxOccurs="1" name="context" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="owner" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="cisystemid" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="priority" type="xs:int"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="CreateNewJobResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="jobid" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="GetNextJob">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="cisystemid" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="GetNextJobResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="jobid" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="jobtemplateid" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="jobproperties" type="tns:ArrayOfFSCCI_1_1001_JobProperty"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="COOSYSTEM_1_1_Content">
        <xs:sequence>
          <xs:element minOccurs="0" maxOccurs="1" name="COOSYSTEM_1_1_contcontent" type="xs:base64Binary"/>
          <xs:element minOccurs="0" maxOccurs="1" name="COOSYSTEM_1_1_contsize" type="xs:int"/>
          <xs:element minOccurs="0" maxOccurs="1" name="COOSYSTEM_1_1_contextension" type="xs:string"/>
          <xs:element minOccurs="0" maxOccurs="1" name="COOSYSTEM_1_1_contchanged" type="xs:dateTime"/>
          <xs:element minOccurs="0" maxOccurs="1" name="COOSYSTEM_1_1_contoleclassid" type="xs:string"/>
          <xs:element minOccurs="0" maxOccurs="1" name="COOSYSTEM_1_1_contencoding" type="xs:string"/>
          <xs:element minOccurs="0" maxOccurs="1" name="COOSYSTEM_1_1_contencryption" type="xs:int"/>
        </xs:sequence>
      </xs:complexType>
      <xs:element name="CompleteJob">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="jobid" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="state" type="xs:int"/>
            <xs:element minOccurs="0" maxOccurs="1" name="starttime" type="xs:dateTime"/>
            <xs:element minOccurs="0" maxOccurs="1" name="endtime" type="xs:dateTime"/>
            <xs:element minOccurs="0" maxOccurs="1" name="overview" type="tns:COOSYSTEM_1_1_Content"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="CompleteJobResponse">
        <xs:complexType/>
      </xs:element>
      <xs:element name="AppendArtifact">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="1" name="jobid" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="name" type="xs:string"/>
            <xs:element minOccurs="0" maxOccurs="1" name="artifact" type="tns:COOSYSTEM_1_1_Content"/>
            <xs:element minOccurs="0" maxOccurs="1" name="artifacttype" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="AppendArtifactResponse">
        <xs:complexType/>
      </xs:element>
    </xs:schema>
  </wsdl:types>
  <wsdl:message name="CreateNewJobSoapIn">
    <wsdl:part name="parameters" element="fsc-svc:CreateNewJob"/>
  </wsdl:message>
  <wsdl:message name="CreateNewJobSoapOut">
    <wsdl:part name="parameters" element="fsc-svc:CreateNewJobResponse"/>
  </wsdl:message>
  <wsdl:message name="GetNextJobSoapIn">
    <wsdl:part name="parameters" element="fsc-svc:GetNextJob"/>
  </wsdl:message>
  <wsdl:message name="GetNextJobSoapOut">
    <wsdl:part name="parameters" element="fsc-svc:GetNextJobResponse"/>
  </wsdl:message>
  <wsdl:message name="CompleteJobSoapIn">
    <wsdl:part name="parameters" element="fsc-svc:CompleteJob"/>
  </wsdl:message>
  <wsdl:message name="CompleteJobSoapOut">
    <wsdl:part name="parameters" element="fsc-svc:CompleteJobResponse"/>
  </wsdl:message>
  <wsdl:message name="AppendArtifactSoapIn">
    <wsdl:part name="parameters" element="fsc-svc:AppendArtifact"/>
  </wsdl:message>
  <wsdl:message name="AppendArtifactSoapOut">
    <wsdl:part name="parameters" element="fsc-svc:AppendArtifactResponse"/>
  </wsdl:message>
  <wsdl:portType name="FSCCI_1_1001_CIWebServiceSoap">
    <wsdl:operation name="CreateNewJob">
      <wsdl:input message="fsc-svc:CreateNewJobSoapIn"/>
      <wsdl:output message="fsc-svc:CreateNewJobSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="GetNextJob">
      <wsdl:input message="fsc-svc:GetNextJobSoapIn"/>
      <wsdl:output message="fsc-svc:GetNextJobSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="CompleteJob">
      <wsdl:input message="fsc-svc:CompleteJobSoapIn"/>
      <wsdl:output message="fsc-svc:CompleteJobSoapOut"/>
    </wsdl:operation>
    <wsdl:operation name="AppendArtifact">
      <wsdl:input message="fsc-svc:AppendArtifactSoapIn"/>
      <wsdl:output message="fsc-svc:AppendArtifactSoapOut"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="FSCCI_1_1001_CIWebServiceSoap" type="fsc-svc:FSCCI_1_1001_CIWebServiceSoap">
    <stk:binding xmlns:stk="http://schemas.microsoft.com/soap-toolkit/wsdl-extension" preferredEncoding="UTF-8"/>
    <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <wsdl:operation name="CreateNewJob">
      <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_CreateNewJob" style="document"/>
      <wsdl:input>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetNextJob">
      <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_GetNextJob" style="document"/>
      <wsdl:input>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CompleteJob">
      <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_CompleteJob" style="document"/>
      <wsdl:input>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="AppendArtifact">
      <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_AppendArtifact" style="document"/>
      <wsdl:input>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="FSCCI_1_1001_CIWebServiceSoap12" type="fsc-svc:FSCCI_1_1001_CIWebServiceSoap">
    <stk:binding xmlns:stk="http://schemas.microsoft.com/soap-toolkit/wsdl-extension" preferredEncoding="UTF-8"/>
    <soap12:binding xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <wsdl:operation name="CreateNewJob">
      <soap12:operation xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_CreateNewJob" style="document"/>
      <wsdl:input>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="GetNextJob">
      <soap12:operation xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_GetNextJob" style="document"/>
      <wsdl:input>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="CompleteJob">
      <soap12:operation xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_CompleteJob" style="document"/>
      <wsdl:input>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="AppendArtifact">
      <soap12:operation xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" soapAction="http://schemas.fabasoft.com/object/FSCCI_1_1001_AppendArtifact" style="document"/>
      <wsdl:input>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="FSCCI_1_1001_CIWebService">
    <wsdl:port name="FSCCI_1_1001_CIWebServiceSoap" binding="fsc-svc:FSCCI_1_1001_CIWebServiceSoap">
      <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="https://somemachine/folio/fscdav/wsdl?WEBSVC=FSCCI_1_1001_CIWebService"/>
    </wsdl:port>
    <wsdl:port name="FSCCI_1_1001_CIWebServiceSoap12" binding="fsc-svc:FSCCI_1_1001_CIWebServiceSoap12">
      <soap12:address xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" location="https://somemachine/folio/fscdav/wsdl?WEBSVC=FSCCI_1_1001_CIWebService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

used version: 3.0.4 dependencies in pom.xml

		<dependency>
			<groupId>io.gatehill.imposter</groupId>
			<artifactId>distro-embedded</artifactId>
			<version>${imposter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.gatehill.imposter</groupId>
			<artifactId>imposter-server</artifactId>
			<version>${imposter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.gatehill.imposter</groupId>
			<artifactId>mock-soap</artifactId>
			<version>${imposter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.gatehill.imposter</groupId>
			<artifactId>config-dynamic</artifactId>
			<version>${imposter.version}</version>
			<scope>test</scope>
		</dependency>

junit setup code:


  @Before
  public void setUp() throws URISyntaxException
  {
    Path specFile = Paths.get(FscciTest.class.getResource("/imposter-config.yaml").toURI());
    assertThat(Files.exists(specFile)).isTrue();

      MockEngine imposter = new ImposterBuilder<>()
      .withConfigurationDir(specFile.getParent())
      .withPluginClass(SoapPluginImpl.class)
      .startBlocking();

      ...
  }

I don't understand why this would throw?!

reinsch82 avatar Aug 10 '22 08:08 reinsch82