Forum: Ruby on Rails Ruby and Soap Soap4r

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7d90beab44e75ac306f5bdee6f676aac?d=identicon&s=25 noisewaterphd (Guest)
on 2008-12-04 13:33
(Received via mailing list)
I can't wrap my head around a soap4r issue i'm having, need some help
please!

So here is what I have:

This is the example envelope from a .net web service to authorize:

POST /PublicAPIReport/publicapiservice.asmx HTTP/1.1
Host: 10.1.2.64
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://REMOVEDFORSECURITY/WebServices/PublicAPIService/
Authorize"

<?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>
    <Authorize xmlns="http://REMOVEDFORSECURITY/WebServices/
PublicAPIService">
      <Auth>
        <User>string</User>
        <Password>string</Password>
        <CompanyID>string</CompanyID>
        <Version>string</Version>
      </Auth>
    </Authorize>
  </soap:Body>
</soap:Envelope>

Here is my code to create this envelope:

def store_metric

    endpoint_url = "http://REMOVEDFORSECURITY/PublicAPIReport/
publicapiservice.asmx"
    namespace = "http://REMOVEDFORSECURITY/WebServices/
PublicAPIService"
    soapaction = "http://REMOVEDFORSECURITY/WebServices/
PublicAPIService/Authorize"
    user = "REMOVEDFORSECURITY"
    pass = "REMOVEDFORSECURITY"
    company = "REMOVEDFORSECURITY"
    version = "7.0.1"

    driver = SOAP::RPC::Driver.new(endpoint_url, namespace,
soapaction)
    driver.add_rpc_method('Authorize', 'User' , 'Password',
'CompanyID' , 'Version')
    authorize = driver.Authorize(user, pass, company , version)

end


But this code of course results in this:

Wire dump:

= Request

! CONNECT TO 10.1.2.64:80
! CONNECTION ESTABLISHED
POST /PublicAPIReport/publicapiservice.asmx HTTP/1.1
SOAPAction: "http://REMOVEDFORSECURITY/WebServices/PublicAPIService/
Authorize"
Content-Type: text/xml; charset=utf-8
User-Agent: SOAP4R/1.5.5 (/187, ruby 1.8.6 (2007-03-13) [powerpc-
darwin8.8.0])
Date: Thu, 04 Dec 2008 10:44:16 GMT
Content-Length: 640
Host: 10.1.2.64

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <n1:Authorize xmlns:n1="http://REMOVEDFORSECURITY/WebServices/
PublicAPIService"
        env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <User xsi:type="xsd:string">REMOVEDFORSECURITY</User>
      <Password xsi:type="xsd:string">REMOVEDFORSECURITY</Password>
      <CompanyID xsi:type="xsd:string">Uinta</CompanyID>
      <Version xsi:type="xsd:string">7.0.1</Version>
    </n1:Authorize>
  </env:Body>
</env:Envelope>

= Response

HTTP/1.1 200 OK
Date: Thu, 04 Dec 2008 10:44:16 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 388

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/
XMLSchema"><soap:Body><AuthorizeResponse xmlns="http://
REMOVEDFORSECURITY/WebServices/
PublicAPIService"><AuthorizeResult>false</AuthorizeResult></
AuthorizeResponse></soap:Body></soap:Envelope>

Thanks so much for any help!  I'm pulling my hair out trying to figure
out how to get it working.

-Cam
This topic is locked and can not be replied to.