[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

wsdl2ruby help

Kelsen23@gmail.com

8/15/2007 2:24:00 PM

Hello -

I've been trying to figure out if and what I need to modify to get
Ruby to access these web services. In lieu of those of us who would
much rather see code than listen to someone rant about their problem,
I provided a simplified version of the WSDLs I am using.

My question is below the WSDL definitions~

####
# Security WSDL
####

<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:s0="http://randomsite.com/ws...
xmlns:soap="http://schemas.xmlsoap.org/wsdl/s...
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encod...
xmlns:s="http://www.w3.org/2001/XMLSc... xmlns:http="http://
schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://
randomsite.com/
wsapi/" xmlns="http://schemas.xmlsoap.org/wsdl/...
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://
randomsite.com/wsapi/">
<s:element name="Login">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="usrLogin"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="usrPassword"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="LoginResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="token"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="LoginSoapIn">
<part name="parameters" element="s0:Login" />
</message>
<message name="LoginSoapOut">
<part name="parameters" element="s0:LoginResponse" />
</message>
<portType name="SecuritySoap">
<operation name="Login">
<documentation>Login to web service.</documentation>
<input message="s0:LoginSoapIn" />
<output message="s0:LoginSoapOut" />
</operation>
</portType>
<binding name="SecuritySoap" type="s0:SecuritySoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/... />
<operation name="Login">
<soap:operation soapAction="http://randomsite....L...
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="Security">
<port name="SecuritySoap" binding="s0:SecuritySoap">
<soap:address location="https://randomsite.com/security.... />
</port>
</service>
</definitions>

#####
# Contact WSDL
#####

<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:s0="http://randomsite.com/ws...
xmlns:soap="http://schemas.xmlsoap.org/wsdl/s...
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encod...
xmlns:s="http://www.w3.org/2001/XMLSc... xmlns:http="http://
schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://
randomsite.com/
wsapi/" xmlns="http://schemas.xmlsoap.org/wsdl/...
<types>
<s:schema elementFormDefault="qualified" targetNamespace="http://
randomsite.com/wsapi/">
<s:import namespace="http://www.w3.org/2001/XMLSc... />
<s:element name="GetContacts">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="bogusName"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetContactsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="GetContactsResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Authentication" type="s0:Authentication" />
<s:complexType name="Authentication">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="token"
type="s:string" />
</s:sequence>
</s:complexType>
</s:schema>
</types>
<message name="GetContactsSoapIn">
<part name="parameters" element="s0:GetContacts" />
</message>
<message name="GetContactsSoapOut">
<part name="parameters" element="s0:GetContactsResponse" />
</message>
<message name="GetContactsAuthentication">
<part name="Authentication" element="s0:Authentication" />
</message>
<portType name="ContactSoap">
<operation name="GetContacts">
<documentation>Retrieves contact information.</documentation>
<input message="s0:GetContactsSoapIn" />
<output message="s0:GetContactsSoapOut" />
</operation>
</portType>
<binding name="ContactSoap" type="s0:ContactSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/... />
<operation name="GetContacts">
<soap:operation soapAction="http://randomsite....
GetContacts" style="document" />
<input>
<soap:body use="literal" />
<soap:header d5p1:required="true"
message="s0:GetContactsAuthentication" part="Authentication"
use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/w... />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="Contact">
<port name="ContactSoap" binding="s0:ContactSoap">
<soap:address location="https://randomsite.com/contact.... />
</port>
</service>
</definitions>

I downloaded the most recent (that I know of) gem of soap4r (1.5.7)
and httpclient (2.1.0.90.20070807) and used wsdl2ruby on both WSDLs.
I tested the security objects and everything worked great, no problems
whatsoever. When I tried to test the contact objects however there
was no mechanism to pass in the authentication value. As defined in
the Contact WSDL, the authentication token must be provided via the
SOAP header but it seems wsdl2ruby did not parse that out.

Do I need to doctor up the WSDL in order for wsdl2ruby to parse it
correctly or is this functionality not available at this time? If
it's not, do you have any idea where the best place to start would
be. I was diving into the SOAP::RPC::Driver and SOAP::RPC::Proxy
classes but I wasn't sure where to start.

Thanks in advance.

Regards,

Kelsen

39 Answers

Felipe Contreras

8/15/2007 3:34:00 PM

0

On 8/15/07, Kelsen23@gmail.com <Kelsen23@gmail.com> wrote:
> Hello -
>
> I've been trying to figure out if and what I need to modify to get
> Ruby to access these web services. In lieu of those of us who would
> much rather see code than listen to someone rant about their problem,
> I provided a simplified version of the WSDLs I am using.
>
> My question is below the WSDL definitions~
>
> ####
> # Security WSDL
> ####
>
> <?xml version="1.0" encoding="utf-8"?>
> <definitions xmlns:s0="http://randomsite.com/ws...
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/s...
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encod...
> xmlns:s="http://www.w3.org/2001/XMLSc... xmlns:http="http://
> schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://
> randomsite.com/
> wsapi/" xmlns="http://schemas.xmlsoap.org/wsdl/...
> <types>
> <s:schema elementFormDefault="qualified" targetNamespace="http://
> randomsite.com/wsapi/">
> <s:element name="Login">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="usrLogin"
> type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="usrPassword"
> type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="LoginResponse">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="token"
> type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:schema>
> </types>
> <message name="LoginSoapIn">
> <part name="parameters" element="s0:Login" />
> </message>
> <message name="LoginSoapOut">
> <part name="parameters" element="s0:LoginResponse" />
> </message>
> <portType name="SecuritySoap">
> <operation name="Login">
> <documentation>Login to web service.</documentation>
> <input message="s0:LoginSoapIn" />
> <output message="s0:LoginSoapOut" />
> </operation>
> </portType>
> <binding name="SecuritySoap" type="s0:SecuritySoap">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/... />
> <operation name="Login">
> <soap:operation soapAction="http://randomsite....L...
> style="document" />
> <input>
> <soap:body use="literal" />
> </input>
> <output>
> <soap:body use="literal" />
> </output>
> </operation>
> </binding>
> <service name="Security">
> <port name="SecuritySoap" binding="s0:SecuritySoap">
> <soap:address location="https://randomsite.com/security.... />
> </port>
> </service>
> </definitions>
>
> #####
> # Contact WSDL
> #####
>
> <?xml version="1.0" encoding="utf-8"?>
> <definitions xmlns:s0="http://randomsite.com/ws...
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/s...
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encod...
> xmlns:s="http://www.w3.org/2001/XMLSc... xmlns:http="http://
> schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://
> randomsite.com/
> wsapi/" xmlns="http://schemas.xmlsoap.org/wsdl/...
> <types>
> <s:schema elementFormDefault="qualified" targetNamespace="http://
> randomsite.com/wsapi/">
> <s:import namespace="http://www.w3.org/2001/XMLSc... />
> <s:element name="GetContacts">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="bogusName"
> type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="GetContactsResponse">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1"
> name="GetContactsResult">
> <s:complexType>
> <s:sequence>
> <s:element ref="s:schema" />
> <s:any />
> </s:sequence>
> </s:complexType>
> </s:element>
> </s:sequence>
> </s:complexType>
> </s:element>
> <s:element name="Authentication" type="s0:Authentication" />
> <s:complexType name="Authentication">
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="token"
> type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:schema>
> </types>
> <message name="GetContactsSoapIn">
> <part name="parameters" element="s0:GetContacts" />
> </message>
> <message name="GetContactsSoapOut">
> <part name="parameters" element="s0:GetContactsResponse" />
> </message>
> <message name="GetContactsAuthentication">
> <part name="Authentication" element="s0:Authentication" />
> </message>
> <portType name="ContactSoap">
> <operation name="GetContacts">
> <documentation>Retrieves contact information.</documentation>
> <input message="s0:GetContactsSoapIn" />
> <output message="s0:GetContactsSoapOut" />
> </operation>
> </portType>
> <binding name="ContactSoap" type="s0:ContactSoap">
> <soap:binding transport="http://schemas.xmlsoap.org/soap/... />
> <operation name="GetContacts">
> <soap:operation soapAction="http://randomsite....
> GetContacts" style="document" />
> <input>
> <soap:body use="literal" />
> <soap:header d5p1:required="true"
> message="s0:GetContactsAuthentication" part="Authentication"
> use="literal" xmlns:d5p1="http://schemas.xmlsoap.org/w... />
> </input>
> <output>
> <soap:body use="literal" />
> </output>
> </operation>
> </binding>
> <service name="Contact">
> <port name="ContactSoap" binding="s0:ContactSoap">
> <soap:address location="https://randomsite.com/contact.... />
> </port>
> </service>
> </definitions>
>
> I downloaded the most recent (that I know of) gem of soap4r (1.5.7)
> and httpclient (2.1.0.90.20070807) and used wsdl2ruby on both WSDLs.
> I tested the security objects and everything worked great, no problems
> whatsoever. When I tried to test the contact objects however there
> was no mechanism to pass in the authentication value. As defined in
> the Contact WSDL, the authentication token must be provided via the
> SOAP header but it seems wsdl2ruby did not parse that out.
>
> Do I need to doctor up the WSDL in order for wsdl2ruby to parse it
> correctly or is this functionality not available at this time? If
> it's not, do you have any idea where the best place to start would
> be. I was diving into the SOAP::RPC::Driver and SOAP::RPC::Proxy
> classes but I wasn't sure where to start.
>
> Thanks in advance.

You might have better luck in http://groups.google.com/gr...

--
Felipe Contreras

JRStern

11/12/2012 4:40:00 PM

0

On Mon, 12 Nov 2012 05:57:56 -0700, anim8rFSK <anim8rfsk@cox.net>
wrote:

>In article <PZ-dnTj119fSWT3NnZ2dnUVZ_rCdnZ2d@giganews.com>,
> Rich <none@nowhere.com> wrote:
>
>> ABC news was crowing on about the damage.
>>
>> 1700 homes partially or fully destroyed. Ok, lets say you rebuild them
>> all, from the ground up. The land is already paid for so we are just
>> talking about rebuilding the house.
>>
>> 1700 x $125,000/ea = $212,000,000 So WHERE do these figures bandied about
>> by the media come from? $20 billion, $40 billion? Sounds like a MASSIVE
>> fraud.
>
>Where do you come up with $125k to build a house?

Yah that's low for replacement building, but you have a point, even if
it's another 100,000 homes with an average of $10,000 in damage, and
another million homes with $1,000 in damage, it's hard to get to those
kinds of numbers.

J.


Obveeus

11/12/2012 5:20:00 PM

0


"Mason Barge" <masonbarge@gmail.com> wrote:
> On Mon, 12 Nov 2012 05:57:56 -0700, anim8rFSK <anim8rfsk@cox.net> wrote:
>
>> Rich <none@nowhere.com> wrote:
>>
>>> ABC news was crowing on about the damage.
>>>
>>> 1700 homes partially or fully destroyed. Ok, lets say you rebuild them
>>> all, from the ground up. The land is already paid for so we are just
>>> talking about rebuilding the house.
>>>
>>> 1700 x $125,000/ea = $212,000,000 So WHERE do these figures bandied
>>> about
>>> by the media come from? $20 billion, $40 billion? Sounds like a
>>> MASSIVE
>>> fraud.
>>
>>Where do you come up with $125k to build a house?
>
> At $100 per square foot, for most of the houses I saw, probably more like
> $200k, plus at least 10% extra for cleanup.

One thing to keep in mind, though, is that the cost to build should be
significantly lower than the 'retail price' for housing. If housing is
going for $100/sqft in Atlanta it probably costs $50/sqft to build.
Supplies might cost somewhat more in the Northeast, but for the most part
the supply cost is probably 20% or less higher (labor might be double) while
the price per square foot is somewhat astronomically higher. It really
should not cost $2,000,000 to build a home in Northern Nrew Jersey when the
same exact home would only cost $100,000 to build in Georgia.

> But there will be major expense in clearing and repaving roads and
> improvements (sewer, water, power).

Yep...and all the business office space which was not counted in the bad
guestimate that started this thread.

> It goes slowly and is hard to do. My sister got caught in the brunt of
> Andrew in 1992 and words cannot express the devastation. With all the
> street signs gone, all the trees gone, houses gone or ruined, and street
> impassable, you couldn't even tell where you were. My brother in law got
> lost three blocks from his house.

Which brings up another point: with all the rightwing propaganda about
places where the power is not back on, there are a lot of places where it
very much should not be turned back on. Some neighborhoods were destroyed
(houses burning to the ground or washed off of foundations and places that
were underwater for many days) and the power should stay off (except for
re-construction) in those areas even after the mainline utilities are
restored.


suzeeq

11/12/2012 5:25:00 PM

0

Obveeus wrote:
> "Mason Barge" <masonbarge@gmail.com> wrote:
>> On Mon, 12 Nov 2012 05:57:56 -0700, anim8rFSK <anim8rfsk@cox.net> wrote:
>>
>>> Rich <none@nowhere.com> wrote:
>>>
>>>> ABC news was crowing on about the damage.
>>>>
>>>> 1700 homes partially or fully destroyed. Ok, lets say you rebuild them
>>>> all, from the ground up. The land is already paid for so we are just
>>>> talking about rebuilding the house.
>>>>
>>>> 1700 x $125,000/ea = $212,000,000 So WHERE do these figures bandied
>>>> about
>>>> by the media come from? $20 billion, $40 billion? Sounds like a
>>>> MASSIVE
>>>> fraud.
>>> Where do you come up with $125k to build a house?
>> At $100 per square foot, for most of the houses I saw, probably more like
>> $200k, plus at least 10% extra for cleanup.
>
> One thing to keep in mind, though, is that the cost to build should be
> significantly lower than the 'retail price' for housing. If housing is
> going for $100/sqft in Atlanta it probably costs $50/sqft to build.
> Supplies might cost somewhat more in the Northeast, but for the most part
> the supply cost is probably 20% or less higher (labor might be double) while
> the price per square foot is somewhat astronomically higher. It really
> should not cost $2,000,000 to build a home in Northern Nrew Jersey when the
> same exact home would only cost $100,000 to build in Georgia.

Plus the foundation's are already in, if they're rebuilding on the same
lot. That can save a lot on the cost to rebuild. I doubt it's as cheap
as $50/sq foot in Atlanta, the cost is probably a lot closer to $100/sf.

Steve Bartman

11/12/2012 5:30:00 PM

0

On Mon, 12 Nov 2012 11:34:07 -0500, Mason Barge <masonbarge@gmail.com>
wrote:


>At $100 per square foot, for most of the houses I saw, probably more like
>$200k, plus at least 10% extra for cleanup.

Won't be $100 sq. ft. as long as construction labor demand is what
it's going to be for the next year or two.

Steve

Steve Bartman

11/12/2012 5:33:00 PM

0

On Mon, 12 Nov 2012 08:39:44 -0800, JRStern <JRStern@foobar.invalid>
wrote:

>On Mon, 12 Nov 2012 05:57:56 -0700, anim8rFSK <anim8rfsk@cox.net>
>wrote:
>
>>In article <PZ-dnTj119fSWT3NnZ2dnUVZ_rCdnZ2d@giganews.com>,
>> Rich <none@nowhere.com> wrote:
>>
>>> ABC news was crowing on about the damage.
>>>
>>> 1700 homes partially or fully destroyed. Ok, lets say you rebuild them
>>> all, from the ground up. The land is already paid for so we are just
>>> talking about rebuilding the house.
>>>
>>> 1700 x $125,000/ea = $212,000,000 So WHERE do these figures bandied about
>>> by the media come from? $20 billion, $40 billion? Sounds like a MASSIVE
>>> fraud.
>>
>>Where do you come up with $125k to build a house?
>
>Yah that's low for replacement building, but you have a point, even if
>it's another 100,000 homes with an average of $10,000 in damage, and
>another million homes with $1,000 in damage, it's hard to get to those
>kinds of numbers.

The number also include loss of economic activity as well as losses to
public infrastructure. Media reports I've seen (New York Times) put
house losses and major damage on Long Island at 100,000 houses. The
media have focused on NJ and Manhattan/Staten Island. Long Island has
barely been reported on.


Steve

Steve Bartman

11/12/2012 5:40:00 PM

0

On Mon, 12 Nov 2012 10:25:03 -0700, suzeeq <suzee@imbris.com> wrote:

>Plus the foundation's are already in, if they're rebuilding on the same
>lot. That can save a lot on the cost to rebuild. I doubt it's as cheap
>as $50/sq foot in Atlanta, the cost is probably a lot closer to $100/sf.

The foundations on a lot of them have been torqued by the press of the
water on the structure and the footings are unreliable. I doubt you'd
get insurance on a rebuild without a full structural engineer cert of
the footings and that's not cheap, not are there hundreds of thousands
of civil engineers standing around unemployed.

Steve

suzeeq

11/12/2012 7:15:00 PM

0

Steve Bartman wrote:
> On Mon, 12 Nov 2012 10:25:03 -0700, suzeeq <suzee@imbris.com> wrote:
>
>> Plus the foundation's are already in, if they're rebuilding on the same
>> lot. That can save a lot on the cost to rebuild. I doubt it's as cheap
>> as $50/sq foot in Atlanta, the cost is probably a lot closer to $100/sf.
>
> The foundations on a lot of them have been torqued by the press of the
> water on the structure and the footings are unreliable. I doubt you'd
> get insurance on a rebuild without a full structural engineer cert of
> the footings and that's not cheap, not are there hundreds of thousands
> of civil engineers standing around unemployed.

I hadn't thought about the foundations being damaged, but they may well
have to be replaced too. So looks like we're back to $100/sf costs for sure.

Obveeus

11/12/2012 7:26:00 PM

0


"Steve Bartman" <sbartman@visi.com> wrote:
> The number also include loss of economic activity as well as losses to
> public infrastructure.

I read something a week or so ago about the city losing $2 million per day
in revenue for every day that the subway and busses were not running.


Anim8rFSK

11/12/2012 7:31:00 PM

0

In article <k7rhrs$hpk$1@dont-email.me>, suzeeq <suzee@imbris.com>
wrote:

> Steve Bartman wrote:
> > On Mon, 12 Nov 2012 10:25:03 -0700, suzeeq <suzee@imbris.com> wrote:
> >
> >> Plus the foundation's are already in, if they're rebuilding on the same
> >> lot. That can save a lot on the cost to rebuild. I doubt it's as cheap
> >> as $50/sq foot in Atlanta, the cost is probably a lot closer to $100/sf.
> >
> > The foundations on a lot of them have been torqued by the press of the
> > water on the structure and the footings are unreliable. I doubt you'd
> > get insurance on a rebuild without a full structural engineer cert of
> > the footings and that's not cheap, not are there hundreds of thousands
> > of civil engineers standing around unemployed.
>
> I hadn't thought about the foundations being damaged, but they may well
> have to be replaced too. So looks like we're back to $100/sf costs for sure.

And you probably need a toxic clean up crew checking those foundations
to be safe. And double it for being run by government.

--
"Every time a Kardashian gets a TV show, an angel dies."