In wadl2java-generated code, NullPointerException from HttpTransportPipe

I wrote a WADL document and used JAXB schemagen to create an XSD for my Jersey RESTful web-service, and referenced that XSD in that WADL document.
Then, I used wadl2java to generate client-code for my service.
However, then, I had numerous jar-dependency problems while trying to run that generated code. Perhaps I got myself into some trouble by choosing the wrong jar-file in one case or another. I thought it was odd that one of the missing class-files was SOAPException. Another one is part of FastInfoSet. And one of the problems seemed to require adding a JSR-related jar provided by BEA.
I managed to find some possibly relevant source-code. However, it seems to simply indicate no need for an outputStream for a GET-request, which makes lots of sense:
From HttpClientTransport:
118:            public OutputStream getOutput() {
119:                try {
120:                    createHttpConnection();
121:                    sendCookieAsNeeded();
122:                    // for "GET" request no need to get outputStream
123:                    if (requiresOutputStream()) {At this point, I'm not able to use wadl2java, thanks to this failure to get this generated client-code running. I'd like to avoid writing custom client-code instead. I'd sooner revert to SOAP and wsdl2java.
Any help with this would be much appreciated.
Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.NullPointerException
     at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:157)
     at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:74)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:559)
     at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:518)
     at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:503)
     at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:400)
     at com.sun.xml.ws.client.Stub.process(Stub.java:228)
     at com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:167)
     at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:193)
     at com.sun.research.ws.wadl.util.JAXBDispatcher.doGET(JAXBDispatcher.java:92)
     at com.foo.bar.restapi.client.Endpoint$Product.getAsProduct(Endpoint.java:66)
     at com.foo.bar.restapi.client.Test.main(Test.java:9)
Caused by: java.lang.NullPointerException
     at java.io.Writer.<init>(Unknown Source)
     at java.io.OutputStreamWriter.<init>(Unknown Source)
     at com.bea.xml.stream.XMLOutputFactoryBase.createXMLStreamWriter(XMLOutputFactoryBase.java:45)
     at com.sun.xml.ws.api.streaming.XMLStreamWriterFactory$Default.doCreate(XMLStreamWriterFactory.java:204)
     at com.sun.xml.ws.api.streaming.XMLStreamWriterFactory$Default.doCreate(XMLStreamWriterFactory.java:199)
     at com.sun.xml.ws.api.streaming.XMLStreamWriterFactory.create(XMLStreamWriterFactory.java:152)
     at com.sun.xml.ws.encoding.xml.XMLCodec.encode(XMLCodec.java:35)
     at com.sun.xml.ws.encoding.MimeCodec.encode(MimeCodec.java:64)
     at com.sun.xml.ws.encoding.XMLHTTPBindingCodec.encode(XMLHTTPBindingCodec.java:173)
     at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:128)
     ... 11 more

Thanks, that solved that problem.
Then, however, I had a couple of other problems, having to do with namespace declarations. I've apparently fixed them.
The one remaining problem is that the generated code seems to treat a certain template parameter as if it were a header-parameter. The WADL-file definitely uses style="template" for that parameter.
I temporarily manually patched the generated EndPoint class to get it working.
The effect of this problem was that the result was in the form of the HTML-message returned by Apache when a resource cannot be found. That was because that template parameter was missing and was being passed instead in a header.
Perhaps I'll investigate this further at some point. However, "time's a wastin'", and reverting to SOAP is now quite likely.
Thanks.

