P
Pete Elmore
Hello,
I'm having some difficulty getting Ruby to be able to successfully talk
to an ASP.NET application. (The answer to this question may be totally
obvious to someone familiar with XML, SOAP, etc.; sorry if my question
is a bit naive.) I was hoping someone might be able to help.
I'm getting a SOAP::FaultError trying to send a simple request to the
ASP.NET application. My test code looks like this:
require 'soap/rpc/driver'
sd = SOAP::RPC:river.new serv_url, namespace
sd.add_method_with_soapaction_as('get_venues', 'GetVenues',
'http://tickettechnology/GetVenues", 'UserName', 'Password',
'DomainName', 'bVerbose')
sd.default_encodingstyle =
SOAP::EncodingStyle::ASPDotNetHandler::Namespace
sd.generate_explicit_type = false
sd.get_venues username, password, domain_name, false
which yields:
SOAP::FaultError: Server was unable to process request. --> Validating
User Name: the submitted user name contains forbidden characters: null
string
The data the server expects looks like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetVenues xmlns="http://tickettechnology/">
<UserName>string</UserName>
<Password>string</Password>
<DomainName>string</DomainName>
<bVerbose>boolean</bVerbose>
</GetVenues>
</soap:Body>
</soap:Envelope>
But my code is generating this:
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:GetVenues xmlns:n1="http://tickettechnology/">
<UserName>username</UserName>
<Password>password</Password>
<DomainName>domainname</DomainName>
<bVerbose>false</bVerbose>
</n1:GetVenues>
</env:Body>
</env:Envelope>
(Of course, I cut out the actual username and password.)
It looked to me as if it was not finding the username string, since it
was definitely not null. Having very little knowledge of XML/SOAP, my
guess was that the problem was the 'n1:' bit, and so I spent the better
part of today trying to figure out how to get rid of it, with no
success. Any help at all would be greatly appreciated.
Thanks,
Pete
I'm having some difficulty getting Ruby to be able to successfully talk
to an ASP.NET application. (The answer to this question may be totally
obvious to someone familiar with XML, SOAP, etc.; sorry if my question
is a bit naive.) I was hoping someone might be able to help.
I'm getting a SOAP::FaultError trying to send a simple request to the
ASP.NET application. My test code looks like this:
require 'soap/rpc/driver'
sd = SOAP::RPC:river.new serv_url, namespace
sd.add_method_with_soapaction_as('get_venues', 'GetVenues',
'http://tickettechnology/GetVenues", 'UserName', 'Password',
'DomainName', 'bVerbose')
sd.default_encodingstyle =
SOAP::EncodingStyle::ASPDotNetHandler::Namespace
sd.generate_explicit_type = false
sd.get_venues username, password, domain_name, false
which yields:
SOAP::FaultError: Server was unable to process request. --> Validating
User Name: the submitted user name contains forbidden characters: null
string
The data the server expects looks like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetVenues xmlns="http://tickettechnology/">
<UserName>string</UserName>
<Password>string</Password>
<DomainName>string</DomainName>
<bVerbose>boolean</bVerbose>
</GetVenues>
</soap:Body>
</soap:Envelope>
But my code is generating this:
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:GetVenues xmlns:n1="http://tickettechnology/">
<UserName>username</UserName>
<Password>password</Password>
<DomainName>domainname</DomainName>
<bVerbose>false</bVerbose>
</n1:GetVenues>
</env:Body>
</env:Envelope>
(Of course, I cut out the actual username and password.)
It looked to me as if it was not finding the username string, since it
was definitely not null. Having very little knowledge of XML/SOAP, my
guess was that the problem was the 'n1:' bit, and so I spent the better
part of today trying to figure out how to get rid of it, with no
success. Any help at all would be greatly appreciated.
Thanks,
Pete