XML document in HTTP response

Hello,
I try to write a portal component, that provides an XML document. The component must be reachable via a URL. It generates an XML document from portal content. The generated XML document must be available using the URL.
I tried to solve this by implementing an AbstractPortalComponent iView. Inside the doContent method I write the XML document into the IPortalComponentResponse. The problem is, that the response does not only include the XML document, but the XML data is included inside an HTML document. I already set the EPCFLevel in component-profile to 0. So there is very few JavaScript left inside the HTML document. But I don't want any HTML at all. I want only the pure XML document inside the HTTP response.
Does anybody know a way to make a plain XML document available at an URL?
Thanks, best regards, Oliver

Try something like this in the docontent method
HttpServletResponse resp = request.getServletResponse(true);
resp.setContentType("text/xml");
resp.getOutputStream().write(bytes);

Similar Messages

  • Adobe Document Services - http Response 500 - How to configure the logging?

    We are building an application in Web Dynpro Java that fetches data from an R/3 system via an RFC connection and is then supposed to show said data in a pdf within an iview. For that task we want to use the InteractiveForm UIElement. We bind the data to its pdfSource in the iViewu2019s context. Currently the form only consists of a text field bound to one attribute element of the pdfSource context node.
    The ADS webservice is configured according to the manuals found here:
    http://help.sap.com/saphelp_nw70/helpdata/en/fa/0b700d6cfd4e03a8ec2186ba6ff4af/frameset.htm
    and tested successfully under the following link
    http://<portal_host>:<port>/AdobeDocumentServices/Config?style=document
    However, when we execute the application, an error occurs in the webservice generating the pdf, namely Invalid Content-Type:text/html. The error occurs when the iView containing the form is shown for the first time, even before the attributes of the pdfSource context are filled with data (we expect to see an empty form).
    As it seems the webservice is expected to return a MIME type of either application/pdf or text/xml (we donu2019t know for sure since the SAP manuals and forums are inconclusive here), but instead we get text/html. This seems to be due to the fact that the webservice exits with an http response 500 Internal Server Error (we used several network monitoring tools to confirm that such a response is sent). Since such http responses are but html files with an empty body, yet not xml or pdf, the aforementioned error does make sense to us, but we do not know what Internal Error has caused it.
    The only help that SAP seems to provide for an error u201CInvalid Content-Type:text/htmlu201D in context with ADS points to an expiring password or otherwise poor configuration of the ADSUser, which (most certainly) is not our case here since, and as said above, the configuration was and can be tested successfully.
    We then tried to view the logs for this error on the machine where the J2EE engine is running with ADS installed according to this (not very comprehensible) guide:
    http://help.sap.com/saphelp_nw70/helpdata/de/97/ccfc3f0ac2c642e10000000a1550b0/frameset.htm
    We cannot find anything relevant in the server.log of the Visual Administrator except this message (it is generated exactly when our error occurs u2013 the trace severity is set to ALL for all Adobe application elements according to manual):
    Date , Time , Message , Severity , Category , Location , Application , User
    12/08/2010 , 13:50:46:511 , application [webdynpro/dispatcher] Processing HTTP request to servlet [dispatcher] finished with error.
    The error is: com.sap.tc.webdynpro.clientserver.adobe.pdfdocument.base.core.PDFDocumentRuntimeException: Failed to  GENERATEPDF
    Exception id: [0800274DA7ED00850000005B00000900000496E5919E28BA] , Error , /System/Server/WebRequests , com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl , sap.com/tcwddispwda , Guest
    There is no error.pdf to be found on the file system and since neither have we known nor are we told by the error message, whether the underlying cause is is a render error or connection error or configuration error or what not, we donu2019t know whether the error.pdf is supposed to be generated at all.
    Or could there be any other reason why generation didnu2019t take place?
    Furthermore we canu2019t seem to be able to find any logs more verbose or detailed about this issue - at least not within the Visual Administrator or the portalu2019s nwa.
    How is it possible to properly debug the webservice for pdf-generation or at least to retrieve a fully detailed log containing all notifications and exception stack traces etc.?
    I am assuming that we are making some basic mistakes regarding the logging configuration - but what?
    Our goal is to know what causes the 500 Internal Server Error response that causes the Incorrect Content-Type exception.
    We are using a NetWeaver 7.01 portal installation with Adobe Document Services 7.01 installed on a Windows Server 2003 platform.
    Any help is highly appreciated!
    Serg

    Have you tried restarting the Java PDF object in Visual Administrator?  Once you do all of your config, you have to restart the PDF object (sao.com/tcwdpdfobject) for the changes to take place.  I am assuming you've run all of the test programs in SAP (FP_TEST_00, FP_TEST_03, etc.).  Is there any chance that the ADSUSER is locked somehow?

  • Sending XML documents over HTTP

    Hello,
    I have read a number of similar questions, but they were all posted last year.
    I don't know if a solution was found...
    Here is my problem:
    I have an ASP page using the object XMLHTTP that sends an XML document to another application server using HTTPS, and gets an immediate response.
    Is there an equivalent in the Java world to this feature? I need to transcript my ASP page to JSP.
    I have seen things like HttpServlet, JAXM, SOAPConnection.... But I don't know what that means...
    Thanks for you help.
    Caillou_QC

    URL url = new URL("http://java.sun.com/etc/etc");
         URLConnection connection = url.openConnection();
         connection.setDoOutput(true);
         PrintWriter out = new PrintWriter(
    connection.getOutputStream());
         out.println("string to send");
         out.close();
         BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        connection.getInputStream()));
         String inputLine;
         while ((inputLine = in.readLine()) != null)
         System.out.println(inputLine);
         in.close();

  • Receive XML document as Webservice Response

    Hi
    I have implemented webservices using axis.This works fine.
    But I need an receive the response as an XML document.because for multiple entries of same tag name, i can parse through the document and do what ever i want.
    Also how can i attach an external xsd for a wsdl.
    I am stuck up at these two places,Your help would be appriciated
    Thanks in advance

    Web service is platform independent hence most programming languages should return basic datatypes. In your case easiest thing would be to read that XSD file and convert entire file as String and return it as String. A document object will always throw an error.
    Google to find out datatypes supported.
    Hi Everyone,
    Please let me know if this can be a quick resolution to his problem.

  • Cannot use XML Forms Builder - HTTP response: 500 - Internal Server Error

    Hi,
    I am trying to use XML Forms Builder, have added the corresponding role to my profile and when I create a new application or do anything I get the following error popup:
    HTTP response: 500 - Internal Server Error.
    What should I do ??
    Thank you for your help.
    Thibault Schalck

    Hi,
    Check the below link for environment checking of XML Form Builder
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9e/9c8f411467ac5fe10000000a1550b0/frameset.htm
    Raghu

  • How do I read the XML string using Http response/request?

    When my HTTP POST action is perform, the action will return me a XML string as shown in the link, https://www.neteller.com/gateway/netdirectv4.cfm?amount=150.00&net_account=458415554241&secure_id=896365&bank_acct_num=6789&currency=USD&merchant_id=1234&merch_transid=1102&merch_account=john123&custom_1=test123&custom_2=test123&custom_3=test123&test=1
    The above XML string will be send back by one of the payment gateway.
    How do I retrieve all the attribute name and value from the XML string so that it can be stored in my database?
    The XML string will be as shown below:
    <?xml version="1.0" encoding="ISO-8859-1"?><netdirect version="4.0">
              <approval>yes</approval>
              <amount>150.00</amount>
              <trans_id>403070</trans_id>
              <error>none</error>
              <fee>4.35</fee>
              <time>{ts '2006-06-23 06:14:19'}</time>
              <firstname>Test</firstname>
              <lastname>Test</lastname>
              <email>[email protected]</email>
              <custom_1>test123</custom_1>
              <custom_2>test123</custom_2>
              <custom_3>test123</custom_3>
              <dafee>0.00</dafee>
              <client_currency>USD</client_currency>
              <client_amount>150.00</client_amount>
              <merchant_currency>USD</merchant_currency>
              <merchant_amount>150.00</merchant_amount>
              <fxrate>1.0</fxrate>
              </netdirect>

    How about parsing the XML? Check out JAXP.
    http://java.sun.com/webservices/jaxp/index.jsp

  • Receiving Custom XML Document over AS2 (HTTPS) - Inbound Processing

    Hi All,
    Need help in Receiving Custom XML Document over AS2 (HTTPS) - Inbound Processing
    External Trading Partner will be able to post the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver.
    Here is the process flow:
    1. External Trading Partner will be posting the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver
    2. B2B, consumes the Custom XML validates as per the XSD and process it.
    3. How to send the ACK back to External Trading Partner if it validates successfully and sent it to 'IP_IN_QUEUE'
    4. How to send the ACK back to External Trading Partner if the validation fails after receiving the XML document.
    5. Does the External Trading Partner require any certificates to post the XML Documents to https://<b2bconsolehost>:<b2bconsoleport>/b2b/httpReceiver (no need of encryption/decryption)?
    6. How to enable the B2B server to accept the HTTPS messages from the Trading Partner (no need of encryption/decryption).
    Please let me know. Thanks In Advance.
    Regards,
    Amirineni

    Hi Nandu, Ramesh,
    We have done the set-ups for transmitting a Custom XML Document over HTTP1.1 in B2B.
    Our Business Case is as follows:
    1. Read the Flat File using BPEL File Adapter
    2. Transform the Message in BPEL and send it to B2B
    2. Based on the set-ups in B2B, we need to post the XML message to the folliwng URL:-
    http://databridge.buy.datastream.net:5555/invoke/dsImport/receiveXML
    In the B2B Set-Ups, I have done the following:
    Business Protocol name: Custom Document over Internet
    Exchange Protocol: AS
    Document Protocol: Custom
    Transport Protocol: HTTP-1.1
    Host name : http://databridge.buy.datastream.net
    Port: 5555
    I have also deployed the agreement as well as the configuration. The issue that I am currently facing is when I select the configuration in WSIL browser in JDeveloper, I am getting the following error:
    "Unable to get schema information for target".
    Hence I am not able to map the message in BPEL and send it to B2B.
    Could you please let me know the possible causes and if I am missing anything in the set-ups in B2B.
    As always, your help and guidance is highly appreciated.
    Thanks,
    Dibya

  • Receive HTTP response

    Hi,
    My scenario is idoc->XI-HTTP , im trying to send xml document to HTTP server. currently i'm able to send the document however i'm not able to see to response payload for the request i send. Should i go for BPM? does HTTP adapter always treat request as Asynchronous in XI. I always see the following message in trace. I dont see payload for resposne, even if there is a failure i see only the below message in trace. any help will be greatly appreciated.
    <Trace level="2" type="T">HTTP-Response :</Trace>
      <Trace level="1" type="T">Apple</Trace>
      <Trace level="2" type="T">Code : 200</Trace>
      <Trace level="2" type="T">Reason: Apple</Trace>
    Trace level="3" type="T">Async processing: skip mapping of response</Trace>
    Thanks!
    Ganesh.

    Ganesh, the default behaviour of Idoc adapter is async and therefore the communication would remain EO. For a sync scenario, you must use BPM with the following steps:
    1. Receive
    2. Transform (optional)
    3. Send sync (http)
    4. Transform (optional)
    5. Send async (idoc)
    does HTTP adapter always treat request as Asynchronous in XI.
    The type of communication depends upon sender. Http adapter can be used in both async and sync cases.
    @VJ, Abhishek, Alka - receiver does not determine the QOS of message. It is sender who determines the QOS. So there shouldn't be any such setting in http channel.
    Regards,
    Prateek

  • Send xml file over https - urgent

    Helo everybody.
    I need to solve next problem:
    1. Build/Use a client program that can operate with the HTTPS protocol. There are no restrictions on the type of client program used, providing it can use this protocol and deal with transactions synchronously.
    2. Build/Use a program that can build a valid request XML document and attach it via a POST parameter to a HTTPS request.
    POST /<URL_TO_SUBMISSION_SITE> HTTP/1.0
    Example
    User-Agent: HTTPTool/1.0
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 9999999
    <XML_DOCUMENT> &#1048773;Post Payload
    or
    POST /<URL_TO_SUBMISSION_SITE> HTTP/1.0
    User-Agent: HTTPTool/1.0
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 9999999
    xml=<XML_DOCUMENT>
    3. Ensure the program can retrieve the HTTPS response and parse the returned XML payload.
    4. Ensure the program can correctly interpret the inquiry response information within the XML return.
    Please help me in point 2. I don't know how to attach xml document to https request.
    I'm trying something like this :
    System.setProperty("java.protocol.handler.pkgs",
         "com.sun.net.ssl.internal.www.protocol");
         try {
    url = new URL("https://" + path);
    } catch (MalformedURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    URLConnection con = null;
    try {
    con = url.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setAllowUserInteraction(true);
    con.setRequestProperty("Content-type", "application/x-www-form-urlencoded;charset=Cp1250");
    con.setRequestProperty("Content-Length","9999999");
    } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    but without success. Please help

    Just saw a link, may be this will help you : http://resellers.tucows.com/documentation/xmlhttpspost.pdf

  • Custom XML Document over AS2

    Hi All,
    We are planning to send Custom XML Document over HTTP(AS2) to the Remote Trading Partner. The XML Document needs to be posted to a particular URL in the Remote Trading Partner Site.Here is the process flow:
    1. The input application format file having the messages will be transformed to an XML message in BPEL.
    2. Then as per the set-ups done in B2B, this particular XML message needs to be posted to a URL.
    I went through the B2B User's Guide but could not find any documentation on how to set up Custom XML Document over HTTP(AS2).
    Could you please share the documents/technical notes or link which I can refer to do the set-ups in B2B.
    Please let me know. Thanks In Advance.
    Regards,
    DIbya

    Hi Nandu, Ramesh,
    We have done the set-ups for transmitting a Custom XML Document over HTTP1.1 in B2B.
    Our Business Case is as follows:
    1. Read the Flat File using BPEL File Adapter
    2. Transform the Message in BPEL and send it to B2B
    2. Based on the set-ups in B2B, we need to post the XML message to the folliwng URL:-
    http://databridge.buy.datastream.net:5555/invoke/dsImport/receiveXML
    In the B2B Set-Ups, I have done the following:
    Business Protocol name: Custom Document over Internet
    Exchange Protocol: AS
    Document Protocol: Custom
    Transport Protocol: HTTP-1.1
    Host name : http://databridge.buy.datastream.net
    Port: 5555
    I have also deployed the agreement as well as the configuration. The issue that I am currently facing is when I select the configuration in WSIL browser in JDeveloper, I am getting the following error:
    "Unable to get schema information for target".
    Hence I am not able to map the message in BPEL and send it to B2B.
    Could you please let me know the possible causes and if I am missing anything in the set-ups in B2B.
    As always, your help and guidance is highly appreciated.
    Thanks,
    Dibya

  • Keyword search over XML documents

    there are many open source native XML databases,and search engines that support XQuery and XPath and many of them also support full text search.
    such as:
    1- TPOX
    2- Timber
    3- DBXML
    4 - http://exist.sourceforge.net/kwic.html [http://exist.sourceforge.net/kwic.html]
    5- http://www.inf.uni-konstanz.de/dbis/basex/ [http://www.inf.uni-konstanz.de/dbis/basex/]
    6- http://xqengine.sourceforge.net/ [http://xqengine.sourceforge.net/]
    7- Lucene
    But, could you please tell me what is the alternative open source systems for the following closed systems (XRANK is a Ranked keyword search over XML documents on http://www.cs.cornell.edu/~cbotev/XRank.pdf ) and (XSeek is A Semantic XML Search Engine Using Keywords on http://xseek.asu.edu/xseekdemo.pdf )
    I posted the question on http://stackoverflow.com/questions/2921379/is-there-any-open-source-system-for-keyword-search-on-xml-documents and I have got good information , but I think some people on this forum may have more information.
    thanks.

    Well, there is a workaround to search in the xml. Open xml in FF, open the page source (Ctrl + U) and search in it.

  • How to get the HTTP response body if the body is a malformed XML document

    Hi,
    I am using HTTP service with resultFormat = "e4x" set. What i
    get in response is a malformed XML document in
    some cases. Usually HTTPService throws a FaultEvent with the
    fault detail set to faultCode:Client.CouldNotDecode
    faultString:'Error #1091' or some other Error #1085 and so.
    My client tries to log these errors on the server by using
    another HTTP service again. But i would like to know
    in the client code during run time what exact XML response
    came in the first HTTP response.
    How do i retrieve this information?
    thanks,
    Sunil

    service capture or charles debug proxy can do the job.
    flex builder 4 is rumored to include a traffic sniffer as
    well, but that's next year.

  • How to send te XML data using HTTPS post call & receiving response in ML

    ur present design does the HTTP post for XML data using PL/SQL stored procedure call to a Java program embedded in Oracle database as Oracle Java Stored procedure. The limitation with this is that we are able to do HTTP post; but with HTTPS post; we are not able to achieve because of certificates are not installed on Oracle database.
    we fiond that the certificates need to be installed on Oracle apps server; not on database server. As we have to go ultimately with HTTPS post in Production environment; we are planning to shift this part of program(sending XML through HTTPS post call & receiving response in middle layer-Apps server in this case).
    how i can do this plz give some solution

    If you can make the source app to an HTTP Post to the Oracle XML DB repository, and POST contains a schema based XML document you can use a trigger on the default table to validate the XML that is posted. The return message would need to be managed using a database trigger. You could raise an HTTP error which the source App would trap....

  • TO PARSE XML RESPONSE AFTER SENDING XML DOCUMENT AS URL PARAMETER PROBLEM

    Hi
    I sent the xml document (varchar variable)to the other site (to use URL).
    When I take the xml response from the other site, how can I parse this using pl/sql code? (db version oracle 8.1.7)
    What are the methods?
    Try the following URL by pasting it in browser location box:
    http://testspos.isbank.com.tr/sanalpos/spos.asp?prmstr='&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ePaymentMsgVersionInfo="2.0" TT="Request" RM="Direct" CT="Money"&gt;&lt;OperationActionType="LiveTest"&gt;&lt;OpData&gt;&lt;MerchantInfo MerchantId="200000845966"MerchantPassword="kangurum"/&gt;&lt;ActionInfo&gt;&lt;TrnxCommon TrnxID="'||v_sipno||'"Protocol="156"&gt;&lt;/TrnxCommon&gt;&lt;/ActionInfo&gt;&lt;PANInfo&gt;&lt;/PANInfo&gt;&lt;OrgTrnxInfo&gt;&lt;/OrgTrnxInfo&gt;&lt;CustomData&gt;&lt;/CustoData&gt;&lt;/OpData&gt;&lt;/Operation&gt;&lt;/ePaymentMsg&gt;'
    You will get the response:
    &lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The parameter is incorrect. &lt;/body&gt;&lt;/html&gt;

    Hi
    I sent the xml document (varchar variable)to the other site (to use URL).
    When I take the xml response from the other site, how can I parse this using pl/sql code? (db version oracle 8.1.7)
    What are the methods?
    Try the following URL by pasting it in browser location box:
    http://testspos.isbank.com.tr/sanalpos/spos.asp?prmstr='&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;ePaymentMsgVersionInfo="2.0" TT="Request" RM="Direct" CT="Money"&gt;&lt;OperationActionType="LiveTest"&gt;&lt;OpData&gt;&lt;MerchantInfo MerchantId="200000845966"MerchantPassword="kangurum"/&gt;&lt;ActionInfo&gt;&lt;TrnxCommon TrnxID="'||v_sipno||'"Protocol="156"&gt;&lt;/TrnxCommon&gt;&lt;/ActionInfo&gt;&lt;PANInfo&gt;&lt;/PANInfo&gt;&lt;OrgTrnxInfo&gt;&lt;/OrgTrnxInfo&gt;&lt;CustomData&gt;&lt;/CustoData&gt;&lt;/OpData&gt;&lt;/Operation&gt;&lt;/ePaymentMsg&gt;'
    You will get the response:
    &lt;html&gt;&lt;head&gt;&lt;title&gt;Error&lt;/title&gt;&lt;/head&gt;&lt;body&gt;The parameter is incorrect. &lt;/body&gt;&lt;/html&gt;

  • Error:SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Server was unable to read request. --- There is an error in XML document (1, 447). --- Input string was not in a correct format.

    Hi All,
        We have a scenario of FTP-->PI---> Webservice.  While triggering the data in the FTP, it is failing in the PI with the below error
    SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Server was unable to read request. ---> There is an error in XML document (1, 447). ---> Input string was not in a correct format.
    Can you please help?

    Hi Raja- It seems to be a data quality issue.
    Check for the value @ 1447 position in the xml message that you are trying to send to web service..
    may be a date filed/decimal value which is not in expected format.

Maybe you are looking for

  • Report for Material Cost Estimate

    Hi Everyone, Is there any way that I could download a report from the SAP showing all the material cost estimates? Hope someone could help me. When I try using CK11n, there is no tab there for report downloads and it only shows one material. Thank yo

  • Testing a 1024x768 Folio in PDF format on iPad 2 and iPad 3

    With the same Luminosity level, colors are less saturated on the iPad 3. I prefer the colors on the iPad 2, especially the yellow color of my client's logo ! Also it seems the iPad 3 displays more blues. Quality of inline videos semmes native on the

  • SBH 80 cuts off and poor performance

    Hi I got my SBH 80 through Amazon UK, I was very happy with it till 3 months passed and it started to act funny ! It keeps disconnecting , sound keeps getting garbeled , and while at the gym as soon as I put the phone in my pocket or I am just a few

  • Finding Last friday and Last monday of current date

    Hi Please help me to get the Last friday and Last monday of current date using an sql query. If I am running query on 7th July 2008 ,it should give me Last friday as 07/04/2008 and Last monday as 07/07/2008 I need to compare it with another date file

  • Mass deletion of customer credit cards

    Hi All, I'm trying to write a program to identify credit cards which are either expired or over xxx days old in our system and then delete them.  The issue I have is that my program is very, very slow.  I'm deleting the credit cards by using a record