0

I have a client who uses a CRM that allows us to download data in XML format via an API. If I create a URL such as:

http://www.crmwebsiteurl.com/API/service.asmx/APISelect_XML?strCompanyAccount=client_name&strLogin=client_user_name&strPassword=client_password&strSessionID=&strTable=ClientTableName&strFields=ClientField1,ClientField2&strWhereClause=&strGroupByClause=&strHaving=&strOrderBy=

(and yes, all those empty queries/values in the URL must be as they are or the request will fail)

this URL will load an XML document in my browser, with all the content. I can then save that page (which automatically saves as an XML document) and then use Feeds and XML Xpath parser to import the data into Drupal, which all works perfectly.

The trouble is, I want to import the data directly, without having to download and save the XML file to my desktop. I know Feeds has an HTTP Fetcher, but I've tried what seems like every possibly configuration option (which really isn't that many) and I can get it to "successfully" import, but it always says there are no nodes to import (even if I've deleted all my nodes just to be sure). Obviously its not reading the XML file right.

I've seen other ways API's like to be authenticated and some tutorials on how to to those, but this (seemingly) simple authentication method (if a bit insecure) I haven't seen any tutorial on. And if I just use the entire URL (with the query, username, password, etc) in the URL field (Enter a Feed URL), it just always says "There are no new nodes".

I've also played with Feeds Import, Feeds HTTPFetcher AA, Web Service Client - but still haven't seemed to find anything that I've been able to make work.

Is this a unique situation? Or most likely I'm simply doing something wrong? Is there a tutorial I didn't come across that could help me?

  • most likely doing something wrong I think so. Are you using Feeds Xpath Parser? – No Sssweat Jan 5 '17 at 2:08
  • From the Feeds Xpath Parser module page: New installs should use Feeds extensible parsers, which is what I'm using - but yea, I'm probably doing something wrong still ;-) – Eric Wenger Jan 5 '17 at 14:21
  • Can u post the XML code and ur parser setup. That is probably what is wrong. – No Sssweat Jan 5 '17 at 14:56
  • Well, like I said, I can import the XML file perfectly (my parser and XML are fine) - I think my challenge is in the HTTP Fetcher settings (or else I need to install another Fetcher, like Web Services or ???) – Eric Wenger Jan 5 '17 at 15:31
0

You need todo more debugging. As 1 possible debugging example use Chrome Inspector to assure that properly configured, Feeds is requesting the correct URL to get the XML payload. you can do this by logging HTTP persistently before you hit the drupal admin page and recording what Feeds is issuing.

Compare that to hitting the URL by hand in the browser, or whatever steps you take. I suspect that Feeds has an API to alter the outbound request to the remote server and make it 1:1 with hitting the remote url by hand.

There are other HTTP session records you can use depending on your OS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.