IBM WebSphere DataPower Community Forum IBM Webspere DataPower XI50
October 12, 2008, 02:10:34 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: IBM WebSphere DataPower SOA Appliance Forum - Just Launched come share your knowledge!!! These forums will be a great place to build a community. This site is not associated with IBM.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: No response from url-open  (Read 560 times)
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« on: January 29, 2008, 03:12:46 PM »

I am using url-open to ftp an incoming base-64 encoded pdf file to drop into an external ftp server.

The ftp process works fine.

Now I want to add some reliability to the process by handling errors and taking corrective actions in case of failures. Datapower documentation on url-open  mentions the use of response="xml" attribute to get the response attributes from url-open. Somehow, the ftp server that I am using is sending an empty response for the url-open, although the file transfer is successul.

How do we make sure we get a response? Can we atleast get an error code from the ftp server? I checked the global and local variables after the ftp, but didnt find anything that would help.

Any help would be appreciated. Thanks!!!

Here is the log.

FTP Client: reached done state
FTP Client: closing
FTP Client: FTP Client: reply code 221 in state 'QUIT'. Reply text: ' Goodbye.'
FTP Client: command 'QUIT' sent
FTP Client: FTP Client: reply code 213 in state 'SIZE'. Reply text: ' 58284'
FTP Client: command 'SIZE L9_JoePDF.dat' sent
FTP Client: FTP Client: reply code 226 in state 'Data Transfer'. Reply text: ' Transfer complete.'
FTP Client: FTP Client: reply code 150 in state 'STOR'. Reply text: ' Opening data connection for L9_JoePDF.dat.'
FTP Client: command 'STOR L9_JoePDF.dat' sent
FTP Client: opening data connection to 162.134.114.174 port 41248
Logged
LordB
Administrator
Newbie
*****
Offline Offline

Posts: 45


View Profile
« Reply #1 on: January 29, 2008, 03:45:16 PM »

can you post your xslt to url open the file...

Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #2 on: January 29, 2008, 03:47:45 PM »

      <xsl:variable name="ftpResponse">
      <FTP>
         <RESPONSE>
      <dp:url-open target="{$ftpCommand}" response="ignore" data-type="base64">
         <xsl:value-of select="$encodeElement"/>
      </dp:url-open>
         </RESPONSE>
      </FTP>
      </xsl:variable>   


The value of ftpComamnd is in the format

ftp://user:password@host:21/

Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #3 on: January 29, 2008, 03:49:50 PM »

Here is the error when it tries to parse the response...


xmlfirewall (fwEFAX-FTPRouter): url-open: Error parsing response from ftp://user:password@host:21/
xmlfirewall (fwEFAX-FTPRouter): Incomplete markup or missing document element at offset 0 of ftp://user:password@host:21/

Note: The URL has been changed for security reasons.

Thanks for your help!
Logged
LordB
Administrator
Newbie
*****
Offline Offline

Posts: 45


View Profile
« Reply #4 on: January 29, 2008, 03:53:19 PM »

your response is set to ignore. does it work like that? I think what you are looking for is setting your response to responsecode... from the manual

When the response attribute is set to responsecode, all successful FTP transactions
return the following element:
<url-open/>
When the response attribute is set to responsecode, all failed FTP transactions return
the following element:
<url-open>
<statuscode>n</statuscode>
</url-open>

Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #5 on: January 29, 2008, 03:54:04 PM »

FYI

During testing, i changed the response attribute back to ignore. But it was xml, during my original testing.

Thanks,
Sinu
Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #6 on: January 29, 2008, 03:59:55 PM »

Now i am getting the xml shown below as the response.
It actually throws an error message indicating that it cannot parse the response. How do we get success/failure codes...like a 200 if it is successful or something else if its a failure. Like for this one, I have no way of knowing if the file made it to the ftp server.



<?xml version="1.0" encoding="UTF-8"?>
<FTP xmlns:date="http://exslt.org/dates-and-times" xmlns:soap="http://schemas.xm
lsoap.org/soap/envelope/"><RESPONSE><url-open><errorcode>196609</errorcode><erro
rstring>Incomplete markup or missing document element at offset 0 of ftp://user:password@host:21/</errorstring><
/url-open></RESPONSE></FTP>
Logged
LordB
Administrator
Newbie
*****
Offline Offline

Posts: 45


View Profile
« Reply #7 on: January 29, 2008, 04:32:09 PM »

try adding resolve-mode="ignore"
Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #8 on: January 29, 2008, 04:40:02 PM »

Actually i tried using response="responsecode-ignore" which is equivalent to the option you gave...
So now, if there is nothing, it wouldnt try to parse.
But we still have the problem of getting a success code "200" from the ftp server.

After changing it to response="responsecode-ignore" i also tried to give an incorrect host name, and it came back with

<?xml version="1.0" encoding="UTF-8"?>
<FTP xmlns:date="http://exslt.org/dates-and-times" xmlns:soap="http://schemas.xm
lsoap.org/soap/envelope/"><RESPONSE><url-open><statuscode>6</statuscode></url-op
en></RESPONSE></FTP>

I have no idea, what 6 means in terms of status code.
If there is a list somewhere about these codes returned from url-open, life would be easy. Smiley

Appreciate your help in getting this resolved.
Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #9 on: January 29, 2008, 05:14:25 PM »

I was using an out-dated version of extension functions document. Now I got hold of the latest one (3.6.1) and it says that if its successful for ftp, then the response will have just one node <url-open/> and if it has some error, then it will come back with an error code.

I found that it returns 6 for incorrect host name
and 18 for incorrect password.

But I am not sure where all these status codes are defined.

For the above testing I used response="responsecode-ignore"
Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #10 on: January 30, 2008, 03:56:42 PM »

I have created a PMR with IBM on this issue and have asked them to provide an index of these status codes. Appreciate all your help with this.

Regards,
Sinu
Logged
LordB
Administrator
Newbie
*****
Offline Offline

Posts: 45


View Profile
« Reply #11 on: January 30, 2008, 04:02:03 PM »

If you get the list if you could post it here I would appreciate it.

Thanks
Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #12 on: January 30, 2008, 04:07:41 PM »

Will do. Thanks.
Logged
sinusekhar
Newbie
*
Offline Offline

Posts: 20


sekhar_sinu
View Profile WWW Email
« Reply #13 on: March 04, 2008, 04:05:51 PM »

IBM doesnt have this information and they have added my PMR as an enhancement request.
I did my own testing and here are my findings. This is not an extensive list, but does have the most common ones.

6 - Invalid Host
18 - Invalid username/password
5  invalid port
4 - invalid path
19 - network routing problem

Cheers!
Sinu
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  



Powered by SMF | SMF © 2006-2007, Simple Machines LLC
Seo4Smf © Webmaster's Talks
This Site is not associated with IBM