Ladon does not play well with Axis

Bug #983185 reported by Dmitry Tantsur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ladon
Fix Committed
Medium
jsgaarde

Bug Description

I am trying to access a service created with Ladon 0.7 (find attached WSDL that was generated by Ladon). However, Axis (1.4) seems to have problems with it:

16.04.2012 19:28:33 org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
AxisFault
 faultCode: server
 faultSubcode:
 faultString: Failed to convert from unicode string to Ladon supported type: <type 'int'>
invalid literal for int() with base 10: ''
 faultActor:
 faultNode:
 faultDetail:
 {}:Traceback (most recent call last):
  File "/home/divius/Projects/ladon/local/lib/python2.7/site-packages/ladon/server/dispatcher.py", line 143, in dispatch_request
    result = self.call_method(method,req_dict,tc,export_dict)
  File "/home/divius/Projects/ladon/local/lib/python2.7/site-packages/ladon/server/dispatcher.py", line 73, in call_method
    args += [tc.from_unicode_string(val,arg['type'])]
  File "/home/divius/Projects/ladon/local/lib/python2.7/site-packages/ladon/types/typeconverter.py", line 60, in from_unicode_string
    raise FromUnicodeConversionError(typ,str(e))
FromUnicodeConversionError: Failed to convert from unicode string to Ladon supported type: <type 'int'>
invalid literal for int() with base 10: ''

Failed to convert from unicode string to Ladon supported type: <type 'int'>
invalid literal for int() with base 10: ''
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
 at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:604)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1759)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2915)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
 at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:436)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:2443)
 at org.apache.axis.client.Call.invoke(Call.java:2366)
 at org.apache.axis.client.Call.invoke(Call.java:1812)
 at ru.niitp.ibd3.demos.ladon.DemoStub.add(DemoStub.java:183)
 at Main.main(Main.java:25)

It seems that Axis and Ladon have somewhat different encoding. How can it be possible?

Revision history for this message
Dmitry Tantsur (divius) wrote :
Revision history for this message
Dmitry Tantsur (divius) wrote :

Here is dumped request (inserted newlines):

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:add soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Demo"><a href="#id0"/><b href="#id1"/></ns1:add>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">20</multiRef>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">10</multiRef>
</soapenv:Body>
</soapenv:Envelope>

Revision history for this message
jsgaarde (jakob-simon-gaarde) wrote :

There is a new soap (soap11) implementation in ladon 0.7.1 (or at least new WSDL generator). Could I persuade you to try how it works with Axis?

Best regards
Jakob Simon-Gaarde

Changed in ladon:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → jsgaarde (jakob-simon-gaarde)
Revision history for this message
Dmitry Tantsur (divius) wrote :

BTW, you web site still mentions Ladon 0.7.0

Revision history for this message
Dmitry Tantsur (divius) wrote :

The same trouble with soap11. Attached is my source code.
Method 'add' generates fails on the following request from Axis:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:add soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Calculator"><a href="#id0"/><b href="#id1"/></ns1:add><multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef><multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:long" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2</multiRef></soapenv:Body></soapenv:Envelope>

but method ''hello' succeedes:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:hello soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Calculator"><name xsi:type="xsd:string">World</name></ns1:hello></soapenv:Body></soapenv:Envelope>

And one more thing: use="encoded" seems to be obsolete in WSDL's. None of new Java WS implementations I tried (Apache Axis2 and Apache XCF) seemed to support it.

Revision history for this message
Dmitry Tantsur (divius) wrote :
Revision history for this message
Dmitry Tantsur (divius) wrote :
Revision history for this message
Dmitry Tantsur (divius) wrote :

Just for reference: here is definition for very similar service generated by PySimpleSOAP.

Revision history for this message
Dmitry Tantsur (divius) wrote :

With the latest trunk (and soap) got this fault:

<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
 <SOAP-ENV:Body>
  <SOAP-ENV:Fault>
   <faultcode xsi:type="xsd:string">server</faultcode>
   <faultstring xsi:type="xsd:string">Values must be unicode while converting from string to Ladon supported types: encountered &lt;type 'dict'&gt;</faultstring>
   <detail>Traceback (most recent call last):
  File &quot;/home/divius/Projects/ws-test/local/lib/python2.7/site-packages/ladon-0.7.1-py2.7.egg/ladon/server/dispatcher.py&quot;, line 145, in dispatch_request
    result = self.call_method(method,req_dict,tc,export_dict)
  File &quot;/home/divius/Projects/ws-test/local/lib/python2.7/site-packages/ladon-0.7.1-py2.7.egg/ladon/server/dispatcher.py&quot;, line 73, in call_method
    args += [tc.from_unicode_string(val,arg['type'])]
  File &quot;/home/divius/Projects/ws-test/local/lib/python2.7/site-packages/ladon-0.7.1-py2.7.egg/ladon/types/typeconverter.py&quot;, line 46, in from_unicode_string
    raise NonUnicodeError(type(val))
