Troubleshooting
Problem
A Web service is exposed with a Service Component Architecture (SCA) export component using Remote Procedure Call (RPC)-encoded-style Web Services Description Language (WSDL) that includes SOAP-encoded array input parameters. Invoking the Web service with an SCA import component results in a "failed to resolve element" error.
Symptom
An error similar to the following occurs during the invocation of the RPC-encoded SCA Web service with a SOAP-encoded array:
[5/22/08 9:44:18:312 PDT] 0000005f ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "invoke" on bean "BeanId(RiskFactorAssignApp#RiskFactorAssignEJB.jar#export.assignRiskfactorExport1, null)". Exception data: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at com.ibm.ws.webservices.engine.dispatchers.java.JavaDispatcher.invokeMethod(JavaDispatcher.java:178)
...
Caused by: com.ibm.websphere.sca.ServiceRuntimeException: javax.xml.soap.SOAPException: Failed to resolve element Item in data type commonj.sdo.DataObject <http://HealthInsuranceLib2#ArrayOfMedHistory>: caused by: javax.xml.soap.SOAPException: Failed to resolve element Item in data type commonj.sdo.DataObject <http://HealthInsuranceLib2#ArrayOfMedHistory>
at com.ibm.wsspi.sca.webservice.bean.impl.WebServiceBeanImpl.processInvoke(WebServiceBeanImpl.java:281)
at com.ibm.wsspi.sca.webservice.ejb.impl.WebServiceSessionBean.invokeWS(WebServiceSessionBean.java:147)
at com.ibm.wsspi.sca.webservice.ejb.impl.WebServiceSessionBean.invoke(WebServiceSessionBean.java:135)
...
Cause
The error is due to unexpected processing of the SOAP-encoded array by the system service. For example, the following SOAP-encoded array is created by an SCA import component for the RPC-encoded Web service invocation. It contains two element items, each of which is referenced as a multi-ref element outside of the array.
<soapenc:Array id="id1" soapenc:arrayType="m302:MedicalHistory[2]"
soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:m302="http://HealthInsuranceLib" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<Item href="#id2" />
<Item href="#id3" />
</soapenc:Array>
<multiRef id="id3" xsi:type="m302:MedicalHistory"
soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:m302="http://HealthInsuranceLib" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<yearOccurred xsi:type="xsd:int">0</yearOccurred>
<onMedication xsi:type="xsd:boolean">false</onMedication>
</multiRef>
<multiRef id="id2" xsi:type="m302:MedicalHistory"
soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:m302="http://HealthInsuranceLib" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<yearOccurred xsi:type="xsd:int">0</yearOccurred>
<onMedication xsi:type="xsd:boolean">false</onMedication>
</multiRef>
After the SOAP message reaches the server side, it is optimized before it is processed by the SCA Web service engine. However, the array information necessary for deserializing the SOAP array is no longer present, and the array items cannot be successfully resolved by the SCA.
<medHistory href="#id1">
<Item href="#id2">
<yearOccurred xsi:type="xsd:int">0</yearOccurred>
<onMedication xsi:type="xsd:boolean">false</onMedication>
</Item>
<Item href="#id3">
<yearOccurred xsi:type="xsd:int">0</yearOccurred>
<onMedication xsi:type="xsd:boolean">false</onMedication>
</Item>
</medHistory>
Resolving The Problem
The underlying Web service engine is not designed to support SOAP-encoded arrays in RPC-encoded WSDL. Therefore, this feature not available for SCA import or exports. Expose the Web Service again using an alternate WSDL style, for example, document-literal.
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21307533