I am trying to consume a .NET webservice from
http://ws.melissadata.com/dqws/address.asmx
Whenever I call soap.doSingleRecord I receive an error saying that I have an
"Empty XML Request Structure". Looking at the sample SOAP request it
appears
that all the settings I am sending need to be wrapped in <Request> tags.
So
it lookes like I need to build a seperate Request object and then send that
with soap.doSingleRecord(Request)... does anyone have any ideas about how to
make this work? Thanks for any help...
>From the controller:
def update_client_address
@clients = Client.find(:all, :include => "matters", :conditions
=>
["matters.imported_at = ?", $now])
factory
SOAP::WSDLDriverFactory.new("http://ws.melissadata.com/dqws/address.asmx?WSDL")
soap = factory.create_rpc_driver
soap.default_encodingstyle SOAP::EncodingStyle::ASPDotNetHandler::Namespace
for client in @clients
soapResponse = soap.doSingleRecord(:CustomerID => mycustid,
:Action => "Request",
:Timeout => 10,
:Version => "1.0",
:City => client.city,
:State => client.state,
:Zip5 => client.zipcode,
:Address => client.address)
...
soap.reset_stream
end
Sample SOAP request that needs to be received for doSingleRecord:
POST /dqws/address.asmx HTTP/1.1
Host: ws.melissadata.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "urn:mdWebService/doSingleRecord"
<?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>
<doSingleRecord xmlns="urn:mdWebService">
<Request>
<Debug>boolean</Debug>
<pkgMultipleRecords>boolean</pkgMultipleRecords>
<pkgAddressMailing>boolean</pkgAddressMailing>
<pkgAddressParsed>boolean</pkgAddressParsed>
<pkgDeliveryIndicator>boolean</pkgDeliveryIndicator>
<pkgAddressDeliveryPointValidation>boolean</pkgAddressDeliveryPointValidation>
<pkgAddressGeographicArea>boolean</pkgAddressGeographicArea>
<pkgAddressGeoCode>boolean</pkgAddressGeoCode>
<pkgNameParsed>boolean</pkgNameParsed>
<pkgTelephoneNumber>boolean</pkgTelephoneNumber>
<pkgStreetDataAllRecords>boolean</pkgStreetDataAllRecords>
<pkgStreetDataInRangeRecordsOnly>boolean</pkgStreetDataInRangeRecordsOnly>
<pkgZipCodeCitiesInState>boolean</pkgZipCodeCitiesInState>
<pkgZipCodeZipInCity>boolean</pkgZipCodeZipInCity>
<pkgZipCodeInformation>boolean</pkgZipCodeInformation>
<pkgStreetDataOnAddressErrorsOnly>boolean</pkgStreetDataOnAddressErrorsOnly>
<timeout>string</timeout>
<transmissionReference>string</transmissionReference>
<version>string</version>
<action>string</action>
<CustomerID>string</CustomerID>
<Urbanization>string</Urbanization>
<Company>string</Company>
<Address>string</Address>
<Address2>string</Address2>
<Suite>string</Suite>
<City>string</City>
<State>string</State>
<Zip5>string</Zip5>
<Plus4>string</Plus4>
<Country>string</Country>
<Telephone>string</Telephone>
<FullName>string</FullName>
</Request>
</doSingleRecord>
</soap:Body>
</soap:Envelope>
--
View this message in context:
http://www.nabble.com/Need-help-with-SOAP-and-.NET-tf2037203.html#a5606229
Sent from the RubyOnRails Users forum at Nabble.com.