Forum: Ruby SOAP request malformed (missing n1 element)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
mid (Guest)
on 2007-02-01 21:16
(Received via mailing list)
I've been trying to get this working for over a week now and I can't for
the life of me work it out.

I can currently generate SOAP requests in Ruby
by two methods:

1) Generating classes using wsdl2ruby
2) Using SOAP4r and manually generating requests

My problem is that I can get each of these to complete 90% of the task
I'm unable to get either of them to complete the task 100%

Using SOAP4r I can generate a valid request:

<?xml version="1.0" encoding="us-ascii" ?>
<env:Envelope xmlns:xsd=""
    <n1:ProcessAddress xmlns:n1="">
        <n1:Postcode>dg12 6eg</n1:Postcode>

Unfortunately it returns:

{}AddressLine1="1 Murray Street"
{}AddressLine3="DG12 6EG"
{}AddressLine4=... Kingdom"
{}Street="Murray Street"
{}Postcode="DG12 6EG"
{}Country="United Kingdom"

I haven't been able to find a way of accessing the information inside

If I use wsdl4rubys generated classes I generate a malformed SOAP

<?xml version="1.0" encoding="us-ascii" ?>
<env:Envelope xmlns:xsd=""
    <n1:ProcessAddress xmlns:n1="">
        <postcode>dg12 6eg</postcode>

Note the items: addresslin1 and postcode don't have n1 infront of them.
This causes the web service to not recognise those elements.

The response is in a format I can use. I can access each of the instance

<ProcessAddressResponse:0x984868c @processAddressResult=true,
@tmpContact=#<Contact:0x9848128 @company=nil, @region=nil,
@addressLine5=nil, @pOBox=nil, @cedex=nil, @addressLine1="United
@department=nil, @addressLine8=nil, @principality=nil, @subStreet=nil,
@addressLine4=nil, @subBuilding=nil, @countryISO="GBR", @dPS=nil,
@addressLine7=nil, @subCity=nil, @street=nil,
@aCR="L1-P0S0A0T0R0Z0C4-000", @addressLine3=nil, @building=nil,
@postcode=nil, @addressLine6=nil, @city=nil, @premise=nil,
@country="United Kingdom", @addressLine2=nil>>

I'm using structs to generate the items in <n1:tmpContact>

address =, :postcode)
request =, :password, :tmpContact)
"dg12 6eg")))

Does anyone know how I can either:

1) Access the data in the returned object in the first example
2) Generate a valid SOAP request with the missing n1 elements
3) Suggest another way I can go about this
This topic is locked and can not be replied to.