Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
soap wsdl envelope
Jared Moody
12/21/2007 2:55:00 AM
I'm having some trouble getting my SOAP envelope to do what I want and
need a little tip. I can't get the SubscriberCustomField nodes to be
anything but blank:
Here's what I want it to look like:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="
http://www.w3.org/2001/XMLSchema-inst...
xmlns:xsd="
http://www.w3.org/2001/XMLSc...
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/...
<soap:Body>
<Subscriber.AddWithCustomFields
xmlns="
http://api.createsend.com/api/...
<ApiKey>string</ApiKey>
<ListID>string</ListID>
<Email>string</Email>
<Name>string</Name>
<CustomFields>
<SubscriberCustomField>
<Key>comments</Key>
<Value>Hello World</Value>
</SubscriberCustomField>
</CustomFields>
</Subscriber.AddWithCustomFields>
</soap:Body>
</soap:Envelope>
Here's what I'm getting:
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="
http://www.w3.org/2001/XMLSc...
xmlns:env="
http://schemas.xmlsoap.org/soap/envel...
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-inst...
>
<env:Body>
<n1:Subscriber.AddWithCustomFields
xmlns:n1="
http://api.createsend.com/api/...
<n1:ApiKey>string</n1:ApiKey>
<n1:ListID>string</n1:ListID>
<n1:Email>string</n1:Email>
<n1:Name>string</n1:Name>
<n1:CustomFields>
<n1:SubscriberCustomField>
</n1:SubscriberCustomField>
<n1:SubscriberCustomField>
</n1:SubscriberCustomField>
</n1:CustomFields>
</n1:Subscriber.AddWithCustomFields>
</env:Body>
</env:Envelope>
And here's my code
require 'soap/wsdlDriver'
require 'cgi'
@url = "http://#{site_name}.createsend.com/api/api.asmx?wsdl"
@service = SOAP::WSDLDriverFactory.new(@url).create_rpc_driver
str = ""
#custom_fields = "<SubscriberCustomField><Key>comments</Key><Value>hello
world</Value></SubscriberCustomField>"
#custom_fields = [{:SubscriberCustomField => {:Key => "comments", :Value
=> "hello world"}}]
#custom_fields = [{:Key => "comments", :Value => "hello world"}]
#custom_fields = [:comments => "hello world"]
custom_fields = {:SubscriberCustomField => {:Key => "comments", :Value
=> "hello world"}}
@service.wiredump_dev = str
@service.AddSubscriberWithCustomFields({:ApiKey=>@api_key,
:ListID=>list_id, :Email=>email, :Name=>name, :CustomFields =>
custom_fields})
puts str
The commented custom_fields variables are things I've tried with the
same result.
Thanks in advance for the help.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
soap wsdl envelope
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password