Hi Everyone

I'm developing a webservice with apach cxf 3.0.1 (wsdl is attached, because
it's public) and generated a stub with wsdl2java.

wsdl2java -client  EdecService_Abnahme_v_3_1.wsdl

That works fine.


But when I call the this method from my Service I get a NullPointer
Exception from the MessageContentsList:

         Holder<GoodsDeclarationsResponse> _goodsDeclarations_parameters1 =
new Holder<GoodsDeclarationsResponse>();
        Holder <byte[]> _goodsDeclarations_eDecImportEL = new
Holder<byte[]>();
        Holder<byte[]> _goodsDeclarations_eDecImportBS = new
Holder<byte[]>();
        Holder<byte[]> _goodsDeclarations_eDecImportVVM = new
Holder<byte[]>();
        Holder<byte[]> _goodsDeclarations_eDecImportVVZ = new
Holder<byte[]>();
        Holder<byte[]> _goodsDeclarations_eDecImportRBM = new
Holder<byte[]>();
        Holder<byte[]> _goodsDeclarations_eDecImportRBZ = new
Holder<byte[]>();
        Holder<byte[]> _goodsDeclarations_eDecExportAL = new
Holder<byte[]>();


port.goodsDeclarations(goodsDeclarations, _goodsDeclarations_parameters1,
_goodsDeclarations_eDecImportEL, _goodsDeclarations_eDecImportBS,
_goodsDeclarations_eDecImportVVM, _goodsDeclarations_eDecImportVVZ,
_goodsDeclarations_eDecImportRBM, _goodsDeclarations_eDecImportRBZ,
_goodsDeclarations_eDecExportAL);

 java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
 at java.util.ArrayList.rangeCheck(Unknown Source)
 at java.util.ArrayList.get(Unknown Source)
 at
org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:80)
 at
org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:69)
 at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
 at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
 at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1636)
 at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525)
 at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330)
 at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
 at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638)
 at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
 at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
 at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
 at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)
 at com.sun.proxy.$Proxy58.goodsDeclarations(Unknown Source)
 at
ch.celements.anthe.controller.ThreadWebservice.runWebservice(ThreadWebservice.java:126)
 at
ch.celements.anthe.controller.ThreadWebservice.<init>(ThreadWebservice.java:43)
 at
ch.celements.anthe.controller.ThreadWebservice.main(ThreadWebservice.java:47)
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Index: 3,
Size: 3
 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159)
 at com.sun.proxy.$Proxy58.goodsDeclarations(Unknown Source)
 at
ch.celements.anthe.controller.ThreadWebservice.runWebservice(ThreadWebservice.java:126)
 at
ch.celements.anthe.controller.ThreadWebservice.<init>(ThreadWebservice.java:43)
 at
ch.celements.anthe.controller.ThreadWebservice.main(ThreadWebservice.java:47)
Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
 at java.util.ArrayList.rangeCheck(Unknown Source)
 at java.util.ArrayList.get(Unknown Source)
 at
org.apache.cxf.message.MessageContentsList.get(MessageContentsList.java:80)
 at
org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(HolderInInterceptor.java:69)
 at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
 at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
 at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1636)
 at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525)
 at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330)
 at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
 at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638)
 at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
 at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
 at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
 at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
 at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
 at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137)
 ... 4 more

By the way: This is a public WSDL Description.

Maybe someone could help me with that error. I went through the mailing
list allready and I saw some Mails related to that problem but they all
linked to the Apache CXF 2.X version. I also discovered an old bug but that
one was already fix in a 2.x version.

TIA.

