_hex_ in XMLString

When I execute:
qry = new OracleXMLQuery(conn, sql);
return qry.getXMLString();
I get back correct XML; however, there's
hex values for the space character, etc.
For instance the data, "a b" would return:
<ROW>a_x0020_b</ROW>
Is there a way that I can get it to
return: "<ROW>a b</ROW>" ?
Thanks.
Frank

And what is your query?
It's rather unusual that you got data inside <ROW> tag.
Usually there are colums inside it; something like this:
<?xml version="1.0"?>
<V_SDT_XML_TABLE_NS>
<ROW>
<N>1</N>
<DESCRIPTION>100 Kb</DESCRIPTION>
</ROW>
<ROW>
<N>2</N>
<DESCRIPTION>1 Mb</DESCRIPTION>
</ROW>
</V_SDT_XML_TABLE_NS>
I have once got the similar output when tried to produce the XML description of table with field R$INV$CODE and got <R_x0024_INV_x0024_CODE>...</R_x0024_INV_x0024_CODE>.
AFAIK such replacement occurs when otherwise there will be illegal symbol in element name (not its contents), that is why I asked about query.

Similar Messages

  • Problem while parsing xmlString in jsp using JSTL

    HI, I am not able to display data in jsp page that I have stored in string variable in XML form.
    I want to print xmlString data in jsp using jstl.
    probably i might have to parse it but i don't have idea . Can any one help me PLZ??

    I managed the code but getting following error
    org.apache.jasper.JasperException: javax.servlet.jsp.JspException: Content is not allowed in prolog.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: Content is not allowed in prolog.
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:854)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.xml.test_jsp._jspService(test_jsp.java:106)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.xml.sax.SAXParseException: Content is not allowed in prolog.
         com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
         com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSource(ParseSupport.java:227)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseInputSourceWithFilter(ParseSupport.java:193)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseReaderWithFilter(ParseSupport.java:199)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.parseStringWithFilter(ParseSupport.java:206)
         org.apache.taglibs.standard.tag.common.xml.ParseSupport.doEndTag(ParseSupport.java:138)
         org.apache.jsp.xml.test_jsp._jspx_meth_x_parse_0(test_jsp.java:168)
         org.apache.jsp.xml.test_jsp._jspService(test_jsp.java:82)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • Libxml/xmlstring.h not found

    Hi
    I am developing a sample application using iphone sdk in which I have to parse xml.
    If I import <libxml/xmlstring.h> or any .h file from libxml I am getting compilation error libxml/xmlstring.h not found.
    I have already added libxml2.2.dylib in framework folder. please help me.
    thanks
    bill

    Hi,
    You go to the Targets, right click on your project and chose *Get Info*. Then in the Build tab, go down to *Header Search Path* and enter this : /usr/include/libxml2
    Good luck
    HeoU

  • Read XMLString - urgent

    Hi,
    I have a string which holds a valid XML
    some thing like this
    strXML = "<GSP ver='3.2'><tm>7.622</tm><RES SN='1'><M>126000</M></RES></GSP>";
    Can any one tell me how to get the value of "126000" from the above XMLstring in EP.
    Note: I want to use DOM parser to get the value.
    Thanks in advance
    Lakshminarayana

    Hello Lakshminarayana,
    Try this (untested) example. If it works and you like it, improve it.
    Regards.
    String number;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(strXML);
    NodeList items = document.getFirstChild().getChildNodes();
    for (int x = 0; x < items.getLength(); x++) {
              Node nodo = items.item(x);
              if (nodo.getNodeName() == "RES") number = getNumber(nodo);
    private String getNumber(Node nodo){
         String number;
         NodeList items = nodo.getChildNodes();
         for (int x = 0; x < items.getLength(); x++) {
              Node child = items.item(x);
              if (child.getNodeName() == "M") number = child.getFirstChild().getNodeValue();
              //This will work only if you have just 1 M node in a RES node.
         return number;

  • Xmlstring as input to webservice from flex

    hi ,
    i want to send xml string as input to a webservice .i had a
    problem with this. iam pasting the code iam using.
    public var sResult:String="<?xml version='1.0'
    encoding='UTF-8' ?>
    <root><sample><id>8098</id><type>CD</type><unit>nm</unit></sample></root>";
    <mx:WebService id="myws"
    wsdl="
    http://localhost:8080/myws/method?wsdl"
    useProxy="false">
    <mx:operation name="getCD" result="resultHandler(event)"
    fault="Alert.show(event.fault.message)">
    <mx:request>
    <String_1> {sResult} </String_1>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:Panel width="652" height="408">
    <mx:Button x="368" y="2" label="Lot_id" id="mybutton"
    click="myws.getCD.send()"/>
    </mx:Panel>
    when i use any string for sResult .it is working fine.but
    when i use xml string it is giving the error SOAP request error.
    i need ur help.

    this is the complete trace of error iam getting
    ERROR [SOAPFaultExceptionHelper] SOAP request exception
    javax.xml.rpc.JAXRPCException:
    org.jboss.ws.binding.BindingException:
    org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: {
    http://www.w3.org/2001/XMLSchema}string
    type of element {
    http://webservice.autoee/jaws}String_1
    should be complex and contain root as a child element.
    at
    org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:303)
    at
    org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233 )
    at
    org.jboss.ws.binding.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:103)
    at
    org.jboss.ws.binding.EndpointInvocation.getRequestPayload(EndpointInvocation.java:117)
    at
    org.jboss.ws.server.ServiceEndpointInvokerJSE.invokeServiceEndpoint(ServiceEndpointInvoke rJSE.java:94)
    at
    org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:115)
    at
    org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
    at
    org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java :355)
    at
    org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
    org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:252)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:202)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at
    org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.ja va:175)
    at
    org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at
    org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Htt p11BaseProtocol.java:664)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at
    org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.jboss.ws.binding.BindingException:
    org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: {
    http://www.w3.org/2001/XMLSchema}string
    type of element {
    http://webservice.autoee/jaws}String_1
    should be complex and contain root as a child element.
    at
    org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:100)
    at
    org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:235)
    ... 30 more
    Caused by: org.jboss.ws.jaxb.UnmarshalException: Failed to
    parse source: {
    http://www.w3.org/2001/XMLSchema}string
    type of element {
    http://webservice.autoee/jaws}String_1
    should be complex and contain root as a child element.
    at
    org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:67)
    at
    org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:92)
    ... 31 more
    Caused by: org.jboss.xb.binding.JBossXBException: Failed to
    parse source: {
    http://www.w3.org/2001/XMLSchema}string
    type of element {
    http://webservice.autoee/jaws}String_1
    should be complex and contain root as a child element.
    at
    org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:156)
    at
    org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:126)
    at
    org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:63)
    ... 32 more
    Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {
    http://www.w3.org/2001/XMLSchema}string
    type of element {
    http://webservice.autoee/jaws}String_1
    should be complex and contain root as a child element.
    at
    org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContent Handler.java:187)
    at
    org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(Sa xJBossXBParser.java:301)
    at
    org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch( Unknown
    Source)
    at
    org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
    Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
    Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
    Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
    Source)
    at
    org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
    Source)
    at
    org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:152)
    ... 34 more

  • Breaking down xmlstring

    Hi,
    I'm getting some xml node like this..
    <item>
    &lt;type&gt;Office&lt;/type&gt;&lt;idc&gt;+1&lt;/idc&gt;
    </item>
    where the <item> tag actually having a string like
    thing :- <type>Office</type><idc>+1</idc>
    What would be the easiest way to get the "idc" value from
    that string..?! perhaps to pass the data to some specific object
    container .. or something! or whatever..!
    Please help!
    Thanks.
    ASB

    I think you will need to decode that manually, with a
    search/replace on the entities. Then use XML() to parse the string
    into an xml object, on which you could then use e4x expressions to
    locate the data you want.
    Note that in you example, your string represents an XMLList,
    and not a single node. XML() might handle this correctly for your,
    look it up. If not, prepend some root node tag and append som
    closing root tag.
    Tracy

  • Converting xmlstring into a node-set

    Hi,
    Is there any xsl function which could take an xml string and convert into a node-set?
    Or could any function be written to achieve this kind of result?
    Thanks.

    Hi,
    Seems no one understands my need in my post yet. Let me elaborate my requirement a little more...
    Actually in my case, I used a variable to refer to a node set (in my actual implementation the conditions in the bracket [] are much much more complicated ), e.g.
    <?variable:rows;”/ROWSET/ROW[SALARY>1000]”?>
    And since the report involves a complex layout printed on pre-print forms which needs me to put the fields very precisely. I cannot use the For Each method but to extract the rows one by one, likes the following:
    <?$rows[1]/ENAME?>
    <?$rows[2]/ENAME?>
    and put them on various position on the RTF Template.
    So far so good, until I realized that the $rows node set is needed to be sorted according to ENAME.
    Currently I can build a sorted list from $rows into another variable $sorted_rows as follows:
    <xsl:variable name="sorted_rows"><xsl:for-each select="$rows"><xsl:sort select="ENAME"/><xsl:copy-of select="."/></xsl:for-each></xsl:variable>
    But in $sorted_rows, it contains only one item which is the xml fragment of the sorted data, but not a node set.
    So my question is, is there any way to convert this xml fragment into a node set so I can use the following to extract the fields?
    <?$sorted_rows[1]/ENAME?>
    <?$sorted_rows[2]/ENAME?>
    Hope anyone can share with my some solution to this.
    Thanks in advance,
    Jonathan

  • XMP metadata from Flashbuilder why not visible in Adobe Bridge?

    Hi there,
    I'm currently wondering around XMP metadata and swf files.
    A: Flash CS5: works
    When I use the XMP panel in Flash CS5 and export a swf, open Adobe Bridge CS5 and select the file, the XMP data are correctly displayed.
    B: Flash Builder(Flex 4.1): don't work
    When I use Flashbuilder and add my metadata to the compilation, then compile, open Adobe Bridge CS5 and select the file, nothing is included in metadata.
    Procedure based on the following (same problem if metadata are directly set through compiler arguments):
    http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html
    ../src/config/ProductMetaData.xml
    <flex-config>
    <metadata>
        <title>My title</title>
        <description>My description</description>
        <publisher>The publisher</publisher>
        <creator>The creator</creator>
        <language>EN</language>
    </metadata>
    </flex-config>
    compiler argument
    -load-config+=config/ProductMetaData.xml
    As far as understood, on the background the following is added to the swf at compile time:
    <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
        <rdf:Description rdf:about='' xmlns:dc='http://purl.org/dc/elements/1.1'>
            <dc:format>application/x-shockwave-flash</dc:format>
            <dc:title>My title</dc:title>
            <dc:description>
                <rdf:Alt>
                    <rdf:li xml:lang='x-default'>My description</rdf:li>
                </rdf:Alt>
            </dc:description>
            <dc:publisher>The publisher</dc:publisher>
            <dc:creator>The creator</dc:creator>
            <dc:language>EN</dc:language>
        </rdf:Description>
    </rdf:RDF>
    I've checked that the medata is correctly added to the swf file using this small software polarswf:
    http://download.cnet.com/Polar-SWF-MetaData/3000-6676_4-10738623.html
    I do not know if it is safe to use it in a produciton context at least in trial mode it allows to check the metadata included in your swf.
    I wonder if this metadata coonot be read by Adobe Bridge because they are at a "lower level" than those put by flash CS5 XMP panel?
    Thank you in advance for your help.
    This is not a blocking situation, but I'm curious to understand what happend.
    Cedric Madelaine (aka maddec)

    I was following this post for a LONG time, since I noticed the same problem.
    This week I was getting in it into myself again and I noticed you use load-config. I used these compiler options :
    contributor name
    Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.
    creator name
    Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.
    date text
    Sets metadata in the resulting SWF file. For more information, see Adding metadata to SWF files.
    But that resulted in this XML string where the dc namespace was missing a / on the end of the URI
    That caused the metadata which was added in flashbuilder was only visible in bridge in the rawXML panel, and not the specific fields
    changing the URI in http://purl.org/dc/elements/1.1/ did the trick ( did this in bridge by exporting the rawXML, changed the / , and imported it )
    <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
        <rdf:Description rdf:about='' xmlns:dc='http://purl.org/dc/elements/1.1'>
            <dc:format>application/x-shockwave-flash</dc:format>
        </rdf:Description>
    </rdf:RDF>
    Sadly there was no way I could add this / myself everytime.
    BUT then I discoverd this option :
    raw-metadata XML_string
    Defines the metadata for the resulting SWF file. The value of this option overrides any metadata.* compiler options (such as contributor,creator, date, and description).
    This is an advanced option.
    And you could give the exact RAW XML as you  described
    <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
        <rdf:Description rdf:about='' xmlns:dc='http://purl.org/dc/elements/1.1/'>
            <dc:format>application/x-shockwave-flash</dc:format>
            <dc:title>My title</dc:title>
            <dc:description>
                <rdf:Alt>
                    <rdf:li xml:lang='x-default'>My description</rdf:li>
                </rdf:Alt>
            </dc:description>
            <dc:publisher>The publisher</dc:publisher>
            <dc:creator>The creator</dc:creator>
            <dc:language>EN</dc:language>
        </rdf:Description>
    </rdf:RDF>
    to the compiler. This could also be done in Flash with JSFL.
    In the end I wrote an ANT script which injects the exact XMLstring of metadata to Flash and Flex projects by using the raw-metadata parameter in FLEX and JSFL for flash.
    Hope this helps

  • Cenário de envio de XML (B2B)

    Olá Henrique.
    Estou implementando a solução SAP GRC/NFe e configurando o envio de XML aos clientes através do cenário NTB2B_WebAS_Outbound_B2B_NFe.
    Observei que a documentação indica a criação de um communication channel para cada cliente, porém gostaria de configurar um único mail receiver onde o endereço de e-mail seja flexível.
    Para isso, necessito enviar do ECC para o GRC o campo e-mail do cliente e que o GRC transmita este campo na mensagem  NTB2B_procNFe_OB.
    Existe esta possibilidade prevista no GRC?
    Se não, como ficam os desenvolvimentos no PI? Como a criação de novo Interface Mapping, ou, até mesmo de um novo BPM?
    Obrigado,
    Dorval Neto.

    Olá Dorval,
    nao é preciso desenvolver um BPM.
    É possível sim fazer isso dinamicamente (através de alguns simples desenvolvimentos), até mesmo utilizando a interface standard NTB2B_WebAS_Outbound_B2B_NFe (que é chamada por default pelo proxy após a autorizacao da NFE). Para isso, existem 2 métodos:
    1. alimentacao do dynamic configuration de Mail (procure sobre "dynamic configuration" ou "adapter specific message attributes" no forum de XI q vc vai ter varios retornos);
    2. mapping do XML de NFE p/ a estrutura de Mail Package (procure tb por "mail package" no forum do XI).
    Em ambos os casos, vc precisa definir um novo message mapping que irá ser utilizado nesse cenario:
    No caso 1, vc precisa de um message mapping "fake" (onde ambas estruturas fonte e destino sao o mesmo message type, no caso o message type da interface NTB2B_WebAS_Outbound_B2B_NFe). No campo que contém o CNPJ nessa estrutura, vc pode fazer por exemplo um Lookup no mapping para chamar uma RFC que retorna o email a ser utilizado a partir do CNPJ (vc pode desenvolver essa RFC no proprio R/3 e chama-la a partir do lookup, passando um communication channel que aponte o R/3). Procure por "lookup api" ou "rfc lookup" no forum do XI. Uma vez retornado o email, vc pode entao alimentar o dynamic configuration do campo To do Mail adapter com esse valor.
    No caso 2, o mapping vai de fato preencher o Mail Package.
    Vc precisa, da mesma maneira anterior, fazer o RFC Lookup para pegar o valor do email, mas em vez de preencher um dynamic configuration, vc preenche direto na estrutura destino do mapping (q tem os campos subject, to, cc etc.). O campo content vc alimenta a partir do campo xmlString da estrura de origem.
    Depois de criados os mappings, vc precisa tb criar um interface mapping para coloca-lo dentro.
    No caso 1, alem do mapping dummy q vc criou, o interface mapping precisa ter o java mapping standard q vem no interface mapping standard dessa interface.
    No caso 2, o interface mapping soh precisa do mapping q alimenta o mail package.
    Para o configuration, vc pode configurar todo o cenario standard. Daí depois de configurado, vc vai no Interface Determination e troca o interface mapping standard pelo interface mapping q vc criou acima.
    Ainda, para evitar duplicar/recriar objetos, vc pode incluir uma dependencia do seu Software Component Version ao SWCV SLL-NFE 1.0. Daí, vc pode incluir os objetos standard nos seus proprios objetos. Ainda, alguns objetos vc nao precisa nem criar (como o interface mapping), bastando modificar os objetos "standard" q aparecem dentro do nó "Basis" do seu SWCV (é como se ele automaticamente criasse versoes Z dos objetos standard, q vc pode modificar a vontade; esses objetos tem o mesmo nome e namespace dos standard, mas o SWCV é o seu, nao o SLL-NFE 1.0).
    Eu até comecei a escrever um blog a respeito disso tudo, mas nao cheguei a terminar.
    Se conseguir, eu publico.
    Abracos,
    Henrique.
    PS: em anexo segue um exemplo de codigo que pode ser utilizado na UDF para recuperar o email. No caso, ele nao preenche dynamic configuration, soh retorna o email (o codigo para preencher o dynamic config está na 3a referencia abaixo).
    Referencias:
    - Mail Adapter help: http://help.sap.com/saphelp_nw70/helpdata/EN/6b/4493404f673028e10000000a1550b0/frameset.htm
    - Javadoc da Lookup API: http://help.sap.com/javadocs/NW04S/current/pi/index.html (package com.sap.aii.mapping.lookup)
    - Dynamic Configuration: http://help.sap.com/saphelp_nw70/helpdata/EN/43/03612cdecc6e76e10000000a422035/frameset.htm
    - Modifying XI Objects: http://help.sap.com/saphelp_nw70/helpdata/EN/ab/3adb41083f6024e10000000a1550b0/frameset.htm

  • Unable to pass xmlbeans object in weblogic web services using OEPE

    Migrating Weblogic web services from Weblogic Workshop 10.3 to Oracle Enterprise for Eclipse...Passing xmlbean generated types in arguments of webservice call
    How to work around the following errors? I do not have this error when in workshop 10.3 only in OEPE eclipse
    "oracle.eclipse.tools.webservices.compiler.CompilationException: Errors: JAX-WS web services must not have xmlBean parameter or return type"
    PLease note that I want DocType to be xmlbeans generated or inherited from org.apache.xmlbeans.XmlObject....
    @WebMethod
         public void upload(String filename, DocType doc) {
    Hi, I have legacy codes from Weblogic workshop 10.1 and 10.3.....
    I am able to compile and run in Weblogic workshop 10.3 by passing the xmlbean generated DocType as arguments in the web services call.... but why am I not able to do this in Oracle Enterprise for Eclipse OEPE......
    If I were to generate the web service from teh wsdl...it will generate it's own DocType.class in the jar files and not use the xmlbean generated class one....
    How to get iOEPE to generate the classes in build\jws\ for
    testWSService-annotation.xml
    weblogic-webservices.xml etc like in workshop
    How can I resolve this??? Am I stuck with Workshop on this?? How to work around??
    Any help or clarifications would be much appreciated.
    Inside testWS.java,
    package ws;
    import java.io.File;
    import javax.jws.*;
    import org.example.doc.DocType;
    @WebService
    public class testWS {
         @WebMethod
         public void upload(String filename, DocType doc) {
              try {
                   doc.save(new File(filename));
              catch(Exception e) {
                   System.out.println(e);
    Inside xmlbeans generated DocType.java.....and DocTypeDocuments.java
    * XML Type: DocType
    * Namespace: http://www.example.org/doc
    * Java type: org.example.doc.DocType
    * Automatically generated - do not modify.
    package org.example.doc;
    * An XML DocType(@http://www.example.org/doc).
    * This is a complex type.
    public interface DocType extends org.apache.xmlbeans.XmlObject
    public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
    org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(DocType.class.getClassLoader(), "schemaorg_apache_xmlbeans.system.testWSTypeSystem").resolveHandle("doctypec217type");
    * Gets the "element1" element
    java.lang.String getElement1();
    * Gets (as xml) the "element1" element
    org.apache.xmlbeans.XmlString xgetElement1();
    * Sets the "element1" element
    void setElement1(java.lang.String element1);
    * Sets (as xml) the "element1" element
    void xsetElement1(org.apache.xmlbeans.XmlString element1);
    * Gets the "element2" element
    java.lang.String getElement2();
    * Gets (as xml) the "element2" element
    org.apache.xmlbeans.XmlString xgetElement2();
    * Sets the "element2" element
    void setElement2(java.lang.String element2);
    * Sets (as xml) the "element2" element
    void xsetElement2(org.apache.xmlbeans.XmlString element2);
    * A factory class with static methods for creating instances
    * of this type.
    public static final class Factory
    public static org.example.doc.DocType newInstance() {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }
    public static org.example.doc.DocType newInstance(org.apache.xmlbeans.XmlOptions options) {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }
    /** @param xmlAsString the string value to parse */
    public static org.example.doc.DocType parse(java.lang.String xmlAsString) throws org.apache.xmlbeans.XmlException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, null ); }
    public static org.example.doc.DocType parse(java.lang.String xmlAsString, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xmlAsString, type, options ); }
    /** @param file the file from which to load an xml document */
    public static org.example.doc.DocType parse(java.io.File file) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, null ); }
    public static org.example.doc.DocType parse(java.io.File file, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( file, type, options ); }
    public static org.example.doc.DocType parse(java.net.URL u) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, null ); }
    public static org.example.doc.DocType parse(java.net.URL u, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( u, type, options ); }
    public static org.example.doc.DocType parse(java.io.InputStream is) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, null ); }
    public static org.example.doc.DocType parse(java.io.InputStream is, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( is, type, options ); }
    public static org.example.doc.DocType parse(java.io.Reader r) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, null ); }
    public static org.example.doc.DocType parse(java.io.Reader r, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, java.io.IOException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( r, type, options ); }
    public static org.example.doc.DocType parse(javax.xml.stream.XMLStreamReader sr) throws org.apache.xmlbeans.XmlException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, null ); }
    public static org.example.doc.DocType parse(javax.xml.stream.XMLStreamReader sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( sr, type, options ); }
    public static org.example.doc.DocType parse(org.w3c.dom.Node node) throws org.apache.xmlbeans.XmlException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, null ); }
    public static org.example.doc.DocType parse(org.w3c.dom.Node node, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( node, type, options ); }
    /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
    public static org.example.doc.DocType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }
    /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
    public static org.example.doc.DocType parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
    return (org.example.doc.DocType) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }
    /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
    public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
    return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }
    /** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */
    public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {
    return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }
    private Factory() { } // No instance of this class allowed
    Edited by: user11079482 on Jan 1, 2010 2:09 AM

    Ok just as I expected. So I guess I am left with the following two options
    1) either I switched to using JAXB in my apps instaed of xmlbeans....
    2) or if I still wanna use the old JAX-RPC web services to deploy on the Weblogic 10gR3 server i will have to create my own ant task jwsc directly......as shown below in your docs
    Programming Web Services for WebLogic Server (ant tasks)
    http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webserv/anttasks.html
    Getting Started With WebLogic Web Services Using JAX-RPC
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webserv_rpc/index.html
    Will OEPE be supporting the old JAX-RPC anytime in the near future release? or have to create own build ant task to call jwsc ant task directly to compile JAX-RPC web services??

  • SOAP Reponse contains &gt and &lt instead of and

    I am new to Web Services. I wrote a simple SOAP client in Java. It seems to work and I get the SOAP response back; however the XML response has < and > instead of < and >. Am I making a mistake in my source code? I have placed my source code below and the result that I get when I run the code. How do I get a proper response with < and > instead of &lt and &gt?
    Webservice Endpoint: http://www.webservicex.net/stockquote.asmx
    WSDL Location: http://www.webservicex.net/stockquote.asmx?wsdl
    From the <GetQuoteResult>, the reponse I get has &lt and &gt for < and >. However, when I past it here, the &lt and &gt are being converted to < and >.
    SOAP Response that I get:
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.
    xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
    " xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetQuoteResponse xmln
    s="http://www.webserviceX.NET/"><GetQuoteResult><StockQuotes><Stock>
    <Symbol>IBN</Symbol><Last>38.58</Last><Date>7/30/2
    010</Date><Time>10:24am</Time><Change>-0.35</Change&g
    t;<Open>38.42</Open><High>38.86</High><Low>38.29&l
    t;/Low><Volume>314170</Volume><MktCap>21.505B</MktCap&gt
    ;<PreviousClose>38.93</PreviousClose><PercentageChange>-0.90%&
    lt;/PercentageChange><AnnRange>28.53 - 45.95</AnnRange><Earns&
    gt;1.782</Earns><P-E>21.85</P-E><Name>ICICI Bank Limite&
    lt;/Name></Stock></StockQuotes></GetQuoteResult></GetQuoteRespons
    e></soap:Body></soap:Envelope>
    SOAP response that I am expecting:
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.
    xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
    " xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetQuoteResponse xmln
    s="http://www.webserviceX.NET/"><GetQuoteResult><StockQuotes><Stock>
    <Symbol>IBN</Symbol><Last>38.58</Last><Date>7/30/2
    010</Date><Time>10:24am</Time><Change>-0.35</Change&g
    t;<Open>38.42</Open><High>38.86</High><Low>38.29&l
    t;/Low><Volume>314170</Volume><MktCap>21.505B</MktCap&gt
    ;<PreviousClose>38.93</PreviousClose><PercentageChange>-0.90%&
    lt;/PercentageChange><AnnRange>28.53 - 45.95</AnnRange><Earns&
    gt;1.782</Earns><P-E>21.85</P-E><Name>ICICI Bank Limite&
    lt;/Name></Stock></StockQuotes></GetQuoteResult></GetQuoteRespons
    e></soap:Body></soap:Envelope>
    Source Code:
    import java.net.*;
    import java.io.*;
    public class stocksoapClient {
      public final static String DEFAULT_SERVER = "http://www.webservicex.net/stockquote.asmx";
      public final static String SOAP_ACTION = "http://www.webserviceX.NET/GetQuote";
      public static void main(String[] args) {
        String input = "IBN";
        String server = DEFAULT_SERVER;
        if (args.length >= 2) server = args[1];
        try {
               Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy.compaq.com", 8080));        
               URL u = new URL(server);
               URLConnection uc = u.openConnection(proxy);
               HttpURLConnection connection = (HttpURLConnection) uc;
               connection.setDoOutput(true);
               connection.setDoInput(true);
               connection.setRequestMethod("POST");
               connection.setRequestProperty("Content-Type",  "text/xml; charset=utf-8");
               connection.setRequestProperty("Content-Length",  String.valueOf(input.length()));
               connection.setRequestProperty("SOAPAction", SOAP_ACTION);
               //connection.connect();
               OutputStream out = connection.getOutputStream();
               Writer wout = new OutputStreamWriter(out);
               //wout.write("POST" + DEFAULT_SERVER  + "HTTP/1.1");
               //wout.write("Host:www.webservicex.net");
               //wout.write("Content-Type: text/xml; charset=utf-8");
               //wout.write("Content-Length: " + String.valueOf(input.length()));
               //wout.write("SOAPAction:" + SOAP_ACTION);         
              //wout.write("\n");     
               wout.write("<?xml version='1.0' encoding='utf-8'?>"); 
               wout.write("<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>");
               wout.write("<soap:Body>");
               wout.write("<GetQuote xmlns='http://www.webserviceX.NET/'>");
               wout.write("<symbol>"+input+"</symbol>");
               wout.write("</GetQuote>");     
               wout.write("</soap:Body>");
               wout.write("</soap:Envelope>");
               wout.flush();
               wout.close();
               BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
               String line;     
               //InputStream in = connection.getInputStream();
               //int c;
               while ((line=rd.readLine()) != null) {
                  System.out.println(line);
               rd.close();
        } catch (IOException e) {
               System.err.println(e);
    }

    This problem won't occur if the server side returns xmlobject to the client instead of a xmlstring
    Thanks
    Srinivas K G

  • How do I reference the data object in a DataGrid to show an image correctly in Acrobat?

    I'm creating an inferface for an Acrobat application  and I'm having a issue with displaying an image in a grid.  When I hard code the source="statusNONE.png" it works as intended (with an image, not the image associated with each grid item), however, when I try to use the source="{data.@icon}" to reference the dataProvider (XMLListCollection) I get nothing.  Not a broken image or anything.  I think I may just not be referencing the XMLListCollection correctly, otherwise I don't know why it would work with hard coding vs. fetching the string from the XML.
    //Application Header (Flex 4.5)
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx"
                                     width="100%" height="100%" creationComplete="eaton_creationCompleteHandler(event)"
                                     currentState="Review">
    //Sample of XML that gets used as basis for XMLListCollection
    <Annots>
         <Annot name='TEST' index='14' feedback='' canConstruct='0' icon='statusNONE.png'/>
    </Annots>
    //creation of the XMLListCollection from String
    [Bindable] protected var fullXML:XML;
    [Bindable] protected var fullXMLCol:XMLListCollection;
    protected function loadXML(xmlString:String):void
          fullXML = new XML(xmlString);
         var fullXMLList:XMLList = fullXML.children();
          fullXMLCol = new XMLListCollection(fullXMLList);
    //DataGrid
    <s:DataGrid left="0" top="0" bottom="0" width="142" dataProvider="{fullXMLCol}"
                                            requestedRowCount="4" rowHeight="30"
                                            top.Confirm="87">
                        <s:columns>
                                  <s:ArrayList>
                                            <s:GridColumn dataField="@name" headerText="Annotations"></s:GridColumn>
                                            <s:GridColumn headerText="status" width="30" >
                                                      <s:itemRenderer>
                                                                <fx:Component>
                                                                          <s:GridItemRenderer>
                                                                                    <s:Image width="30" height="30" source="{data.@icon}"/> //THIS IS THE PART THAT SEEMS TO BE GIVNG ME TROUBLE!
                                                                          </s:GridItemRenderer>
                                                                </fx:Component>
                                                      </s:itemRenderer>
                                            </s:GridColumn>
                                  </s:ArrayList>
                        </s:columns>
                        <s:typicalItem>
                                  <fx:Object dataField1="Sample Data" dataField2="Sample Data" dataField3="Sample Data"></fx:Object>
                        </s:typicalItem>
              </s:DataGrid>
    Additional information.  I'm using the resources tab for the flash embedding in Acrobat for my images. This works when I am hard coding the file name string works for the source without having to add a full path, the images are not technically bundled into the swf.   I just don't understand why using the data object to get that same string would show different results.
    tl;dr: GridItemRenderer works to show images when hard coded but not when using {data}.
    UPDATE: Figured it out, needed to add a toString() to the data.@icon.   I had assumed it was a string being handed over, I assumed wrong.

    Probably because data.@icon isn't a String, it is an XMLList, and source property is an Object not a String so the runtime doesn't automatically convert it.
      Try [email protected]()

  • How do I use XSLT & XML is stored in InterMedia Text.....

    I use interMedia Text to store XML document. How do I use the XSLT Processor API to transform the data which is searched by XML SQL Utility??
    //***Source Code
    public Document xmlquery(String tabName,String xslfilename)
    Document xmlDocToReturn = null;
    String xmlString;
    try
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //initiate a JDBC connection
    // initialize the OracleXMLQuery
    OracleXMLQuery qry = new OracleXMLQuery(conn,"select XML_TEXT from bookstore where contains (xml_text,'John WITHIN authorsec')>0");
    // structure the generated XML document
    qry.setMaxRows(2);
    // set the maximum number of rows to be returned
    // get the XML document in string format
    xmlString = qry.getXMLString();
    // print out the XML document
    System.out.println(" OUTPUT IS:\n"+xmlString);
    // get the XML document in string format
    xmlDocToReturn = qry.getXMLDOM();
    conn.close();
    catch (SQLException e) {
    return xmlDocToReturn;
    xml = (XMLDocument)query.xmlquery(args[1],args[0]);
    // Instantiate the stylesheet
    XSLStylesheet xsl = new XSLStylesheet(xsldoc, xslURL);
    XSLProcessor processor = new XSLProcessor();
    // Display any warnings that may occur
    processor.showWarnings(true);
    processor.setErrorStream(System.err);
    // Process XSL
    DocumentFragment result = processor.processXSL(xsl, xml);
    Thank you.
    null

    Your problem here is that when you store an XML document in a CLOB and search it using intermedia, when you do a query like:
    SELECT xml_text
    FROM bookstore
    WHERE CONTAINS(xml_text,'John WITHIN authorsec')>0
    The output from the XML SQL Utility using getXMLDOM() looks like this:<ROWSET>
    <ROW>
    <XML_TEXT><![CDATA[
    <bookstuff>
    <authorsec>
    <name>Steve</name>
    </authorsec>
    etc.
    </bookstuff>
    ]]>
    </XML_TEXT>
    </ROW>
    </ROWSET>with the document as a single text value (it's actually just a text node, not a CDATA node) but the above illustrates conceptually that the whole XML document is one big text node.
    To transform this you'll need to parse that XML text into an XML document in memory by passing constructing a StringReader() on the text value and parsing that reader.
    null

  • Parameters from midlet to servlet

    Hi all,
    i have been trying to pass values from MIDlet (setRequestProperty(); ) and to servlet (request.getParameter();).
    but when i tried to print out the value, it just contained NULL value.
    I had a look at the java forum website, there were plenty of same problems and no one got right.
    I'll really appreciate it if anyone fixes this for me.
    ---------------------MIDLET-----------------------------------------------------------------------------
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.*;
    import org.kxml.*;
    import org.kxml.parser.*;
    public class MbankMIDlet  extends MIDlet implements CommandListener {
      private Display display;
      private Form loginForm = new Form("Login");
      private Form mainForm = new Form("MobileBank");
      private String loguserID;
      private String logpass;
      private String mSession;
      private StringItem stringItem = new StringItem(null,"");
      private TextField userIDTextField = new TextField("User ID", "", 8, TextField.NUMERIC);
      private TextField passwordTextField = new TextField("Password", "", 12, TextField.PASSWORD);
      static final Command loginCommand = new Command("Login", Command.OK, 1);
      static final Command exitCommand = new Command("Exit", Command.STOP, 1);
      static final Command backCommand = new Command("Back",Command.BACK, 1);
      public MbankMIDlet() {
        mainForm.append(stringItem);
        mainForm.addCommand(exitCommand);
        mainForm.addCommand(backCommand);
        mainForm.setCommandListener(this);
      public void startApp() throws MIDletStateChangeException {
        display = Display.getDisplay(this);
        loginForm.append(userIDTextField);
        loginForm.append(passwordTextField);
        loginForm.addCommand(loginCommand);
        loginForm.addCommand(exitCommand);
        loginForm.addCommand(backCommand);
        loginForm.setCommandListener(this);
        display.setCurrent(loginForm);
      public void destroyApp(boolean unconditional) {
        notifyDestroyed();
      public void mainMenu() {
        display.setCurrent(loginForm);
      public void pauseApp() {
        display = null;
        loginForm = null;
        mainForm = null;
        stringItem = null;
        userIDTextField = null;
        passwordTextField = null;
      public void commandAction(Command c, Displayable d) {
        String label = c.getLabel();
        if (label.equals("Exit")) {
          destroyApp(true);
           mSession = null;
        } else if (label.equals("Login")) {
          login();
        } else if (label.equals("Back")){
          mainMenu();
      private void login() {
        loguserID = userIDTextField.getString();
        logpass = passwordTextField.getString();
        Form waitForm = new Form("Waiting...");
        display.setCurrent(waitForm);
        Thread t = new Thread() {
          public void run() {
            connect();
        t.start();
      private void connect() {
        HttpConnection hc = null;
        InputStream in = null;
        OutputStream os = null;
        String url = getAppProperty("MbankMIDlet.URL");
        try {
          hc = (HttpConnection)Connector.open(url);
          hc.setRequestMethod(HttpConnection.GET);
          hc.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0" );
          hc.setRequestProperty("Content-Language", "en-US" );
          hc.setRequestProperty("Accept", "text/plain");
          hc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded" );
          hc.setRequestProperty("Connection","close");
          hc.setRequestProperty("loguserID", loguserID);
          hc.setRequestProperty("logpass", logpass);
          os = hc.openOutputStream();
          os.close();
    //      os.flush();  //tried close() and flush() but none of them worked.
          if (mSession != null) {
              hc.setRequestProperty("Cookie", mSession);
          // Read the session ID from a cookie in the response headers.
          String cookie = hc.getHeaderField("Set-cookie");
          if (cookie != null) {
              int semicolon = cookie.indexOf(';');
              mSession = cookie.substring(0, semicolon);
          in = hc.openInputStream();
          int rc = hc.getResponseCode();
          if( rc == HttpConnection.HTTP_OK ) { //HTTP_OK equals 200
            System.out.println("HttpConnection OK");
            StringBuffer xmlBuffer = new StringBuffer();
            String xmlString = null;
            int ch;
            while ( ( ch = in.read() ) != -1 )
              xmlBuffer.append( ( char )ch );
            xmlString = xmlBuffer.toString();
            stringItem.setText(xmlString);
          else if (rc == HttpConnection.HTTP_UNAUTHORIZED){//HTTP_UNAUTHORIZED equals 401
            System.out.println("HttpConnection Unauthorized");
            int contentLength = (int)hc.getLength();
            byte[] raw = new byte[contentLength];
            int length = in.read(raw);
            String s = new String(raw,0,length);
            stringItem.setText(s);
          in.close();
          hc.close();
        catch (IOException ioe) {
          stringItem.setText(ioe.toString());
        finally {
          display.setCurrent(mainForm);
    }---------------SERVLET----------------------------------------------------------------------------
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.*;
    public class LoginServlet extends HttpServlet {
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              HttpSession session = request.getSession();
              response.setContentType("text/plain");
              PrintWriter out = response.getWriter();
              String userID, password, userRole = null;
              try {
                                  userID = (String)request.getParameter("loguserID");
                  password = (String)request.getParameter("logpass");
                  System.out.println(userID); // "Null printed"              System.out.println(password);  // "Null printed"
              catch (Exception e) {
                   //If anything goes wrong, print the Exception message
                  e.printStackTrace(out);
    }Thanks.

    getParameter() can't parse the input stream well if there is any issues in the sent content. this is true, with varying mobile phone http impl.
    You would find the content at servlet, by using request.getInputStream() and reading the entire content.
    Here is the sample code:
    public static String readMobileData(final HttpServletRequest aRequest) throws Exception
         String lData = null;
         Enumeration params = aRequest.getParameterNames();
         while (params.hasMoreElements())
         //from real Nokia 6600 Mobile the request is sent as param, though
         //it is post
         String lName = params.nextElement().toString();
         lData = aRequest.getParameter(lName);
         System.out.println("\nParameter:" + lName + "=" + lData);
         if (lData == null)
         //in emulator the data is coming as inputstream
         ServletInputStream in = aRequest.getInputStream();
         DataInputStream dIn = new DataInputStream(in);
         lData = dIn.readUTF();
         lData = lData.substring(lData.indexOf("=") + 1);
         System.out.println("Stream Request:\n" + lData);
         return lData;
    Regards,
    Raja Nagendra Kumar,
    C.T.O,
    When Teja is Tasked, the Job Gets Done
    www.tejasoft.com

  • Displaying XML Document in new browser window

    Hi,
    I have a hyperlink on my page. When I click on it, it will open a new IE window and display xml document.
    The new window is displaying some of the xml and at the end displaying the following:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    End element was missing the character '>'. Error processing resource 'http://localhost:28080/benchmark/faces/displayXMLDocu...
    However, I cut and paste the xml String where I write it to the HTTPServletResponse to XMLSPY and it displays correctly.
    Please let me know.
    Rgrds

    Here are the steps:
    1. I created page1 that has a hyperlink.
    2. Hyperlink property are set to display page2 in a new window. (popup).
    3. page2.prerender() method, I set the response to the following:
    public void prerender() {
    javax.faces.context.ExternalContext ec = this.getExternalContext();
    HttpServletResponse response = (HttpServletResponse)ec.getResponse();
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Cache-Control","no-store");
    response.setHeader("Cache-Control","must-revalidate");
    response.setHeader("Cache-Control","max-age=0");
    response.setHeader("Pragma","no-cache");
    response.setHeader("Expires","0");
    response.setContentType("text/xml");
    response.setBufferSize(5000);
    String xmlString = getRequestBean1().getBookingPnrDetailsXML();
    try{
    xmlString="<?xml version=\"1.0\" encoding=\"UTF-8\"?><root><test1>this is a test</test1><victor>Hello Victor</victor></root>";
    PrintWriter out = new PrintWriter(response.getOutputStream());
    log(xmlString);
    out.print(xmlString);
    }catch(IOException io){
    System.out.println("" + io.getMessage());
    io.printStackTrace();
    4.page2.jsp code is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/xml;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view/>
    <ui:page binding="#{displayXMLDocument.page1}" id="page1"/>
    <ui:html binding="#{displayXMLDocument.html1}" id="html1"/>
    <ui:head binding="#{displayXMLDocument.head1}" id="head1"/>
    <ui:link binding="#{displayXMLDocument.link1}" id="link1"/>
    <ui:body binding="#{displayXMLDocument.body1}" id="body1"/>
    <ui:form binding="#{displayXMLDocument.form1}" id="form1"/>
    </jsp:root>
    please let me know.
    Rgrds.

Maybe you are looking for