Expand my Community achievements bar.

Web Service : problem calling it from PDF.

Avatar

Former Community Member
Hi everyone,



I want to make a call to a web service created by SAP/ABAP.

I have the wsdl file and I created a new data connection in the Adbobe designer.



I draged and droped the data connection to the editor : so it created

2 text fields and a button.



The web service waits from the user to enter an input string and it gives back as an answer a string as output...simple, isn't it ?



I also added a button in the designer that points to the connection I created. The button is in mode "execute".



Finally, I saved all this in a PDF file.

When I double click the PDF file, I enter a string as input and press the button....Then I go an error message saying that I should specify username and password. So I changed the mode of the button from "Execute" to "Submit". I added to the URL my username and password because the web service points to a backend which is SAP.

Now I do get another error message which is : Cannot handle content type:text/xml; charset=utf-8.



I read in the doc that maybe I should use XDP ?



Can someone please explane me how to solve the problem.



Thanks in advance for the precious help.



Thanks in advance.



Regards.
4 Replies

Avatar

Former Community Member
The problem is caused by the fact that your web service is returning a content-type header of text/html. The reader product can only handle PDF responses from a web server. In any case, your form data is received OK by the web service; it is just the response back that Acrobat cannot handle.

To get around this, I created a little "thank you for your response" PDF file and put it on my web server. I then set my perl CGI backend script to send a simple redirect to the PDF when it gets a response. (Obviously, you would want to harvest the form values from your user before redirecting). This solved the problem for me.



My little perl script is shown below:



#! /usr/bin/perl



use CGI;



$query = CGI::new(); # invoke a new CGI object for the input



@params = $query->param();

# do something with the values....

print $query->redirect(-uri => 'http://mycompany.com/myapp/cgi-bin/thankyou.pdf');

Avatar

Former Community Member
how to call a PDF file from PDF. Such that a parameter is passed from one file to another. Like help screen in an application.

Avatar

Former Community Member
whitlabell,

Your idea for creating a PDF format confirmation page was right on! It worked like a charm and got rid of the content type error.



Cheers!