Best regards
Matt
<?xml version="1.0"?>
<definitions name="EdecService" 
	targetNamespace="http://www.e-dec.ch/services/EdecService/v3/"; 
	xmlns:tns="http://www.e-dec.ch/services/EdecService/v3/"; 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; 
	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; 
	xmlns:edecRequest="http://www.e-dec.ch/xml/schema/edec/v3"; 
	xmlns:edecSATRequest="http://www.e-dec.ch/xml/schema/edecSelectionAndTransit/v3"; 
	xmlns:edecResponse="http://www.e-dec.ch/xml/schema/edecResponse/v3"; 
	xmlns="http://schemas.xmlsoap.org/wsdl/";>

	<documentation>
		Service for the SYNCHRONOUS submission of e-dec declarations (import, export)
		The first e-dec response is handed back; follow-up responses must be transferred by other means (eg email)
	</documentation>

	<types>
		<xsd:schema>
			<xsd:import namespace="http://www.e-dec.ch/xml/schema/edec/v3"; schemaLocation="http://www.ezv.admin.ch/pdf_linker.php?doc=edec_v_3_1"/>
		</xsd:schema>
		<xsd:schema>
			<xsd:import namespace="http://www.e-dec.ch/xml/schema/edecSelectionAndTransit/v3"; schemaLocation="http://www.ezv.admin.ch/pdf_linker.php?doc=edecSelectionAndTransit_v_3_1"/>
		</xsd:schema>
		<xsd:schema>
			<xsd:import namespace="http://www.e-dec.ch/xml/schema/edecResponse/v3"; schemaLocation="http://www.ezv.admin.ch/pdf_linker.php?doc=edecResponse_v_3_1"/>
		</xsd:schema>
	</types>

	<message name="goodsDeclarationsRequest">
    <documentation>
      Contains a single declaration for Import or Export. Sending 
      multiple declarations per request are only supported via E-Mail.
    </documentation>
		<part name="parameters" element="edecRequest:goodsDeclarations"/>
	</message>

	<message name="goodsDeclarationsResponse">
		<documentation>
			Contains a declaration acceptance response message. The other base64-encoded parts contain 
			PDF attachment and are all OPTIONAL. According to the business-level service 
			contracts, none, one or more of these PDF parts may be present in a response.
		</documentation>
		<part name="goodsDeclarationsResponseResults" element="edecResponse:goodsDeclarationsResponse"/>
		<!-- import-specific -->
		<part name="e-dec_Import_EL" type="xsd:base64Binary"/>
		<part name="e-dec_Import_BS" type="xsd:base64Binary"/>
		<part name="e-dec_Import_VVM" type="xsd:base64Binary"/>
		<part name="e-dec_Import_VVZ" type="xsd:base64Binary"/>
		<part name="e-dec_Import_RBM" type="xsd:base64Binary"/>
		<part name="e-dec_Import_RBZ" type="xsd:base64Binary"/>
		<!-- export-specific -->
		<part name="e-dec_Export_AL" type="xsd:base64Binary"/>		
	</message>

	<message name="goodsDeclarationsFault">
		<documentation>
		  Contains the reason for the rejection of the declaration.
		</documentation>
		<part name="parameters" element="edecResponse:goodsDeclarationsResponse"/>
	</message>

	<message name="selectionAndTransitRequest">
    <documentation>
      Contains the parameter for the Selection and Transit process.
    </documentation>
		<part name="parameters" element="edecSATRequest:selectionAndTransit"/>
	</message>

	<message name="selectionAndTransitResponse">
		<documentation>
			Contains a declaration acceptance response message. The other base64-encoded parts contain 
			PDF attachment and are all OPTIONAL. According to the business-level service 
			contracts, none, one or more of these PDF parts may be present in a response.
		</documentation>
		<part name="selectionAndTransitResponseResults" element="edecResponse:selectionAndTransitResponse"/>
		<!-- export-specific -->
		<part name="e-dec_Export_AL" type="xsd:base64Binary"/>		
	</message>

	<message name="selectionAndTransitFault">
		<documentation>
		  Contains the reason why the Selection and Transit process failed.
		</documentation>
		<part name="parameters" element="edecResponse:selectionAndTransitResponse"/>
	</message>

	<portType name="EdecPortType">
		<operation name="goodsDeclarations">
			<input message="tns:goodsDeclarationsRequest"/>
			<output message="tns:goodsDeclarationsResponse"/>
			<fault name="goodsDeclarationsFault" message="tns:goodsDeclarationsFault"/>
		</operation>
		<operation name="selectionAndTransit">
			<input message="tns:selectionAndTransitRequest"/>
			<output message="tns:selectionAndTransitResponse"/>
			<fault name="selectionAndTransitFault" message="tns:selectionAndTransitFault"/>
		</operation>
	</portType>

	<binding name="EdecBinding" type="tns:EdecPortType">
		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
		<operation name="goodsDeclarations">
			<soap:operation soapAction="goodsDeclarations" style="document"/>
			<input>
				<soap:body use="literal" parts="parameters"/>
			</input>
			<output>
				<mime:multipartRelated>
					<mime:part>
						<soap:body use="literal" parts="goodsDeclarationsResponseResults"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_EL" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_BS" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_VVM" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_VVZ" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_RBM" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Import_RBZ" type="application/pdf"/>
					</mime:part>
					<mime:part>
						<mime:content part="e-dec_Export_AL" type="application/pdf"/>
					</mime:part>
				</mime:multipartRelated>
			</output>
			<fault name="goodsDeclarationsFault">
				<soap:fault name="goodsDeclarationsFault" use="literal"/>
			</fault>
		</operation>
		<operation name="selectionAndTransit">
		  <soap:operation soapAction="selectionAndTransit" style="document"/>
		  <input>
		    <soap:body use="literal" parts="parameters"/>
		  </input>
		  <output>
		    <mime:multipartRelated>
		      <mime:part>
		        <soap:body use="literal" parts="selectionAndTransitResponseResults"/>
		      </mime:part>
			  <mime:part>
			    <mime:content part="e-dec_Export_AL" type="application/pdf"/>
			  </mime:part>
		  	</mime:multipartRelated>
		  </output>
		  <fault name="selectionAndTransitFault">
		    <soap:fault name="selectionAndTransitFault" use="literal"/>
		  </fault>
		</operation>
	</binding>

	<service name="EdecService">
		<documentation>
			Submit a customs declaration to e-dec or a selection and transit request 
			and receive a synchronous response. Note that a client certificate is 
			required for authentication.
		</documentation>
		<port name="EdecPort" binding="tns:EdecBinding">
			<soap:address location="https://e-dec-a.ssl.admin.ch/services/EdecService/v3"/>
		</port>
	</service>

</definitions>

Reply via email to