Invalid Soap request gets created

Hello Team,
I am using savon to create SOAP request’s, below is the code

response = newclient.request :soap, :copy_into_items do
soap.body ={“SourceUrl” =>srcpath,
“DestinationUrls” => [“string” =>docpath],
“Fields” =>
{:FieldInformation =>"", :attributes! => {:FieldInformation=>
{:Type=>“Text”,:DisplayName=>“description”, :InternalName =>
“description”, :Value=>“testDesc”} }},
“Stream” => enc
}
end

Below is the request created with above code

<?xml version="1.0" encoding="UTF-8"?><env:Envelope

xmlns:xsd=“http://www.w3.org/2001/XMLSchema
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xmlns:tns=“http://schemas.microsoft.com/sharepoint/soap/
xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/
xmlns:ins0=“http://schemas.microsoft.com/sharepoint/soap/”>
env:Body
ins0:CopyIntoItems
ins0:SourceUrlD:\baba\Baba.txt</ins0:SourceUrl>
ins0:DestinationUrls
ins0:stringhttp://sitename/test/Baba.txt</ins0:string>
</ins0:DestinationUrls>ins0:Fieldsins0:FieldInformation
</ins0:FieldInformation></ins0:Fields>ins0:StreamQmFiYQ==
</ins0:Stream></ins0:CopyIntoItems></env:Body></env:Envelope>

in above request if you see the xml tag FieldInformation it dosent have
any attribute assoicated with it, same is working fine if i change the
tag name to any other value e.g FieldInformation1, then the response i
am getting is as expected i.e. all attributes are added, i tried with
many other strings its perfectly working but only fails if the tag name
is FieldInformation

<?xml version="1.0" encoding="UTF-8"?><env:Envelope

xmlns:xsd=“http://www.w3.org/2001/XMLSchema
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xmlns:tns=“http://schemas.microsoft.com/sharepoint/soap/
xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/
xmlns:ins0=“http://schemas.microsoft.com/sharepoint/soap/”>
env:Bodyins0:CopyIntoItemsins0:SourceUrlD:\baba\Baba.txt
</ins0:SourceUrl>ins0:DestinationUrls
ins0:stringhttp://sitename/test/Baba.txt</ins0:string>
</ins0:DestinationUrls>
ins0:Fields<tns:FieldInformation1
Type=“Text” DisplayName=“description” InternalName=“description”
Value=“testDesc”></tns:FieldInformation1>
</ins0:Fields>ins0:StreamQmFiYQ==
</ins0:Stream></ins0:CopyIntoItems></env:Body></env:Envelope>

This is very strange behavior, if any one has any idea then please
reply, thanks in advance
Baba

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs