OK, I have gotten it closer now by adding a name space declaration as
follows:
class WeblogicWebServiceTesterController < ApplicationController
web_client_api :reverseRubyWebService, :soap,
‘http://localhost:7001/RubyWebService/com/captech/ruby/ReverseRubyWebService.jws’,
:handler_name => ‘ReverseRubyWebService’, :namespace =>
‘http://www.openuri.org/’
def findStringLength
len = reverseRubyWebService.FindStringLength(‘Ron’)
end
end
this produces:
<env:Envelope xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
env:Body
<n1:FindStringLength
env:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”
xmlns:n1=“http://www.openuri.org/”>
Ron
</n1:FindStringLength>
</env:Body>
</env:Envelope>
But what is missing is the n1:str why is it not adding the name space
stuff to the required elements?
Ron
From: [email protected] on behalf of Ron DiFrango
Sent: Wed 3/22/2006 1:26 PM
To: [email protected]; [email protected]
Subject: [Rails] RE: Webserivce problems
I see at least part of the problem, here is the request from rails:
<env:Envelope xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<env:Body>
<n1:FindStringLength
env:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”
xmlns:n1=“urn:ActionWebService”>
<str xsi:type="xsd:string">Ron</str>
</n1:FindStringLength>
</env:Body>
</env:Envelope>
And here is the same request from
<SOAP-ENV:Envelope
xmlns:SOAP-ENC=“http://schemas.xmlsoap.org/soap/encoding/”
xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”
xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
<SOAP-ENV:Body>
<FindStringLength xmlns="http://www.openuri.org/">
<str>string</str>
</FindStringLength>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So for some reason ActionWebservice is putting its own namespace on the
request and it s puking on the server side. Why might it be doing that
and I can I prevent that from happening?
Ron
From: [email protected] on behalf of Ron DiFrango
Sent: Wed 3/22/2006 1:15 PM
To: [email protected]
Subject: Webserivce problems
All,
I am attempting connect ROR to a remote web service and I am having no
luck. Below is the WSDL from this service.
Here is the API definition:
class WeblogicTesterApi < ActionWebService::API::Base
api_method :findStringLength, :expects => [{:str => :string}],
:returns => [:int]
end
And my test controller
class WeblogicWebServiceTesterController < ApplicationController
web_client_api :weblogicTester, :soap,
‘http://localhost:7001/RubyWebService/com/captech/ruby/ReverseRubyWebService.jws’,
:handler_name => ‘weblogicTester’
def findStringLength
len = weblogicTester.FindStringLength(‘Ron’)
end
end
When I run, I get the following:
Processing WeblogicWebServiceTesterController#findStringLength (for
127.0.0.1 at 2006-03-22 12:51:12) [GET]
Parameters: {“action”=>“findStringLength”,
“controller”=>“weblogic_web_service_tester”}
SOAP::FaultError (
Could not resolve method with element
‘urn:ActionWebService:FindStringLength’ as top element.
):
#SOAP::Mapping::Object:0x391eaa0
And on the web service side I see the following:
<Mar 22, 2006 12:51:12 PM EST> <000000> <Returning HTTP
500 due
to SOAP fault occurring on
DispFile=com.captech.ruby.ReverseRubyWebService>
Is there any way to dump the SOAP message before it leaves so I can see
the request? any thoughts on what is going wrong?
BTW…I can get a remote web service to connect in fine to ROR, just not
the other way around…yet.
Ron
<?xml version="1.0" encoding="utf-8"?>
<s:schema elementFormDefault=“qualified”
targetNamespace=“http://www.openuri.org/”
xmlns:s=“http://www.w3.org/2001/XMLSchema”>
<s:element name=“findStringLength”>
<s:complexType>
<s:sequence>
<s:element name=“str” type=“s:string” minOccurs=“0”/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“findStringLengthResponse”>
<s:complexType>
<s:sequence>
<s:element name=“findStringLengthResult” type=“s:int”/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name=“int” type=“s:int”/>
</s:schema>
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails