Hi,

Could you outline the failings in your code?

I have built similar gateways for communicating with credit reference
authorities from within our Rails application. If you have a WSDL
schema, give soap4r (http://dev.ctor.org/soap4r) a try, its a gem and
it takes care of all the net/http stuff and returns a ruby object,
quite neat.

Ivan

norat wrote:
> Hi every one
> i am trying to communicate with xml gateway but recently i could not
> got success in that
> my code is
> require 'net/https'
> require 'uri'^M
> require 'md5'
> require 'openssl'
> require "rexml/document"
> xml_string = <<-END_XML
> <GovTalkMessage xmlns="http://www.govtalk.gov.uk/schemas/govtalk/
> govtalkheader"
>                 xmlns:dsig="http://www.w3.org/2000/09/xmldsig#";
>                 xmlns:gt="http://www.govtalk.gov.uk/schemas/govtalk/
> core"
>                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>                 xsi:schemaLocation="http://www.govtalk.gov.uk/schemas/
> govtalk/g\
> ovtalkheader">
>   <EnvelopeVersion>1.0</EnvelopeVersion>
>
> <Header>
> <IDAuthentication>
> <SenderID>'+MD5.new("66662203000").to_s+'</SenderID>
>
> <Authentication>
> <Method>CHMD5</Method>
> <Value>'+MD5.new("EMEQCC9XDV6").to_s+' </Value>
> </Authentication>
> </IDAuthentication>
> </SenderDetails>
> </Header>
>
> <GovTalkDetails>
> <Keys/>
> </GovTalkDetails>
>
> <Body>
>
> <FormSubmission xsi:schemaLocation="http://xmlgw.companieshouse.gov.uk/
> Header http://xmlgw.companieshouse.gov.uk/v1-0/schema\
> /forms/FormSubmission-v1-1.xsd">
> ......
> <FormHeader>
> <CompanyName>TEST INC COMPANY LTD</CompanyName>
> <PackageReference>1828</PackageReference>
> <FormIdentifier>CompanyIncorporation</FormIdentifier>
> <SubmissionNumber>SUB006</SubmissionNumber>
> </FormHeader>
> </Body>
> </GovTalkMessage>
> END_XML
> uri = URI.parse('http://xmlgw.companieshouse.gov.uk')
> File.read('/home/ignu/sslcert/cacert.pem')
> #connection = Net::HTTP.new(uri.host, uri.port)
> #connection.use_ssl = true
> connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
> uri.path ='/v1-0/xmlgw/Gateway'
> raw_response = connection.post(uri.path, xml_string)
> puts raw_response.body
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to