I'm dealing with a problem of connecting to web-service with RPC/encoded WSDL file to my Java/Spring service. I cannot change this WSDL.
I figured out that I have to use Apache Axis 1.4 to create client (according to this problem: https://dzone.com/articles/wsdltojava-error-rpcencoded ).
Then I had problem with login/password/api_key parameters with such message:
<message name="login_message">
<part name="login" type="xsd:string"/>
<part name="password" type="xsd:string"/>
<part name="api_key" type="xsd:int"/>
</message>
Error Element 'api_key': '' is not a valid value of the atomic type 'xs:int'
I solved this problem by adding:
webapi_locator.getEngine().setOption("sendMultiRefs", Boolean.FALSE);
Now I can login and fetch some data from this service but I cannot pushed messages with null arguments like:
<message name="add_offer_input">
<part name="session" type="xsd:string"/>
<part name="category_id" type="xsd:int"/>
<part name="offer" type="tns:offer"/>
</message>
where offer is defined as:
<xsd:complexType name="offer">
<xsd:all>
<xsd:element name="price" type="xsd:float" minOccurs="0" maxOccurs="1"/>
<xsd:element name="price_m2" type="xsd:int" minOccurs="0" maxOccurs="1"/>
[...]
</xsd:all>
</xsd:complexType>
Now I am getting exception like this one:
org.apache.axis.AxisFault: Wrong parameters input xml
Element 'price': '' is not a valid value of the atomic type 'xs:int'. line: 1 column: 0'
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) ~[axis-1.4.jar:na]
I have already tried setting
elemField.setNillable(false);
to
elemField.setNillable(true);
in Offer.java.
I am creating Offer message in following way:
Offer offer = new Offer(null,null);
I will be very gratefull for found solution for this error. I don't need to stick with axis 1.4 - any other solution which letting me to connect to this service via SOAP with be usefull for me. Thank you very much for help!