request schema issue on web service client with swa-ref generated by soap4r

9 views
Skip to first unread message

James

unread,
Dec 20, 2011, 2:11:15 AM12/20/11
to soap4r
When I used soap4r to call a remote web service with attachment, I met
some issues.
My scenario is: I have a remote web service on jboss, this web
service needs a input file attachment and other 2 string input
parameters and it output a file attachment. I use wsdl2ruby to
generate static client code and use it to call the web service.
When I use ruby client, I got "No file is assigned" error from sever
side, I checked the response, the input file is attached.
If I used soapUI to test the web service, it works well. And I
compared soapUI request with ruby client request, I found the
difference.
soapUI request:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:net.beaumaris.topology.topologyFormatConvertWebService">
<soapenv:Header/>
<soapenv:Body>
<urn:DataFileFormatConvert>
<!--Optional:-->
<OrigFile>cid:561899439922</OrigFile>
<!--Optional:-->

<TopologyImportDataFormat>SeaChange</
TopologyImportDataFormat><streamingZoneName>StreamingZone1</
streamingZoneName>
<!--Optional:-->

</urn:DataFileFormatConvert>
</soapenv:Body>
</soapenv:Envelope>
...

ruby request:
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<n1:DataFileFormatConvert
xmlns:n1="urn:net.beaumaris.topology.topologyFormatConvertWebService">
<OrigFile>
<content>2080.20838</content>
<operationResult xsi:nil="true"></operationResult>
</OrigFile>
<TopologyImportDataFormat>SeaChange</TopologyImportDataFormat>
<streamingZoneName>StreamingZone1</streamingZoneName>
</n1:DataFileFormatConvert>
</env:Body>
</env:Envelope>
...

We can find there are some difference between soapUI request and ruby
request when then deal with <OrigFile> tag, ruby client add a
<content> child tag to <OrigFile> tag while soapUI not.

My question is : how to modify my code/schema to make the web service
call succeed?
Any comments and workaround are welcome.
Thanks in advance.

-James

Reply all
Reply to author
Forward
0 new messages