A
aastanti
Hello all,
I have a web service developed in java with axis and I'd like to invoke
it by means of SOAP4R. The problem is that I don't know how to pass an
array of bytes, without starting from the WSDL. I tried with
String#pack, an array with numbers or chars (ie: [121] or ['a'] or
[65.chr]), but they all fail.
On customer side I always get:
SOAP::FaultError: java.lang.IllegalArgumentException: argument type
mismatch
from #<SOAP::Mapping::Object:0x2bc5468>
Please consider that the argument is defined in wsdl as:
<wsdl
art name="x" type="xsd:base64Binary"/>
("x" is obviously a fake name)
I tried simply with String as well, but I get:
SOAP::FaultError: org.xml.sax.SAXException: Bad types (class
java.lang.String ->
class [B)
from #<SOAP::Mapping::Object:0x2cec320>
We tried calling the web service in the following way:
require 'soap/rpc/driver'
s =
SOAP::RPC:
river.new('http://localhost:8080/fake/services/BigFake',
'http://www.fake.com/fake')
s.add_method_with_soapaction("fakeMethod",
'http://localhost:8080/fake/services/BigFake/fakeMethod', ['in', 'x'])
x = ['a']
p s.fakeMethod(x)
Of course in reality we are calling a more complex method, with 8 input
parameters, 1 output parameter and a return value, but we have problem
only with the byte[] one.
The equivalent java version (the one that works) is a lot more complex,
hence it is not useful to post it here, but consider that the parameter
is passed to an axis call client as a native byte[].
We have tried to invoke the web service starting from the WSDL, and
surprisingly it works passing a String, which is not so understandable
to me:
require 'soap/wsdlDriver'
WSDL_URL = "http://localhost:8080/fake/services/BigFake?wsdl"
s = SOAP::WSDLDriverFactory.new(WSDL_URL).createDriver
x = "abc"
p s.fakeMethod(x)
Why the latter works, but the former, even passing a String, doesn't
work? Can anybody shed some light on this?
TIA
I have a web service developed in java with axis and I'd like to invoke
it by means of SOAP4R. The problem is that I don't know how to pass an
array of bytes, without starting from the WSDL. I tried with
String#pack, an array with numbers or chars (ie: [121] or ['a'] or
[65.chr]), but they all fail.
On customer side I always get:
SOAP::FaultError: java.lang.IllegalArgumentException: argument type
mismatch
from #<SOAP::Mapping::Object:0x2bc5468>
Please consider that the argument is defined in wsdl as:
<wsdl
("x" is obviously a fake name)
I tried simply with String as well, but I get:
SOAP::FaultError: org.xml.sax.SAXException: Bad types (class
java.lang.String ->
class [B)
from #<SOAP::Mapping::Object:0x2cec320>
We tried calling the web service in the following way:
require 'soap/rpc/driver'
s =
SOAP::RPC:
'http://www.fake.com/fake')
s.add_method_with_soapaction("fakeMethod",
'http://localhost:8080/fake/services/BigFake/fakeMethod', ['in', 'x'])
x = ['a']
p s.fakeMethod(x)
Of course in reality we are calling a more complex method, with 8 input
parameters, 1 output parameter and a return value, but we have problem
only with the byte[] one.
The equivalent java version (the one that works) is a lot more complex,
hence it is not useful to post it here, but consider that the parameter
is passed to an axis call client as a native byte[].
We have tried to invoke the web service starting from the WSDL, and
surprisingly it works passing a String, which is not so understandable
to me:
require 'soap/wsdlDriver'
WSDL_URL = "http://localhost:8080/fake/services/BigFake?wsdl"
s = SOAP::WSDLDriverFactory.new(WSDL_URL).createDriver
x = "abc"
p s.fakeMethod(x)
Why the latter works, but the former, even passing a String, doesn't
work? Can anybody shed some light on this?
TIA