Hi.
I've been trying to do something with SOAP for hours with no luck. I
need to get a request that looks like :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:getEligibilite xmlns:ns1="urn:eligibilite">
<nd xsi:type="xsd:string"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">foobar</nd>
<offre xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Array"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
ns2:arrayType="xsd:int[15]">
<item xsi:type="xsd:int">101</item>
...
and I get :
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:getEligibilite xmlns:n1="urn:eligibilite"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<nd xsi:type="xsd:string">foobar</nd>
<offre n2:arrayType="n1:int[3]"
xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="n2:Array">
<item xsi:type="xsd:int">101</item>
...
Note the encodingStyle specified in the n1 part of the XML, and not in
the nd part. The server gives me an error, and I beleive because of it.
The code currently looks like :
106 map = SOAP::Mapping::Registry.new
107 map.set(IntArray, SOAP::SOAPArray,
108 SOAP::Mapping::Registry::TypedArrayFactory,
109 { :type => XSD::QName.new('urn:eligibilite',
'int') })
110
111 # On met le mapper
112 soap.mapping_registry = map
113 soap.default_encodingstyle =
SOAP::EncodingStyle::SOAPHandler::Namespace
114
115 #soapObj = SOAP::Marshal.marshal( IntArray[ 101, 102, 103
], map )
116
117 soap.getEligibilite("foobar", IntArray[ 101, 102, 103
],"","something")
I've already spent hours on that soap part just to find documentation
to be able to send an Array of int[] ... Anyone has a
hint/documentation how I could fix my request and move on ?
Thanks.