NonUnicodeError: Values must be unicode while converting from string to Ladon supported types: encountered &lt;type 'dict'&gt;
</detail>
  </SOAP-ENV:Fault>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Revision history for this message
jsgaarde (jakob-simon-gaarde) wrote : Re: [Bug 983185] Re: Ladon does not play well with Axis
Download full text (6.4 KiB)

That looks like a nice formatted soap fault telling you that the client is
sending arguments that do not correspond with the service. Could you maybe
send the service source and your client's raw SOAP request.

Best Regards
Jakob Simon-Gaarde

2012/5/19 Dmitry "Divius" Tantsur <email address hidden>

> With the latest trunk (and soap) got this fault:
>
> <?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
> http://www.w3.org/1999/XMLSchema" xmlns:xsi="
> http://www.w3.org/1999/XMLSchema-instance">
> <SOAP-ENV:Body>
> <SOAP-ENV:Fault>
> <faultcode xsi:type="xsd:string">server</faultcode>
> <faultstring xsi:type="xsd:string">Values must be
> unicode while converting from string to Ladon supported types: encountered
> &lt;type 'dict'&gt;</faultstring>
> <detail>Traceback (most recent call last):
> File
> &quot;/home/divius/Projects/ws-test/local/lib/python2.7/site-packages/ladon-0.7.1-py2.7.egg/ladon/server/dispatcher.py&quot;,
> line 145, in dispatch_request
> result = self.call_method(method,req_dict,tc,export_dict)
> File
> &quot;/home/divius/Projects/ws-test/local/lib/python2.7/site-packages/ladon-0.7.1-py2.7.egg/ladon/server/dispatcher.py&quot;,
> line 73, in call_method
> args += [tc.from_unicode_string(val,arg['type'])]
> File
> &quot;/home/divius/Projects/ws-test/local/lib/python2.7/site-packages/ladon-0.7.1-py2.7.egg/ladon/types/typeconverter.py&quot;,
> line 46, in from_unicode_string
> raise NonUnicodeError(type(val))
> NonUnicodeError: Values must be unicode while converting from string to
> Ladon supported types: encountered &lt;type 'dict'&gt;
> </detail>
> </SOAP-ENV:Fault>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/983185
>
> Title:
> Ladon does not play well with Axis
>
> Status in Expose your service via multiple webservice protocols with ease.:
> Confirmed
>
> Bug description:
> I am trying to access a service created with Ladon 0.7 (find attached
> WSDL that was generated by Ladon). However, Axis (1.4) seems to have
> problems with it:
>
> 16.04.2012 19:28:33 org.apache.axis.utils.JavaUtils isAttachmentSupported
> WARNING: Unable to find required classes (javax.activation.DataHandler
> and javax.mail.internet.MimeMultipart). Attachment support is disabled.
> AxisFault
> faultCode: server
> faultSubcode:
> faultString: Failed to convert from unicode string to Ladon supported
> type: &lt;type 'int'&gt;
> invalid literal for int() with base 10: ''
> faultActor:
> faultNode:
> faultDetail:
> {}:Traceback (most recent call last):
> File
> &quot;/home/divius/Projects/ladon/local/lib/python2.7/site-packages/ladon/server/dispatcher.py&quot;,
> line 143, in dispatch_request
> result = self.call_method(method,req_dict,tc,export_dict)
> File
> &quot;/home/divius/Projects/ladon/local/lib/python2.7/site-packages/ladon/server/dispatcher.py&quot;,
> line 73, in call_method
> args += [...

Read more...

Revision history for this message
jsgaarde (jakob-simon-gaarde) wrote :

Hi Dmitry.

I just saw you already posted the service source and request sorry.

Best Regards
Jakob

Revision history for this message
jsgaarde (jakob-simon-gaarde) wrote :

Hi Dmitry.

If you call the method with suds, et works as it should. It's a problem with multi-reference I will look into it.

/ Jakob

Revision history for this message
jsgaarde (jakob-simon-gaarde) wrote :

Hi Dmitry.

I have created a patch which should correct this bug for both soap and soap11 interfaces. Could you please test it?

Best Regards
Jakob simon-Gaarde

Revision history for this message
Dmitry Tantsur (divius) wrote :

Bingo! It works! At least woth soap11

Revision history for this message
Dmitry Tantsur (divius) wrote :

Also works with just soap.

Still fails with CXF and Axis2 but this requires futher investigation. It seems to be a completely different bug.

Revision history for this message
jsgaarde (jakob-simon-gaarde) wrote :

Hi Dmitry.

Thanks, I'll close this one, when you have investigated the Axis2/CXF problem please report a bug more.

/ Jakob

Changed in ladon:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.