Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Problem creating SOAP Request

Reply
Thread Tools

Problem creating SOAP Request

 
 
Matt Su
Guest
Posts: n/a
 
      07-31-2007
Hi there,

I am trying to do a soap request to the Mapping Service Map24.

They have a WSDL for their webservice:

http://maptp11.map24.com/map24/webse...ap24Geocoder51

I am attempting to do the Free Geocode operation: 'searchFree'. It
appears this takes a RequestHeader and a MapSearchFreeRequest. I use
the following code to create my request:

factory =
SOAP::WSDLDriverFactory.new("http://maptp11.map24.com/map24/webservices1.5?soap=Map24Geocoder51")
driver = factory.create_rpc_driver
result = driver.searchFree( {:Map24ID => "1"}, {:SearchText =>
"London, UK"} )

However, this only ever generates the following SOAP Request:

<env:Envelope xmlnssd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:searchFree xmlns:n1="urn:Map24Geocoder51"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<RequestHeader xsi:nil="true"></RequestHeader>
<MapSearchFreeRequest xsi:nil="true"></MapSearchFreeRequest>
</n1:searchFree>
</env:Body>
</env:Envelope>

The RequestHeader and MapSearchFreeRequest parts are ALWAYS empty..?

Can anyone help?

Thanks in advance
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
dima
Guest
Posts: n/a
 
      07-31-2007
On Jul 31, 12:56 pm, Matt Su <(E-Mail Removed)> wrote:
> Hi there,
>
> I am trying to do a soap request to the Mapping Service Map24.
>
> They have a WSDL for their webservice:
>
> http://maptp11.map24.com/map24/webse...ap24Geocoder51
>
> I am attempting to do the Free Geocode operation: 'searchFree'. It
> appears this takes a RequestHeader and a MapSearchFreeRequest. I use
> the following code to create my request:
>
> factory =
> SOAP::WSDLDriverFactory.new("http://maptp11.map24.com/map24/webservices1.5?soap=Map24Geocoder51")
> driver = factory.create_rpc_driver
> result = driver.searchFree( {:Map24ID => "1"}, {:SearchText =>
> "London, UK"} )
>
> However, this only ever generates the following SOAP Request:
>
> <env:Envelope xmlnssd="http://www.w3.org/2001/XMLSchema"
> xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlnssi="http://www.w3.org/2001/XMLSchema-instance">
> <env:Body>
> <n1:searchFree xmlns:n1="urn:Map24Geocoder51"
> env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <RequestHeader xsi:nil="true"></RequestHeader>
> <MapSearchFreeRequest xsi:nil="true"></MapSearchFreeRequest>
> </n1:searchFree>
> </env:Body>
> </env:Envelope>
>
> The RequestHeader and MapSearchFreeRequest parts are ALWAYS empty..?
>
> Can anyone help?
>
> Thanks in advance
> --
> Posted viahttp://www.ruby-forum.com/.


You should post your question on http://groups.google.com/group/soap4r

 
Reply With Quote
 
 
 
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      07-31-2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Matt Su wrote:
> factory =
> SOAP::WSDLDriverFactory.new("http://maptp11.map24.com/map24/webservices1.5?soap=Map24Geocoder51")
> driver = factory.create_rpc_driver
> result = driver.searchFree( {:Map24ID => "1"}, {:SearchText =>
> "London, UK"} )


When you use a Hash as a parameter, you need to start from a parameter name.

result = driver.searchFree(
{:RequestHeader => {:Map24ID => "1"}},
{:MapSearchFreeRequest => {:SearchText => "London, UK"}}
)

Generating stub files with wsdl2ruby.rb should be easier to use for this
kind of service which has complex request.

// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRq9Frh9L2jg5EEGlAQK0SAgAp19e5ag2PUflBgwqvV LtN+e7x5GHtWLl
mfI8MpaJ8P4mZ1H3hG8+SQuGzP4KoQXpcyhXrsrx77s43ozWQg j+0vhytPBo7ome
TSAA5F+HAHVTi7NSB0KNLAbrCF58MBVvJRLO8MBxm9if+IyqRG W5bP4Rt3s9Wkdg
d+Y1KoYlIUQw7S2f4Oy5g8Iaj68+L8zv2n90bFS90sz/Zoq7MtDUDPezseOnhMWC
TrdcOFTyhhXHG/z+KJbpWYDKFNsmu+x9769PdnoxBtwdTEOMiIs/oZHmNIobeCeL
dom7p/OBHgz1Gv/yZLWJrMTOBGgD7ZgGXvnGVa9efpCBRawQSZFOhg==
=K0aY
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Matt Su
Guest
Posts: n/a
 
      07-31-2007
> When you use a Hash as a parameter, you need to start from a parameter
> name.
>
> result = driver.searchFree(
> {:RequestHeader => {:Map24ID => "1"}},
> {:MapSearchFreeRequest => {:SearchText => "London, UK"}}
> )
>
> Generating stub files with wsdl2ruby.rb should be easier to use for this
> kind of service which has complex request.


Thanks for your response I really appreciate it.

I tried your modification, however I still see the following SOAP
Request being generated:

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlnssd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:searchFree xmlns:n1="urn:Map24Geocoder51"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<RequestHeader xsi:nil="true"></RequestHeader>
<MapSearchFreeRequest xsi:nil="true"></MapSearchFreeRequest>
</n1:searchFree>
</env:Body>
</env:Envelope>

Why are the RequestHeader and MapSearchFreeRequest xsi:nil attributes
true: should they not be filled with whatever I pass in the call
driver.searchFree?

I have used the SOAP and Driver Generator before for a simpler request
for a different service and it worked perfectly. Does the
WSDLDriverFactory and the create_rpc_driver method not always work for
complex WSDLs??

Thanks again in advance
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      08-01-2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

What version of soap4r are you using? As Andre wrote in soap4r-ml, it
should generate request elements with earlier soap4r versions.

% ruby -rsoap/soap -e 'p SOAP::Version'

I tried soap4r-1.5.5 which is bundled with ruby-1.8.X and found that it
fails to parse the WSDL you pointed. If you are using soap4r-1.5.5,
please update to soap4r-1.5.7 from http://dev.ctor.org/soap4r

Matt Su wrote:
>> When you use a Hash as a parameter, you need to start from a parameter
>> name.


It's wrong. It works but not needed. Sorry for confusing you. The
client program you posted at first should work with soap4r-1.5.7.

Regards,
// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRq/uGR9L2jg5EEGlAQIeygf/ej4KhKxsZ6QXrf6X5JOsAXSxhMzuEVMS
mQ3scSskogAEPmhSrEUvr25jGJNnlkKwhd2ep/OOpD1moGEN2/x9e2Illhy9ABpk
lpqVhlggCRI4JL2N0xJBleSis4RQLXGlwO+ae3PMZ54BRcMMTY MWtcmSw81eDHEV
gqzNSUawAKnxbjF0uczHQySual2wWfMBHbM7+CPTVab99AZA3C HUgObFMcH4iOTL
Tz9cy3NF0+5+A02N1UXZ9MT70KiAYklLdsmIg5latt171Lgx3K/TzxhKegeG353U
Jmgv3SlZyo3EVYUVrC0+zmBlDUDxIlJey4MyZegB6+s/He0NUQ0Z0w==
=bwlR
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make soap request and receive soap response from php soapservice Ivan S ASP .Net 0 08-13-2008 03:35 PM
Soap Extension problem (seems that soap request is not sent to server) Frederik Vanderhaegen ASP .Net Web Services 0 10-20-2006 09:18 AM
SOAP Request is repeated in the SOAP response. comp.text.xml XML 0 09-20-2006 08:41 AM
Re: Accessing Request.InputStream / Request.BinaryRead *as the request is occuring*: How??? Brian Birtle ASP .Net 2 10-16-2003 02:11 PM
Problem of using apache soap to consume WSE 2.0 soap attachment Mullin Yu ASP .Net Web Services 0 10-08-2003 08:09 AM



Advertisments