Similar Messages

  • Generated Code different from OWB Client and Deployment Manager....

    Hi,
    I developed the mappings using OWB9.2 and generated the code.
    But when same mapping is used to generated code from deployment manager it is having extra code like WB_RT% procedures/functions.
    Why this is happening, does any body have idea on this.
    Please let me know.
    With Regards,
    Kranthi..

    When you generate code from within your mapping, you'll get clean sql. But when you deploy your mapping and create package the code will contain more than just sql used for loading your tables, like control procedures etc. based on your mapping configuration, table loading options etc.
    If you create mapping that will load table using TRUNCATE/INSERT option and generate code you will see only INERT INTO code, but when you deploy your mapping the code will include TRUNCATE TABLE code.

  • NullPointerException from generated code? (WLS81SP2)

    We are receiving an NPE, and looks like it is coming from
    the generated code. Most oddly, it is intermittent; repeating the operation that causes the error often succeeds. Any thoughts? Here is the stack trace:
    2005-09-12 17:21:31.273 | payprocess.ProcessBatch:process | EJB Exception: ; nested exception is:
         javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: java.lang.NullPointerException
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
         javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: java.lang.NullPointerException
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at org.ecmc.nib.batch.session.PaymentProcessFacade_blomzu_EOImpl_812_WLStub.processPayments(Unknown Source)
         at org.ecmc.nib.batch.payprocess.ProcessPaymentsHelper.queryFredTransPosted(ProcessPaymentsHelper.java:72)
         at org.ecmc.nib.batch.payprocess.ProcessBatch.checkForPayments(ProcessBatch.java:206)
         at org.ecmc.nib.batch.payprocess.ProcessBatch.process(ProcessBatch.java:133)
         at org.ecmc.common.batch.AbstractBatchJob.startBatch(AbstractBatchJob.java:40)
         at org.ecmc.nib.batch.payprocess.ProcessPayments.main(ProcessPayments.java:71)
    Caused by: javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: java.lang.NullPointerException
         at weblogic.ejb20.internal.EJBRuntimeUtils.throwTransactionRolledbackLocal(EJBRuntimeUtils.java:248)
         at weblogic.ejb20.internal.BaseEJBLocalHome.handleSystemException(BaseEJBLocalHome.java:247)
         at weblogic.ejb20.internal.BaseEJBLocalObject.postInvoke(BaseEJBLocalObject.java:327)
         at org.ecmc.nib.batch.session.RouterFacade_s27p4a_ELOImpl.route(RouterFacade_s27p4a_ELOImpl.java:57)
         at org.ecmc.nib.batch.session.PaymentProcessFacadeBean.processPayments(PaymentProcessFacadeBean.java:38)
         at org.ecmc.nib.batch.session.PaymentProcessFacade_blomzu_EOImpl.processPayments(PaymentProcessFacade_blomzu_EOImpl.java:46)
         at org.ecmc.nib.batch.session.PaymentProcessFacade_blomzu_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Oops, sorry about that, grabbed the stack trace from the wrong spot; the correct trace is below:
    ####<Sep 12, 2005 5:21:31 PM CDT> <Info> <EJB> <wlsprd2.ecmc.lan> <ms1> <ExecuteThread: '20' for queue: 'weblogic.kernel.Default'> <PMT_PROCESS> <BEA1-593B17F9A1A85E2AA270> <BEA-010051> <EJB Exception occurred during invocation from home: org.ecmc.nib.model.LoanCancelFacade_fy2xso_HomeImpl@184a0b7 threw exception: java.lang.NullPointerException
    java.lang.NullPointerException
    >
    ####<Sep 12, 2005 5:21:31 PM CDT> <Info> <EJB> <wlsprd2.ecmc.lan> <ms1> <ExecuteThread: '20' for queue: 'weblogic.kernel.Default'> <PMT_PROCESS> <BEA1-593B17F9A1A85E2AA270> <BEA-010051> <EJB Exception occurred during invocation from home: [email protected]89 threw exception: javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: java.lang.NullPointerException
    javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: java.lang.NullPointerException
    java.lang.NullPointerException
    javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested exception is: java.lang.NullPointerException
         at weblogic.ejb20.internal.EJBRuntimeUtils.throwTransactionRolledbackLocal(EJBRuntimeUtils.java:248)
         at weblogic.ejb20.internal.BaseEJBLocalHome.handleSystemException(BaseEJBLocalHome.java:247)
         at weblogic.ejb20.internal.BaseEJBLocalObject.postInvoke(BaseEJBLocalObject.java:327)
         at org.ecmc.nib.model.LoanCancelFacade_fy2xso_ELOImpl.localGetLoanPlacementStatusTypCd(LoanCancelFacade_fy2xso_ELOImpl.java:228)
         at org.ecmc.nib.batch.session.payprocess.CheckLoanBalance.update(CheckLoanBalance.java:40)
         at org.ecmc.nib.batch.session.payprocess.RouteToMethods$RouteMeQueryHandler.processStep(RouteToMethods.java:240)
         at org.ecmc.nib.batch.session.payprocess.RouteToMethods$RouteMeQueryHandler.processRow(RouteToMethods.java:111)
         at org.springframework.jdbc.core.JdbcTemplate$RowCallbackHandlerResultSetExtractor.extractData(JdbcTemplate.java:939)
         at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:256)
         at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:204)
         at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:266)
         at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:270)
         at org.ecmc.nib.batch.session.payprocess.RouteToMethods.routeMe(RouteToMethods.java:62)
         at org.ecmc.nib.batch.session.RouterFacadeBean.route(RouterFacadeBean.java:35)
         at org.ecmc.nib.batch.session.RouterFacade_s27p4a_ELOImpl.route(RouterFacade_s27p4a_ELOImpl.java:46)
         at org.ecmc.nib.batch.session.PaymentProcessFacadeBean.processPayments(PaymentProcessFacadeBean.java:38)
         at org.ecmc.nib.batch.session.PaymentProcessFacade_blomzu_EOImpl.processPayments(PaymentProcessFacade_blomzu_EOImpl.java:46)
         at org.ecmc.nib.batch.session.PaymentProcessFacade_blomzu_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

  • Error while deploying generated code from sup to iPhone

    Hi
    I generated the code using Sap unwired platform for Objective-c.  I followed the steps specified in the below link
    http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01213.0153/doc/html/mqu1264543829068.html
    for deploying the generated code into iPhone simulator, i am getting the following error
    Undefined symbols:
      "_OBJC_CLASS_$_SUPEntityAlias", referenced from:
          objc-class-ref-to-SUPEntityAlias in SUP101_Customer.o
          objc-class-ref-to-SUPEntityAlias in SUP101_LogRecordImpl.o
    Can any one help me in this
    Edited by: KiranSanka on Dec 2, 2010 1:18 PM
    Edited by: KiranSanka on Dec 3, 2010 7:26 AM

    Hi
    While compiling did you get a warning? something along the line "missing required architecture i386 in fileu201D? if so refer this link http://stackoverflow.com/questions/1456185/build-error-missing-required-architecture-i386-in-file
    Regards
    Jinesh

  • How to Read and Generate XML file from java code.

    hi guys,
    how to read the xml file (Condition :we know only DTD or Shema only).
    How to Generate the new xml file ?(using Shema )
    And one more how directly Generate the xml from DB?
    Pleas with code or any URL

    Using XMLbeans you can generate Java objects from an XSD schema (perhaps DTDs aswell)
    Then you can create an instance of the Document object and ask it to write itself.
    This will create an XML document complient to the schema.
    XMLBeans generates a "type" safe DOM where you can only ever have a structure compilent to you schema.
    matfud

  • How to use generated code from "Import Web Services" with Cairngorm Framework

    I recently downloaded Flex Builder 3 beta 2 and tried out the
    wizard that lets you import web services. The code that is
    auto-generated makes if fairly straight forward to consume web
    services using the object types defined in the WSDL. No longer does
    the developer need to decode the XML payload! The only problem I am
    having is how does you integrate the auto- generated code with the
    Cairngorm framework? This seems like a huge question for anyone who
    might want to leverage Cairngorm and the auto-generated proxy code
    in the same project (like me).
    Here are the problems that I see so far.
    1) How do you configure the generated service class to work
    with the Cairngorm service locator? The service constructor only
    accepts a “LCDS destination string” which implies that
    you must use Lifecycle data services. Unfortunately, the project I
    am trying to retrofit currently uses a WebService and does not use
    data services. All I really need to do is change the endpoint URL
    (ie from local to a development server). This issue is noted in the
    bug https://bugs.adobe.com/jira/browse/FB-8456. What I think is
    needed is a way to set the endpointURI in the Services.mxml file.
    2) Even if I come up with a hack around #1, I do not receive
    a callback to my IResponder even though I register it immediately
    after the method call. I can register and listener function within
    my business delegate and receive the callback, but my Command
    object, which implements IResponder, does not receive the call back
    even though it is registered. From what I read in the ASDocs it
    should but it doesn’t for me!
    These are the issues I have observed in 3 hours of messing
    with this. I hope this makes sense. I would love to integrate
    auto-generated web service proxies into Cairngorm but I don’t
    see a straight forward way without re-architecting Cairngorm. Has
    any one else run across this issue? If so, do you have any insights
    on how to proceed? Any help is appreciated.

    Since I posted this question, I have abandoned the notion of
    auto-generated web services and embraced the good old FDS concept
    where the RemoteObject meta-tag does all the conversion work for
    me. We are now using the Granite DS package and it is working well
    for us. I would love to consume web services, but it just isn't
    worth the hassle when all you have to do with Granite (and FDS) is
    cast your return objects to the proper object type.
    BTW, since this posting, I have investigated competing Flex
    app frameworks. After my research, I checked out the PureMVC
    framework. Wow!! Cairngorm always left me with an uneasy feeling
    and I guess I am not alone. Apparently, Cliff Hall felt the same
    way. That is why he started the project. I like his approach alot
    more than Cairngorm especially since it includes notifications
    which allow me to broadcast my own app level events independent
    from the AS Event framework. Check out PureMVC. For what it is
    worth, it has my humble endorsement. Cliff was even gracious enough
    to acknowledge the other Adobe Consulting guys for their work. Good
    for you Cliff, I respect that. Check out a better way at
    http://www.puremvc.org/

  • Hi I need this asap... "Java code to generate XML File from XML Schema"

    Hi all....
    I need this asap... "Java code to generate XML File from XML Schema i.e XML Schema Definition, XSD file".
    Thankz in advance...
    PS: I already posted in the afternoon... this is the second posting.

    take look at :
    http://sourceforge.net/projects/jaxme/
    this might help...

  • Java code to generate XML File from XML Schema

    Hi I need this asap... "Java code to generate XML File from XML Schema i.e XML Schema Definition, XSD file".
    Thankz in advance...

    JAXB has been available as an early release download for some time. There are also XML Binding packages available from Borland (JBuilder) and Castor. These tools create Java classes from a source document, xml,dtd etc. You can use these classes to marshal-unmarshal XML documents.
    Dave

  • Can't generate code from class diagram

    I have installed Studio Enterprise 8. I tried to create a class, but when I right-clicked on a class, there was no "Generate Code" on the contextual menu.
    I've tried the Help guide as pasted below. Would appreciate anybody's help. Thanks.
    To generate code:
    In the Projects window or in a diagram, right-click the element or elements for which you want to generate code.
    In the Projects window, this code generation function is supported for entire UML projects and for individual diagram elements.
    On the contextual menu, choose Generate Code. The IDE generates source code for all of the target items and displays the code in the Source Editor.

    Thanks, but I still have problem.
    File / New Project
    UML / Java Platform Model
    Name: UMLTest Location: D:\UML Unchecked Generate Code
    The UMLTest Project appears in the Project Window
    --- So far so good
    File / New Project
    General / Java Application
    --- There is no General category
    Under Category: Samples, Standard, UML, Web
    Under Samples, there is general, but project = Anagram Game.
    I still can't create a Java application from scratch.
    Using Web and Standard, I must provide ANT

  • Accessing connection from java and generated code

    In JDeveloper 10.1.2.x I set up a connection and selected a stored procedure and generated java to call the stored proc. All good.
    Now, in a web service application I want to call the method in that class that was generated.
    So, the generated class has setConnectionContext(), getConnectionContext(), etc methods. I don't know how to use them. What is a ConnectionContext?
    How do I provide the database connection information and call the method in the generated code that I need?
    My Oracle AS server has a datasource configured that is the one I would like to use, but I don't know how to 'access' it via java in the context of this generated class.
    I am deploying to Oracle AS 10.1.2,
    thanks

    Hi, well CSV is not currently an Excel file, it is a Comma Separated Values
    file which can be read through Excel.
    Now, if you wish to remove the header, I would purpose that you develop an
    application that reads the CSV file, as it is mere text, and that it also reads
    another file (lets call it confirguration.txt) in which you determine the pattern
    you want to remove, then you just read your report and if a string line
    matches the pattern you defined in the configuration.txt file, then you simply
    erase it.
    And if you keep interested in reading real Excel files (xls), I would
    recommend you use POI-HSSF API from Apache.org
    http://jakarta.apache.org/poi/hssf/index.html
    Hope this helps, cya around.

  • How to generate Flow Chart from Program Source Code easily and automatically.

    It is very crucial to have a clear mind when faced with abstract codes for software engineers and program developers. As always, the programmers have had an overall structure in your mind and then process the design with source code.  The structure can somehow be so complex that it becomes hard to cope with gradually. More often than not, you will get stuck when you process to some extent. However, codes can’t speak and present themselves in a straightforward way. You are eager to find out a straightforward layout to transfer those abstract codes to visible flowchart, aren’t you? Do you know there's code to flowchart software tools online? This tool can help you make a flowchart from source code automatically, here I will introduce you a great code to flowchart converter software.
    Code Flowchart Creator is professional source code to flowchart software tool. This software is designed for programmers or document writers, and its main function is to generate flow chart from source code such as C, C++, VC++ (Visual C++ .NET) and Delphi (Object Pascal) programming files. It helps users to understand complex program structures by visual diagrams. When users are editing the source code, it can make a flowchart or NS chart according to that code, the source code will be analyzed to build a visible flowchart that can help users get familiar with the process of the program.  The created flowchart can be exported as Visio/Word/BMP files. And it works well on all Windows OS, especially on Windows 7.
    Below is simple guide on how to use the Flowchart Converter. Step 1: Free download the setup file on official website: http://www.flowchart-creator.com Step 2: Install it on PC and startup the Flowchart Creator Step 3: Open a source code file and it will automatically generate the Flow Chart on right Window. Actually, the Flowchart Creator is very easy to use even without any experience. If you want to get more details and advanced setting, please visit the website to get tech info and support.         Moreover, it also provides users with browsing and navigation functions. Those functions will facilitate the process of programmer and come to great help to both senior and junior programmers. The generated flowchart can be used to review source code. It will help examine the whole process of a program and check where errors exist when users are verifying source codes. You will never be worried about the complex program structure with the powerful code to flowchart creator tool.

    Dear Chuck,
    I have used Google and other search engines intensively since years. What I need (and this is why I've opened this thread actually) is a suggestion for a product from someone that has already used it. That could also save me time instead of searching, installing, trying, and eventually deinstalling at random. After all, the forum should allow to exchange knowledge and experience with people having similar interests.

  • Generating Code with NetBeans

    I'm using NetBeans IDE 6.1 UML editor to generate java code. When I choose the "Generate Code" option and select the options I want. The console shows the message:
    Generating source from template "Java/CompilationUnit.java" ...ERROR: java.lang.NullPointerException
    How do I find where the Null Pointer Exception is being thrown?

    Rick.Lohmeyer wrote:
    I'm using NetBeans IDE 6.1 UML editor to generate java code. When I choose the "Generate Code" option and select the options I want. The console shows the message:
    Generating source from template "Java/CompilationUnit.java" ...ERROR: java.lang.NullPointerException
    How do I find where the Null Pointer Exception is being thrown?You go over to the NetBeans forum and ask them the same questions, since this is not a Java question, but a IDE specific question. Also if you are not a fairly seasoned programmer, then may I happily wish you cheers with all the frustration and grief that inevitably awaits you in your autocoding endeavors.

  • OWB Error while generating Code for a mapping

    I have a simple mapping loading from a source to a flat file. When I try to generate code it gives me the following Error
    VLD-2357: Target Data File name not specified for file <target Flat file name>.
    I am new to OWB so any help on the same will be greatly appreciated. How can I specify target Data File name in the mapping configuration under Flat file operators
    Thanks
    Anish

    If you configure the mapping in the UI from the main design tree and select the name of your file operator under the tree node 'Flat File Operators' on the right hand side panel the properties should be displayed - one of these properties is 'Target Data File Name', enter the name of your target data file name.
    Cheers
    David

  • Generating a report from RTF template using WSDL from ADF

    Hi,
    I am a newbie to ADF-BIP integration.
    I am using the wsdl http://<<ip>>:<<port>>/xmlpserver/services/PublicReportService?WSDL for generating a report from RTF Template in ADF.
    We are using Oracle Business Intelligence Publisher Release 11g (11.1.1) and JDeveloper 11g (11.1.1.5.0).
    I have a couple of merge variables in my RTF template and I am passing these variable using Report Request parameters.
    below is code I added for creating the report request.
    First I created publicReportService using webservice proxy.
        public static ReportRequest getReportRequestFromBIPWithTemplate(String reportFolderOnBIP,
                                                            String reportName,
                                                            String outputFileFormat,
                                                            String template,
                                                            HashMap params) {
          String reportAbsolutePath = reportFolderOnBIP + "/" + reportName + ".xdo";
          ReportRequest repRequest = new ReportRequest();
          System.out.println("report path:  " + reportAbsolutePath);
          repRequest.setReportAbsolutePath(reportAbsolutePath);
          repRequest.setAttributeTemplate(template);
          repRequest.setAttributeFormat(outputFileFormat);
          repRequest.setAttributeLocale("en-US");
          repRequest.setSizeOfDataChunkDownload(-1);
          System.out.println(params.size());
          ParamNameValue[] paramNameValue = new ParamNameValue[params.size()];
          ArrayOfParamNameValue arrayOfparamNameValue = new ArrayOfParamNameValue();
          Set set = params.entrySet();
          Iterator iter = set.iterator();
          int i = 0;
          while (iter.hasNext()) {
            Map.Entry me = (Map.Entry)iter.next();
            System.out.println(i + "--->>>" + me.getKey() + " : " + me.getValue());
            paramNameValue[i] = new ParamNameValue();
            paramNameValue.setMultiValuesAllowed(false);
    ArrayOfString values = new ArrayOfString();
    if (me.getValue() == null) {
    values.getItem().add("");
    } else {
    values.getItem().add((me.getValue()).toString());
    paramNameValue[i].setValues(values);
    paramNameValue[i].setName((me.getKey()).toString());
    arrayOfparamNameValue.getItem().add(paramNameValue[i]);
    i++;
    repRequest.setParameterNameValues(arrayOfparamNameValue);
    return repRequest;
    I generated report response bytes using below code
    {code:java}
    repRes = publicReportService.runReport(repReq,userID,password);
    reportStream = repRes.getReportBytes();I could see the generated PDF but the supplied variables are NOT reflected in place of merge variables.
    Ex: In template
    Welcome, <<merge variable, userName>>
    {code}
    Generated PDF should have
    {code:java}
    Welcome, Hello World
    {code}
    Instead of the above I am getting
    {code:java}
    Welcome,
    {code}
    I am looking for a suggestion, Please help me in this regard.
    Thanks,
    Satya
    Edited by: 921138 on May 30, 2012 11:11 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Please let me know if any one has update for this.
    Thanks in advance,
    Satya

  • Generate a url from a report or function module

    Hi,
    I'm trying to generate a url from a report and tried using the function module WWW_ITAB_TO_HTML in the report program, as , but i'm not able to get the expected results. The code is given below. Could someone please try and help me resolve this issue. Thanks in advance.
    DATA: emp_name TYPE char80.
    DATA: it_itabex TYPE zdb_ex_tty,
    it_emp TYPE TABLE OF zis_emp,
    it_org TYPE TABLE OF zis_org,
    it_pos TYPE TABLE OF zis_pos,
    it_pos_alloc TYPE TABLE OF zis_pos_alloc,
    it_res TYPE TABLE OF zis_res,
    it_res_alloc TYPE TABLE OF zis_res_alloc,
    ls_itabex TYPE zdb_ex_s.
    DATA: lv_filename TYPE string,
    lv_path TYPE string,
    lv_fullpath TYPE string,
    lv_replace TYPE i.
    DATA qstring LIKE it_itabex OCCURS 10.
    DATA: url(200), url2(200), url3(200), fullurl(200).
    FIELD-SYMBOLS: <fs_emp> LIKE LINE OF it_emp,
    <fs_org> LIKE LINE OF it_org,
    <fs_pos> LIKE LINE OF it_pos,
    <fs_pos_alloc> LIKE LINE OF it_pos_alloc,
    <fs_res> LIKE LINE OF it_res,
    <fs_res_alloc> LIKE LINE OF it_res_alloc.
    ** Report Program to export data from database to Excel.
    ** Populate all the tables that have to be exported.
    SELECT * FROM zis_org INTO TABLE it_org.
    SELECT * FROM zis_pos INTO TABLE it_pos.
    SELECT * FROM zis_pos_alloc INTO TABLE it_pos_alloc.
    SELECT * FROM zis_emp INTO TABLE it_emp.
    SELECT * FROM zis_res_alloc INTO TABLE it_res_alloc.
    SELECT * FROM zis_res INTO TABLE it_res.
    ** Append the Column Header
    CLEAR ls_itabex.
    ls_itabex-ipp_pos_id = 'IPP Pos ID'.
    ls_itabex-emp_name = 'Name'.
    ls_itabex-dt_of_join = 'JoinedOn'.
    ls_itabex-emp_status = 'Status'.
    ls_itabex-org_name = 'Org'.
    ls_itabex-prj_name = 'Project'.
    ls_itabex-mgr_name = 'Line'.
    ls_itabex-designation = 'Designation'.
    ls_itabex-specialization = 'Specialization'.
    APPEND ls_itabex TO it_itabex.
    ** Append all the tables into one internal table
    LOOP AT it_pos_alloc ASSIGNING <fs_pos_alloc>.
    CLEAR ls_itabex.
    ls_itabex-ipp_pos_id = <fs_pos_alloc>-ipp_pos_id.
    READ TABLE it_emp ASSIGNING <fs_emp> WITH KEY emp_guid = <fs_pos_alloc>-emp_guid.
    IF sy-subrc = 0.
    CONCATENATE <fs_emp>-emp_fname <fs_emp>-emp_lname INTO ls_itabex-emp_name SEPARATED BY space.
    ls_itabex-dt_of_join = <fs_emp>-dt_of_join.
    ls_itabex-emp_status = <fs_emp>-emp_status.
    ls_itabex-specialization = <fs_emp>-specialization.
    ENDIF.
    READ TABLE it_pos ASSIGNING <fs_pos> WITH KEY ipp_pos_id = <fs_pos_alloc>-ipp_pos_id.
    IF sy-subrc = 0.
    ls_itabex-designation = <fs_pos>-designation.
    READ TABLE it_org ASSIGNING <fs_org> WITH KEY org_id = <fs_pos>-org_id.
    IF sy-subrc = 0.
    ls_itabex-org_name = <fs_org>-org_name.
    ls_itabex-mgr_name = <fs_org>-mgr_name.
    ENDIF.
    ENDIF.
    READ TABLE it_res ASSIGNING <fs_res> WITH KEY org_id = <fs_org>-org_id.
    ls_itabex-org_name = <fs_org>-org_name.
    APPEND ls_itabex TO it_itabex.
    ENDLOOP.
    url = 'http://testweb/scripts/wgate/zvw10a/!?~language=en'.
    url2 = '&~OkCode(LGON)=LGON&login-login_user='.
    url3 = '&vbcom-vbeln='.
    CONCATENATE url url2 url3 INTO fullurl.
    WRITE: /'Staffing Excel'.
    CALL FUNCTION 'WWW_SET_URL'
    EXPORTING
    offset = 12
    length = 10
    func = fullurl
    TABLES
    query_string = qstring
    EXCEPTIONS
    invalid_table = 1
    OTHERS = 2.
    Thanks & Regards,
    Preethi.

    Check the below example program :
    data: begin of itab occurs 0,
          matnr type mara-matnr,
          mtart type mara-mtart,
          matkl type mara-matkl,
          groes type mara-groes,
          end of itab.
    data: ifields type table of w3fields with header line.
    data: ihtml   type table of w3html   with header line.
    select * into corresponding fields of table itab
              from mara up to 100 rows.
    call function 'WWW_ITAB_TO_HTML'
    EXPORTING
      TABLE_ATTRIBUTES       = 'BORDER=1'
      TABLE_HEADER           =
        ALL_FIELDS             = 'X'
      tables
        html                   = ihtml
        fields                 = ifields
      ROW_HEADER             =
        itable                 = itab
    check sy-subrc = 0.
    call function 'GUI_DOWNLOAD'
         exporting
              filename = 'c:\test.html'
         tables
              data_tab = ihtml.
    Reward points if it is helpful
    Thanks
    Seshu

Maybe you are looking for

  • Purchase info record(PIR).

    Hi Folks, I have some questions regarding the archiving of purchase info records. 1. what are the functional dependencies that we need to check for before Archiving a PIR. 2.bold I was unable to Archive some Purchase info records even after it is mar

  • Bapi to add componentes in Project

    Hello All, I have to add compoments in project can anyone suggest me BAPI for that ? Edited by: yogesh Kothavade on Apr 8, 2009 12:02 PM

  • 1 characteristics in different aggregates

    Hi, Can someone explain me the following, Say we have a characteristics A, B, C in an infocube, and we have built 3 aggregates on that infocube. 1st Aggregate contains Characteristics A 2nd Aggregate contains Characteristics B 3rd aggregate contains

  • OAS server-side JSP debugging

    Hi All Is there a way to do the OAS server side JSP debugging using JDeveloper or other tools? ka null

  • Only one column header in delimited report ?

    Hi! Is there a way to put only one line of column header on delimited report? (By default the Report builder puts the header in every record line... as well the delimited_hdr = no command prompt property is not good, because puts out no header) Thank