3 Mart 2011 Perşembe

javax.xml.ws.soap.SOAPFaultException: axis2ns2:selectionFailure

The error javax.xml.ws.soap.SOAPFaultException: axis2ns2:selectionFailure shows up, while the process is running in apache ode (tried with versions 1.3.4 and 1.3.5).

The following assignment is successful:

<copy>
<from>
<literal>
<ns2:operationResponse>
<ns2:return> </ns2:return>
</ns2:operationResponse>
</literal>
</from>
<to variable="OperationOut" part="parameters"/>
</copy>

the definition:

<xs:complexType name="operationResponse">
<xs:sequence>
<xs:element name="return" type="ns1:returnMessage" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>

.. however, this one results in axis2ns2:selectionFailure error

<assign name="InitOperation">
<copy>
<from>$OperationWsdlOperationIn.identity/username</from>
<to>$OperationIn.parameters/username</to>
</copy>
<copy>
<from variable="OperationWsdlOperationIn" part="password"/>
<to>$OperationIn.parameters/password</to>
</copy>
</assign>


despite this initialization:

<copy>
<from>
<literal>
<ns2:operation>

<username> </username>
<password> </password>

</ns2:operation>
</literal>
</from>
<to variable="OperationIn" part="parameters"/>
</copy>

<xs:complexType name="operation">
<xs:sequence>
<xs:element name="username" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="password" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>

There is an explanation for this situation in Apache ODE FAQ (http://ode.apache.org/faq.html), i copied here for convenience:

Q. My process fails with a selectionFailure; What can I do? A. BPEL expects a single element to be selected when evaluating and expressions, and a selectionFailure fault is thrown if zero or more than one element are selected.

If you get zero element, double-check your namespace prefix and bindings. Also, remember that you must initialize your variables (most often with 's) before assigning into them, unless your are reassigning the whole variable (e.g. directly into $variable, or $variable.part). To debug assignments, you can set the "org.apache.ode" logging category to DEBUG in order to see the content of variables as the process executes.

This links say that it is due to namespace error:

http://stackoverflow.com/questions/4498982/soap-exception-axis2ns2selectionfailure

http://old.nabble.com/assign-with-complex-types-td20919141.html

Solution:

The following assignment lucily solved the error:

<copy>
<from>
<literal>
<operation xmlns="">

<username> </username>
<password> </password>

</operation>
</literal>
</from>
<to variable="OperationIn" part="parameters"/>
</copy>

Hiç yorum yok:

Yorum Gönder