Removing xmlns in child element

Hi,
I am getting xmlns="" in child , i want to remove the xmlns="" from the child element.
Ex: Generated XML File-
<GENERATEFILES xmlns="http://getit.com/generatedFile" >
<GENERATE xmlns="">
</GENERATE >
</GENERATEFILES >
in the code i have added Namespace to display 'xmlns' in' GENERATEFILES ' element,
Element root = new Element("GENERATEFILES ");
Namespace IP_NAMESPACE = Namespace.getNamespace("", "http://getit.com/generatedFile");//added xmlns for GENERATEFILES .
root.setNamespace(IP_NAMESPACE);
Element child = new Element("GENERATE ");

EJP wrote:
The XML means the same thing with and without the internal namespace declarations.I don't believe that's true. If I'm not mistaken, the GENERATEFILES element is in the "http://getit.com/generatedFile" namespace. And since this namespace is declared to be the default namespace, then the GENERATE element would inherit that namespace unless some other declaration was provided. In the example posted there is another declaration provided on the GENERATE element, namely one which declares that the element is in no namespace.
If the OP gets his wish of not having that declaration present, that would result in the GENERATE element also being in the "http://getit.com/generatedFile" namespace, which can (as I believe you meant to say) be arranged by creating the GENERATE element in that namespace.
However the real question for the OP is "What namespace should the GENERATE element be in?" Attempting to control the namespace declarations without understanding them is a bad idea.

Similar Messages

  • How to remove namespace from root-element

    Hi Gurus,
    I want one xml output from xslt transformation with no namespace. I managed to remove namespace from child elements by leveraging elementFormDefault ='unqualified' property of xsd. But not able remove namespace from root-element.
    Output that I want is :
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <inp1:Email_Mod_Root>
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
              <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    Output that I am getting:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <inp1:Email_Mod_Root xmlns:inp1="http://www.example.org">
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
             <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    Anyone, pls suggest.
    Thanks in advance,
    SG_SOA

    First of all :
    <inp1:Email_Mod_Root>
       <Email_Mod_Root_Element>
          <Email_Record1>
             <PERSON_NUMBER>123456</PERSON_NUMBER>
             <COUNTRY/>
              <EMAIL_TYPE>WORK</EMAIL_TYPE>
             <EMAIL>EMAIL3</EMAIL>
             <PRIMARY_FLAG>Y</PRIMARY_FLAG>
          </Email_Record1>
    </Email_Mod_Root_Element>
    </Email_Mod_Root>
    isn't valid xml (you start with inp1: prefix and you end the tag with no prefix, but let's assume you don't want any prefix/namespace at all)
    if i use :
    [code]
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:inp1="http://www.example.org" exclude-result-prefixes="inp1">
      <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="*">
        <xsl:element name="{local-name(.)}">
          <xsl:apply-templates select="@* | node()"/>
        </xsl:element>
      </xsl:template>
      <xsl:template match="@*">
        <xsl:attribute name="{local-name(.)}">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:template>
    </xsl:stylesheet>
    [/code]
    i get this
    [code]
    <Email_Root_Element>
      <Email_Record>
      <EMPLID>EMPLID46</EMPLID>
      <EMAIL>EMAIL48</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE49</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
      <Email_Record>
      <EMPLID>EMPLID47</EMPLID>
      <EMAIL>EMAIL49</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE50</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
      <Email_Record>
      <EMPLID>EMPLID48</EMPLID>
      <EMAIL>EMAIL49</EMAIL>
      <E_ADDR_TYPE>E_ADDR_TYPE51</E_ADDR_TYPE>
      <COUNTRY>US</COUNTRY>
      </Email_Record>
    </Email_Root_Element>
    [/code]

  • How to remove xmlns in node level

    Hi Experts!
    How to remove xmlns in node level in response xml file. I tried to use AF_Modules/XMLAnonymizerBean, but it did not work.
    Can you please help me out on this.
    I want to remvoe  xmlns tag in LEVICOM
    Eg:
    - <Addenda>
       - <LEVICOM xmlns="">
    Thanks,
    Hari

    Hi Expers!
    Please help me out on this. The below xslt mapping working only to remove xmlns prefix in xml file, if parent having only one child. This code is not working if parent having multiple childs.
    Eg:  <parent>
               <phild  xmlns="">
                 test1
                </phild>
            </parent>
    The above example working fine with below xslt mapping to remove xmlns tag.
    Second scenarion  not working
    Eg:  <parent>
              <child1  xmlns="">
                 test1
              </child1>
              <child2  xmlns="">
                  test2
               </child2>
            </parent>
    The above example is not working.
    Here is the code:
    You can remove the namespace prefixes using an XSLT mapping if they are causing problems with applications outside of XI.
    Try the following code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.arconw.com/XI/XSLT_Library/XmlNamespacePrefixRemoval"
    version="1.0">
    <xsl:output method = "xml" />
    <xsl:template match="/">
    <xsl:apply-templates select="*" mode="remprefix"/>
    </xsl:template>
    <xsl:template match="*" mode="remprefix">
    <xsl:variable name="newname" select="local-name(.)"/>
    <xsl:element name="{$newname}" namespace ="{namespace-uri()}">
    <xsl:apply-templates mode="copyall" select="@*|comment()|processing-instruction()|text()"/>
    <xsl:apply-templates select="*" mode="remprefix"/>
    </xsl:element>
    </xsl:template>
    <xsl:template mode="copyall" match="@*|comment()|processing-instruction()|text()">
    <xsl:copy>
    <xsl:apply-templates mode="copyall" select="@*|comment()|processing-instruction()|text()"/>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>
    Thanks,
    Hari

  • Help on creating and deleting xml child elements using Toplink please.

    Hi there,
    I am trying to build a toplink xml demo illustrating toplink acting as the layer between my java code and an xml datasource.
    After pulling my custom schema into toplink and following the steps in http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp3/howto/jaxb/index.htm related to
    Click on Mapping Workbench Project...Click on From XML Schema (JAXB)...
    I am able to set up java code which can run get and sets against my xml datasource. However, I want to also be able create and delete elements within the xml data for child elements.
    i.e. in a simple scenario I have a xsd for departments which has an unbounded element of type employee. How does toplink allow me to add and or remove employees in a department on the marshalled xml data source? Only gets and sets for the elements seem accessible.
    In my experience with database schema based toplink demos I have seen methods such as:
    public void setEmployeesCollection(Collection EmployeesCollection) {
         this.employeesCollection = employeesCollection;
    Is this functionality available for xml backended toplink projects?
    cheers
    Nick

    Hi Nick,
    Below I'll give an example of using the generated JAXB object model to remove and add a new node. The available APIs are defined in the JAXB spec. TopLink also supports mapping your own objects to XML, your own objects could contain more convenient APIs for adding or removing collection members
    Example Schema
    The following XML Schema will be used to generate a JAXB model.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="department">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="employee" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="employee">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>---
    Example Input
    The following document will be used as input. For the purpose of this example this XML document is saved in a file called "employee-data.xml".
    <department>
         <employee>
              <name>Anne</name>
         </employee>
         <employee>
              <name>Bob</name>
         </employee>
    </department>---
    Example Code
    The following code demonstrates how to use the JAXB APIs to remove the object representing the first employee node, and to add a new Employee (with name = "Carol").
    JAXBContext jaxbContext = JAXBContext.newInstance("your_context_path");
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    File file = new File("employee-data.xml");
    Department department = (Department) unmarshaller.unmarshal(file);
    // Remove the first employee in the list
    department.getEmployee().remove(0);
    // Add a new employee
    ObjectFactory objectFactory = new ObjectFactory();
    Employee newEmployee = objectFactory.createEmployee();
    newEmployee.setName("Carol");
    department.getEmployee().add(newEmployee);
    Marshaller marshaller = jaxbContext.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    marshaller.marshal(department, System.out);---
    Example Output
    The following is the result of running the example code.
    <department>
         <employee>
              <name>Bob</name>
         </employee>
         <employee>
              <name>Carol</name>
         </employee>
    </department>

  • Org.xml.sax.SAXException:SimpleDeserializer encountered a child element..

    Hi All,
    I created a following program using "GetReportDefintion" method provided by BI Publisher Web Services
    package bip_webservices;
    import com.oracle.xmlns.oxp.service.PublicReportService.ItemData;
    import com.oracle.xmlns.oxp.service.PublicReportService.ReportRequest;
    import com.oracle.xmlns.oxp.service.PublicReportService.ReportResponse;
    import com.oracle.xmlns.oxp.service.PublicReportService.ParamNameValue;
    import com.oracle.xmlns.oxp.service.PublicReportService.ReportDefinition;
    import com.oracle.xmlns.oxp.service.PublicReportService.ScheduleRequest;
    import com.oracle.xmlns.oxp.service.PublicReportService.DeliveryRequest;
    import com.oracle.xmlns.oxp.service.PublicReportService.EMailDeliveryOption;
    import  java.io.FileOutputStream;
    import  java.io.OutputStream;
    import java.net.MalformedURLException;
    import java.rmi.RemoteException;
    import  java.util.Calendar;
    import javax.xml.rpc.ServiceException;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import org.apache.axis.encoding.ser.BeanDeserializerFactory;
    import org.apache.axis.encoding.ser.BeanSerializerFactory;
    import  javax.xml.namespace.QName;
    import  javax.xml.rpc.ParameterMode;
    import  java.net.URL;
    public class BIP_GetReportDefinition {
        public static void main(String[] args) throws ServiceException, MalformedURLException, RemoteException{
         try{
            final String bipEndpoint = "http://localhost:9704/xmlpserver/services/PublicReportService?wsdl";
            final String bipNamespace = "http://xmlns.oracle.com/oxp/service/PublicReportService";
            final String xdofile = "/MyReports/SummaryCustomerReport/SummaryCustomerReport.xdo";
            Service service = new Service();
            Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(new URL(bipEndpoint));
           System.out.println("BEGIN TESTING getReportDefinition");
            // register the ReportDefinition class
            QName reportDef = new QName(bipNamespace, "ReportDefinition");
            call.registerTypeMapping(ReportDefinition.class, reportDef,
                            BeanSerializerFactory.class, BeanDeserializerFactory.class);
            // register the ParamNameValue class
            QName nmvals = new QName(bipNamespace, "ParamNameValue");
            call.registerTypeMapping(ParamNameValue.class, nmvals, BeanSerializerFactory.class, BeanDeserializerFactory.class);
            call.setOperationName(new QName(bipNamespace, "getReportDefinition"));
            call.addParameter("reportAbsolutePath", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("userID", XMLType.XSD_STRING, ParameterMode.IN);
            call.addParameter("password", XMLType.XSD_STRING, ParameterMode.IN);
            call.setReturnClass(ReportDefinition.class);
            // issue the request
            ReportDefinition reportDefn = (ReportDefinition) call.invoke(
                new Object[] { xdofile, "Administrator", "Administrator"});
            System.out.println("Report Definition Returns with \n Default Output Format = " + reportDefn.getDefaultOutputFormat());
            ParamNameValue params [] = reportDefn.getReportParameterNameValues();
            if (params != null) {
                for (int i = 0; i < params.length; i++) {
                    System.out.print("Parameter " + params.getName() + ":");
    if (params[i].getValues() != null) {
    for (int j = 0; j < params[i].getValues().length; j++)
    System.out.print(" " + params[i].getValues()[j]);
    } else
    System.out.print(" null");
    System.out.println(" - multiple values? " + params[i].isMultiValuesAllowed());
    System.out.println("END TESTING getReportDefinition");
    }catch(Exception e){
    e.printStackTrace();
    I am getting following exception message. Anyone has any ideas what could be the mistake ?
    SEVERE: Exception:
    org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
            at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
            at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
            at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
            at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
            at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
            at org.apache.axis.client.Call.invoke(Call.java:2467)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    faultActor:
    faultNode:
    faultDetail:
            {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
            at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
            at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
            at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
            at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
            at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
            at org.apache.axis.client.Call.invoke(Call.java:2467)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
            {http://xml.apache.org/axis/}hostname:mildh0228
    org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
            at org.apache.axis.client.Call.invoke(Call.java:2470)
            at org.apache.axis.client.Call.invoke(Call.java:2366)
            at org.apache.axis.client.Call.invoke(Call.java:1812)
            at bip_webservices.BIP_GetReportDefinition.main(BIP_GetReportDefinition.java:67)
    Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
            at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
            at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
            at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
            at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
            at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
            at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
            at org.apache.axis.client.Call.invoke(Call.java:2467)
            ... 3 moreThanks for giving this problem a look.
    -Sookie

    Hi Sookie,
    I found the problem is with couple of child parameters are not registered the deserializer. There're couple of additional classes needs to be registerd.
    // register the TemplateLabelValue class
    QName templateval = new QName(bipNamespace, "TemplateFormatLabelValue");
    Class cls = TemplateFormatLabelValue.class;
    call.registerTypeMapping(cls, templateval, BeanSerializerFactory.class, BeanDeserializerFactory.class);
    // register the TemplateLabelValues class
    QName templatevals = new QName(bipNamespace, "TemplateFormatsLabelValues");
    cls = TemplateFormatsLabelValues.class;
    call.registerTypeMapping(cls, templatevals, BeanSerializerFactory.class, BeanDeserializerFactory.class);
    Could you please give it a try?
    Thanks.
    Yang

  • Xmlns in root element

    When converting exchange rates xml from http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
    I'm getting problem with xmlns in root element.
    CALL TRANSFORMATION triggers CX_XSLT_ABAP_CALL_ERROR, but only if there is xmlns attribute in first line in input xml:
    <gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref">
    Without this xmlns=.....  (or when modifying e.g. abcxmlns= ) works following xslt fine:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <xsl:copy>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:template>
      <xsl:template match="Cube/Cube">
        <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
          <asx:values>
            <ROOT2>
              <xsl:value-of select="@time"/>
            </ROOT2>
            <ROOT1>
              <xsl:apply-templates select="Cube"/>
            </ROOT1>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <xsl:template match="Cube/Cube/Cube">
        <loop>
          <AMOUNT>
            <xsl:value-of select="1"/>
          </AMOUNT>
          <CCYCODE>
            <xsl:value-of select="@currency"/>
          </CCYCODE>
          <VALUE>
            <xsl:value-of select="@rate"/>
          </VALUE>
        </loop>
      </xsl:template>
    </xsl:transform>
    I'd appreciate if someone migh advise me how to alternate the xslt or tell me what the xmlns in input does.
    Cheers
    Edited by: Viktor Kunc on Sep 29, 2008 3:25 PM

    If a namespace is specified on root level, it propagates down to all children, see:
    http://www.w3.org/TR/REC-xml-names/scoping
    The namespace is part of a name. So, if you have an element <Cube> as child of the root element <root xmlns="http://www.gesmes.org/xml/2002-08-01">, then
    <xsl:apply-templates select="Cube"/>
    won't be applied, since the qualified name of the element is not Cube but {http://www.gesmes.org/xml/2002-08-01}Cube
    If you want the XSLT to work with and without namespace equally well, you have to work with local names in XPath expressions:
    <xsl:apply-templates select="local-name() = 'Cube'"/>
    The same holds for all XPath functions working with element names.
    Usually, however, the namespace is part of the contract with the client and is
    either obligatory to be used
    or obligatory to be omitted.
    But not both.
    Regards,
    Rüdiger

  • Unable to set Labelfield for child element  in List

    Hi All,
    Below is code I am trying to execute
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="0" xmlns:local="*" height="500" creationComplete="init()" >
    <mx:Script>
    <![CDATA[
    private var arr:Array = [{ firstName: "Alex", children:{lastName: "Abc"}}] 
    private function init():void{list.dataProvider=arr;
    ]]>
    </mx:Script>
    <mx:List variableRowHeight="true" wordWrap="
    true" id="list" labelField="
    chidren.lastName" /></mx:Application>
    I basically want to access the children.lastName on my List. Please let me know how exactly can I do it.

A: Unable to set Labelfield for child element  in List

labelFunction is the best way to do this. The attached code also shows how to do it with an itemRenderer, though that would not be as efficient.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
  xmlns:mx="http://www.adobe.com/2006/mxml"
  layout="horizontal"
  creationComplete="init()" >
  <mx:Script>
    <![CDATA[
      private var arr:Array = [{ firstName: "Alex", children:{lastName: "Abc"}}]
      private function init():void{
        list1.dataProvider=arr;
        list2.dataProvider=arr;
      private function createLabels(item:Object):String{
        return item.children.lastName;
    ]]>
  </mx:Script>
  <mx:List variableRowHeight="true"
    wordWrap="true" id="list1">
    <mx:itemRenderer>
      <mx:Component>
        <mx:Label text="{data.children.lastName}"/>
      </mx:Component>
    </mx:itemRenderer>
  </mx:List>
  <mx:List variableRowHeight="true"
    wordWrap="true" id="list2"
    labelFunction="createLabels"/>
</mx:Application>
If this post answers your question or helps, please mark it as such. Thanks!
http://www.stardustsystems.com
Adobe Flex Development and Support Services

labelFunction is the best way to do this. The attached code also shows how to do it with an itemRenderer, though that would not be as efficient.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
  xmlns:mx="http://www.adobe.com/2006/mxml"
  layout="horizontal"
  creationComplete="init()" >
  <mx:Script>
    <![CDATA[
      private var arr:Array = [{ firstName: "Alex", children:{lastName: "Abc"}}]
      private function init():void{
        list1.dataProvider=arr;
        list2.dataProvider=arr;
      private function createLabels(item:Object):String{
        return item.children.lastName;
    ]]>
  </mx:Script>
  <mx:List variableRowHeight="true"
    wordWrap="true" id="list1">
    <mx:itemRenderer>
      <mx:Component>
        <mx:Label text="{data.children.lastName}"/>
      </mx:Component>
    </mx:itemRenderer>
  </mx:List>
  <mx:List variableRowHeight="true"
    wordWrap="true" id="list2"
    labelFunction="createLabels"/>
</mx:Application>
If this post answers your question or helps, please mark it as such. Thanks!
http://www.stardustsystems.com
Adobe Flex Development and Support Services

  • Intresting problem with JDOM and xmlns in root element.

    Hi all,
    I am trying to parse a xml file using a jdom java code.This code works fine if I remove xmlns attribute in the root element.Please tell me how to fix this issue.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Xml
    <process name="CreateKBEntryService" targetNamespace="http://serena.com/CreateKBEntryService" suppressJoinFailure="yes" xmlns:tns="http://serena.com/CreateKBEntryService" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:bpelx="http://schemas.oracle.com/bpel/extension" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:nsxml0="http://localhost:8080/axis/services/CreateKBEntryService" xmlns:nsxml1="http://DefaultNamespace" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <partnerLinks>
              <partnerLink name="client" partnerLinkType="tns:CreateKBEntryService" myRole="CreateKBEntryServiceProvider"/>
              <partnerLink name="CreateKBEntryPartnerLink" partnerLinkType="nsxml0:CreateKBEntryLink" partnerRole="CreateKBEntryProvider"/>
         </partnerLinks>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
    Java:
    import java.io.*;
    import java.util.*;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    public class sample1 {
    public static void main(String[] args) throws Exception {
    // create a XML parser and read the XML file
    SAXBuilder oBuilder = new SAXBuilder();
    Document oDoc = oBuilder.build(new File("file location "));
         Element root = oDoc.getRootElement();
         System.out.println(root.getName());
         String tgtns= root.getAttributeValue("targetNamespace");
         System.out.println("tgt ns "+ tgtns);
    List list= root.getChildren("partnerLinks");
         Iterator it1= list.iterator();
         System.out.println(list.size());
         while(it1.hasNext()){
              Element partnerlinks = (Element)it1.next();
              List list2= partnerlinks.getChildren("partnerLink");
              System.out.println(list2.size());
              Iterator it2= list2.iterator();
              String[][] partnerLinkval = new String [2][list2.size()];
              int i=0,j=0;
              while(it2.hasNext())
                   Element el2= (Element)it2.next();
              String ElementName = el2.getName();
              partnerLinkval[i][j]= ElementName;
              j++;
              String Attribute = el2.getAttributeValue("myRole");
              partnerLinkval[i][j]= Attribute;
              i++;
              j--;
              System.out.println("Saving in array "+el2.getName());
              System.out.println("Saving in array "+Attribute);
              System.out.println("array length"+partnerLinkval.length);
              for (int l=0;l<2;l++){
              for(int k=0;k<partnerLinkval.length;k++)
                   System.out.println(partnerLinkval[l][k]);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Result:
    Without Xmlns in xml file
    process
    tgt ns http://serena.com/buildserviceflow
    1
    2
    Saving in array partnerLink
    Saving in array BpelServiceFlowProvider
    Saving in array partnerLink
    Saving in array null
    array length2
    partnerLink
    BpelServiceFlowProvider
    partnerLink
    null
    Result with xmlns:
    process
    tgt ns http://serena.com/CreateKBEntryService
    0

    Hi,
    I am also having the same problem using jdom, my code works fine when there is no xmlns attribute but when i put the xmlns attribute back in doesn't work.
    Did you manage to find a way to solve this problem?

  • How to remove xmlns="" from the message

    some reason on the header node in the below message gets xmlns="" when the message is generated from BPEL.
    below is the output that generated. I want to remove xmlns="" from the message.
    <?xml version="1.0" ?><ProductMovementReport xmlns="urn:cidx:names:specification:ces:schema:all:4:0" Version="4.0">
    <Header xmlns="">
    <ThisDocumentIdentifier>
    <DocumentIdentifier>42519</DocumentIdentifier>
    </ThisDocumentIdentifier>
    <ThisDocumentDateTime>
    Can anybody help me please ?

    It's is missing my blog article :-)
    Here it is:
    <?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="comment()|processing-instruction()|/"><xsl:copy><xsl:apply-templates/></xsl:copy></xsl:template><xsl:template match="*"><xsl:element name="{local-name()}"><xsl:apply-templates select="@*|node()"/></xsl:element></xsl:template><xsl:template match="@*"><xsl:choose><xsl:when test="name() != ''xmlns''"><xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute></xsl:when></xsl:choose></xsl:template></xsl:stylesheet>';

  • Error parsing envelope: Header child element must be namespace qualified

    Hey all,
    I'm creating a BPEL process that invokes a web service. The web service has an authenticate method that returns a session ID that I attempt to invoke. However, the process fails when trying to parse the response when invoking that operation. I checked the server logs and it's reporting the following: javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Header child element 'ID' must be namespace qualified!
    So I invoked the authenticate operation using SOAP UI, since it doesn't parse the response but merely displays it, and here's what was returned (slightly modified):
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header>
          <ID>xxx</ID>
       </soapenv:Header>
       <soapenv:Body>
          <ns1:SessionID xmlns:ns1="http://some-namespace">
             <ns1:ID>xxx</ns1:ID>
          </ns1:SessionID>
       </soapenv:Body>
    </soapenv:Envelope>
    Indeed the ID tag in the header doesn't have a namespace prefix. Looking at the SOAP 1.1 spec it says, “A header entry is identified by its fully qualified element name, which consists of the namespace URI and the local name. All immediate child elements of the SOAP Header element MUST be namespace-qualified.”
    I was told that the code for the web service is frozen and cannot be changed. Are there any ways around this problem? Is it possible for the BPEL process to not parse the SOAP header?
    Thanks,
    Bill

    All,
    I think I might use a HeaderHandler to either strip the offending element from the header all together or modify it so that it's namespace qualified. The problem is, I can't find much documentation on it. The only thing I can find is this: Manipulating XML Data in BPEL section 3.19. It says to implement the HeaderHandler interface but doesn't give the fully qualified name of the interface. I'm guessing it's referring to com.collaxa.cube.ws.HeaderHandler. The invoke method that is defined in the interface is a little different than the one in the documentation. Mine has a signature of public void invoke(CXPartnerLink partnerLink, String operationName, Map payload, List list, Map map2)...what do these parameters represent and what key/value types do the maps have? It also says to register the handler in the bpel.xml deployment descriptor file but I can't find one - is it auto-generated? If so, where is it. If not, how do I generate it? I appreciate any information.
    Thanks,
    Bill

  • Header child element 'WSCorIDSOAPHeader' must be namespace qualified!

    I have two machines. The first machine have an OSB managed server and admin server. The second machine have a SOA managed server, admin server and enterprise manager.
    A service call in OSB is redirect do SOA Server (BPEL process).
    After the route the follow message error show in SOA Server log.
    INFO: FabricProviderServlet.stateChanged SOA Platform is running and accepting requests
    javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Header child element 'WSCorIDSOAPHeader' must be namespace qualified!
         at oracle.j2ee.ws.saaj.soap.AbstractSOAPImplementation.createEnvelope(AbstractSOAPImplementation.java:137)
         at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:95)
         at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:64)
         at oracle.j2ee.ws.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1572)
         at oracle.j2ee.ws.common.soap.SoapUtils.getSOAPBodyFirstChildQName(SoapUtils.java:249)
         at oracle.j2ee.ws.server.mgmt.runtime.model.WebServiceOperationModelHelper.getOperationModelFromInputMessage(WebServiceOperationModelHelper.java:139)
         at oracle.j2ee.ws.server.provider.ProviderPort.getOperationModelFromInputMessage(ProviderPort.java:986)
         at oracle.j2ee.ws.server.mgmt.runtime.SuperServerInterceptorPipeline.handleRequest(SuperServerInterceptorPipeline.java:132)
         at oracle.j2ee.ws.server.provider.management.AbstractProviderInterceptorPipeline.executeRequestInterceptorChain(AbstractProviderInterceptorPipeline.java:563)
         at oracle.j2ee.ws.server.provider.ProviderProcessor.executeInterceptorRequestChain(ProviderProcessor.java:921)
         at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:231)
         at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:193)
         at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:459)
         at oracle.integration.platform.blocks.soap.FabricProviderServlet.doPost(FabricProviderServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused By: javax.xml.soap.SOAPException: Header child element 'WSCorIDSOAPHeader' must be namespace qualified!
         at oracle.j2ee.ws.saaj.soap.HeaderImpl.createChildElement(HeaderImpl.java:213)
         at oracle.j2ee.ws.saaj.soap.ElementImpl.createAndAppendChildElement(ElementImpl.java:827)
         at oracle.j2ee.ws.saaj.soap.StaxHandler.startElement(StaxHandler.java:222)
         at oracle.j2ee.ws.saaj.soap.StaxHandler.staxParse(StaxHandler.java:82)
         at oracle.j2ee.ws.saaj.soap.StaxHandler.staxParse(StaxHandler.java:70)
         at oracle.j2ee.ws.saaj.soap.AbstractSOAPImplementation.getStaXParsedEnvelope(AbstractSOAPImplementation.java:204)
         at oracle.j2ee.ws.saaj.soap.AbstractSOAPImplementation.createEnvelope(AbstractSOAPImplementation.java:58)
         at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:95)
         at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:64)
         at oracle.j2ee.ws.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.java:1572)
         at oracle.j2ee.ws.common.soap.SoapUtils.getSOAPBodyFirstChildQName(SoapUtils.java:249)
         at oracle.j2ee.ws.server.mgmt.runtime.model.WebServiceOperationModelHelper.getOperationModelFromInputMessage(WebServiceOperationModelHelper.java:139)
         at oracle.j2ee.ws.server.provider.ProviderPort.getOperationModelFromInputMessage(ProviderPort.java:986)
         at oracle.j2ee.ws.server.mgmt.runtime.SuperServerInterceptorPipeline.handleRequest(SuperServerInterceptorPipeline.java:132)
         at oracle.j2ee.ws.server.provider.management.AbstractProviderInterceptorPipeline.executeRequestInterceptorChain(AbstractProviderInterceptorPipeline.java:563)
         at oracle.j2ee.ws.server.provider.ProviderProcessor.executeInterceptorRequestChain(ProviderProcessor.java:921)
         at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:231)
         at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:193)
         at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:459)
         at oracle.integration.platform.blocks.soap.FabricProviderServlet.doPost(FabricProviderServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    >
    What is WSCorIDSOAPHeader ???

    Remove Introscope agend configuration temporarily from yours managed servers and try call the service.
    This is the cause of your problem.
    Contact your Introscope Administration and task about the problem of Introscope + OSB + BPEL (SOA Server).
    Workaround:
    Remove Introscope agend configuration temporarily from yours managed servers and try call the service.

  • SimpleDeserializer encountered a child element..webservice error

    when I invoke a webservice using Oracle stored procedure,I'm getting the fault response below :
    HTTP response status code: 500
    HTTP response reason phrase: Internal Server Error
    <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element,
    which is NOT expected, in something it was trying to deserialize.</faultstring><detail><ns1:hostname
    xmlns:ns1="http://xml.apache.org/axis/">suznt266.qintra.com</ns1:hostname></detail></soapenv:Fault>
    </soapenv:Body></soapenv:Envelope>
    Any ideas about the cause and resolution?..
    Thanks in advance!!!!
    Regards,
    Bhagat

    If you posted the whole WSDL file, it would be more helpful.
    I suppose your WSDL uses rpc/encoding. Both operations in your WSDL expects only one parameter of xsd:float. Well your client code passed an array float(new Object[] {new Float(3)}).
    This should have caused the exception.

  • ADF Faces showDetailItem seems to "load" child elements twice on tab select

    Problem Summary:
    Child elements of showDetailItem are being loaded/executed twice. The parent of the showDetailItem is a showOneTab, and the child of showDetailItem is an af:objectImage, which calls a servlet I have written that outputs an image.
    The problem I am having is that when I click on a tab (showDetailItem) my servlet is called twice. It is as if the af:objectImage line of my JSP is executed twice.
    I have proven this with breakpoints in the servlet and printing a message to the console. The doGet() method of my servlet is called twice. Using breakpoints in the JSP I see the JSP is executed/read only once.
    Details:
    I am requesting help with this problem as I cannot solve it one my own. I have tried the following, but have had no success.
    1. Searched the web for a similar problem.
    2. Searched this forum for a similar problem.
    3. Consulted the ADF Developer Guide version 10.1.3.0
    4. Upgraded my version of JDeveloper to 10.1.3.2.0, which has ADF Faces (oracle.faces.dt) version 10.1.3.40.66.
    5. Debugging with print statements and stepping through JSP and servlet code.
    6. Created the simplest JSP possible that I could still produce the problem with.
    The Scenario:
    My goal is to use the ADF Faces showOneTab and showDetailItem tags to create two tabbed panels that will contain a blank tab (tab one) and an image (on tab 2).
    I have written a servlet, BrowserImage, which takes and ID as a parameter retrieves a BLOB from view object and then outputs a jpeg image to the browser. This is done by using the af:objectImage tag and specifying my servlet in the source parameter. The image is displayed fine, but I don't want the servlet to be called twice for performance reasons.
    Here is the simplest JSP that contains the problem.
    Note: I tried to simplify even more by calling the servlet in different ways (jsp:include etc..), but was unable to produce the problem. I think it is key that I call the servlet using an ADF Faces tag (af:objectImage).
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ page import="javax.faces.context.FacesContext"%>
    <%@ page import="javax.faces.el.ValueBinding"%>
    <%@ page import="oracle.adf.model.BindingContext"%>
    <%@ page import="oracle.adf.model.binding.DCDataControl"%>
    <%@ page import="oracle.jbo.ApplicationModule"%>
        <%! FacesContext fc = FacesContext.getCurrentInstance(); %>
        <%! ValueBinding vb = fc.getApplication().createValueBinding("#{data}"); %>
        <%! BindingContext bc = (BindingContext)vb.getValue(fc); %>
        <%! DCDataControl dc = bc.findDataControl("AdSearchAppModuleDataControl"); %>
        <%! ApplicationModule am = (ApplicationModule)dc.getDataProvider();%>
        <% session.setAttribute("theAm", am); %>  
    <f:view>
      <afh:html>
        <afh:head title="showOneTest">
          <meta http-equiv="Content-Type"
                content="text/html; charset=windows-1252"/>
        </afh:head>
        <afh:body>
          <af:form>
            <af:showOneTab position="above">
              <af:showDetailItem text="showDetailItem 1">
              </af:showDetailItem>
              <af:showDetailItem text="showDetailItem 2">
                <af:objectImage source="/BrowserImage?imgId=1"/>
              </af:showDetailItem>
            </af:showOneTab>
          </af:form>
        </afh:body>
      </afh:html>
    </f:view>Note: The Java Script code included in the JSP is used to get an application module instance and pass it to my servlet in the session scope, so my servlet can access a view object, which contains the BLOB to output. I thought I should explain this as it may look confusing.
    Any help would be appreciated.
    Thanks,
    Mark

    I don't think adding a flag to my servlet will work. I left out some details in the original posting that will likely make the flag solution unusable.
    It is true that when I click on a tab that my servlet is called twice. My main goal is to ensure that the BrowserImage servlet only called when truly needed. The part I left out of the original posting is that if I click on a tab for the first time I can see my messages in the console indicating it was called twice.
    . BrowserImage severlet called (doGet)
    . BrowserImage servlet called (doGet)
    The key is if I click on the tab again I only see the message appear once.
    . BrowserImage severlet called (doGet)
    At first I thought this was the correct behavior, but I now feel this is wrong as I think the image is being cached locally on the client browser by ADF Faces, so the first call to BrowserImage is not made, but for some reason on the second "load" of the panel the BrowserImage servlet is called.
    To summarize the new details, I still think the showDetailItem is "loading" twice, but BrowserImage is only being called once, because the first loading used a locally cached image. This is my best guess, I did not prove this 100%. I did prove that the image is shown on the page before my servlet outputs it this made me start thinking about the client cache. Also I think it is an ADF Faces specific cache because if I use the "img" tag I don't think caching is used and the image is output by the call to my servlet. I don't want to use img for two reasons, 1 I would d like to use the client cache, 2 the img tag will not stay inside the showDetailItem, showDetail Item needs af: components as children it seems.
    So the reason I feel this problem can't be solved with a flag is because I think the image will be cached on the client side and if the showDetailItem is loaded twice it seems my servlet is called once, but it was not required to be called to render the image. I can't use the concept of checking for the servlet being called by the same session in very quick succession, because the real problem I am trying to solve is the servlet should not be called at all, if the client cache had been used.
    Perhaps there is a way for my servlet to determine if the client cache was used, but I have no idea how.
    I should also point out I am displaying images in a table instead of a showOneTab using the same servlet and technique and the client cache is always used correctly, the BrowserImage is only called if the image is not cached on the client. This is why I think this is a showOneTab problem.
    Sorry for leaving out these details, but I did not want to confuse the original posting with too much info. I figured if the tab was only loaded once, the cached image would be used and all would be good.
    Again if you can provide more help I really appreciate it.

  • SimpleDeserializer encountered a child element ... Please HELP!!!!

    Good Morning Everyone,
    I want to thank you for reading my problem and see if you can help me. The deadline for this project is monday and I am struggling to make it work. I am using axis 1.4 .
    I created the web method
    public void GetFilters( javax.xml.rpc.holders.BooleanHolder GetFiltersResult, CCRFiltersHolder CCRFilters,
    javax.xml.rpc.holders.StringHolder Message, javax.xml.rpc.holders.StringHolder XMLData ){
    First, I needed to create the CCRFilters as a CCRFiltersHolder because is an IN/OUT parameter.
    public class CCRFiltersHolder implements javax.xml.rpc.holders.Holder{
    public CCRFiltersList value;
    public CCRFiltersHolder() {
    public CCRFiltersHolder(CCRFiltersList value) {
    this.value = value;
    public class CCRFiltersList implements Serializable{
    private CCRFilters[] filterList;
    public CCRFilters[] getFilterList() {
    return filterList;
    public void setFilterList(CCRFilters[] filterList) {
    this.filterList = filterList;
    public CCRFilters getFilterList(int index) {
    return filterList[index];
    public void setFilterList(int index, CCRFilters filterList) {
    this.filterList[index] = filterList;
    public class CCRFilters implements Serializable {
    private String FieldName;
    private String RelationShip;
    public String getFieldName() {
    return FieldName;
    public void setFieldName(String pFieldName) {
    FieldName = pFieldName;
    public String getRelationShip() {
    return RelationShip;
    public void setRelationShip(String pRelationShip) {
    RelationShip = pRelationShip;
    My wsdd file looks like:
    <service name="CCR" provider="java:RPC" style="wrapped" use="literal" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <parameter name="className" value="com.harris.mercury.gemsccrintegration.CCR"/>
    <parameter name="allowedMethods" value="*"/>
    <parameter name="typeMappingVersion" value="1.2"/>
    <namespace>http://tempuri.org/</namespace>
    <parameter name="schemaUnqualified" value="http://www.gemsgov.com/CCR/"/>
    <parameter name="wsdlServicePort" value="CCRPort"/>
    <operation name="GetFilters" soapAction="http://www.gemsgov.com/CCR/GetFilters" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <parameter name="GetFiltersResult" type="xs:boolean" mode="OUT"/>
    <parameter name="CCRFilters" mode="INOUT" type="rtns:CCRFiltersHolder" xmlns:rtns="http:////www.gemsgov.com/CCR/GetFilters"/>
    <parameter name="Message" type="xs:string" mode="INOUT"/>
    <parameter name="XMLData" type="xs:string" mode="INOUT"/>
    </operation>
    <typeMapping
    xmlns:ns="http://www.gemsgov.com/CCR/GetFilters" qname="ns:CCRFiltersHolder"
    type="java:com.harris.mercury.cashiering.gemsintegration.holder.CCRFiltersHolder"
    serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
    deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
    encodingStyle=""
    />
    <typeMapping
    xmlns:ns1="http://www.gemsgov.com/CCR/GetFilters" qname="ns1:CCRFiltersList"
    type="java:com.harris.mercury.cashiering.gemsintegration.CCRFiltersList"
    serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
    deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
    encodingStyle=""
    />
    <typeMapping
    xmlns:ns2="http://www.gemsgov.com/CCR/GetFilters"
    qname="ns2:CCRFilters"
    type="java:com.harris.mercury.cashiering.gemsintegration.CCRFilters"
    serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
    deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
    encodingStyle=""
    />
    <typeMapping xmlns:soapenc="http://www.gemsgov.com/CCR/GetFilters"
    qname="soapenc:CCRFiltersArray"
    type="java:com.harris.mercury.cashiering.gemsintegration.CCRFilters[]"
    serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
    deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
    encodingStyle=""
    />
    </service>
    Even in my test program, I added the following code :
    Call call = (Call) service.createCall();
    QName qn = new QName( "http://www.gemsgov.com/CCR/GetFilters", "CCRFiltersHolder" );
    call.registerTypeMapping("com.harris.mercury.cashiering.gemsintegration.holder.CCRFiltersHolder".getClass(), qn,
    BeanSerializerFactory.class, BeanDeserializerFactory.class);
    QName qn4 = new QName( "http://www.gemsgov.com/CCR/GetFilters", "CCRFiltersList" );
    call.registerTypeMapping(CCRFiltersList.class, qn4,BeanSerializerFactory.class, BeanDeserializerFactory.class);
    QName qn1 = new QName( "http://www.gemsgov.com/CCR/GetFilters", "CCRFilters" );
    call.registerTypeMapping(CCRFilters.class, qn1, BeanSerializerFactory.class, BeanDeserializerFactory.class);
    QName qn3 = new QName( "http://schemas.xmlsoap.org/soap/encoding", "CCRFiltersArray" );
    call.registerTypeMapping(CCRFilters[].class, qn3, new ArraySerializerFactory(), new ArrayDeserializerFactory());
    But when running, everytime I get the following message : SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    Please any help whould be appreciate it.
    Thanks a lot,
    Martha
    Edited by: Melliza on Sep 25, 2009 10:00 AM

    Hi,
    Regarding to the query which I have posted may have following possibility.
    This error may be due to the arguments which it gives as the output, as some of those arguments are the object of some other class.
    As the web service which I am trying to access is developed in .Net and requires three parameters, out of which one parameter named as "name" is input parameter while the other two are the output parameters, which web service provide as output. And may be the output which it provides may also be developed in .Net only and thats why while passing the input variable, it is not able to convert its output variable into the String.
    Please provide your valuable comments and solution to that.
    Thanks

  • WSDL & local qualified accessors (complex type - child elements)

    Why does the WLS8.1 generated WSDL file specify
    elementFormDefault="qualified" in the schema for complex types.
    The resulting runtime SOAP bodies that are sent have unqualified child
    elements and tools like JAX-RPC, determine from the WSDL schema that these
    child elements SHOULD be qualified and fail to parse the body. I understand
    that the spec states that they should not be qualified but then why does the
    schema not specify
    elementFormDefault="unqualified"?
    I have to manually edit the WSDL (to say "unqualified") to generate a client
    using JAX-RPC.
    Is there some way I can tell <wsdlgen> task to do this?
    Thanks,
    M
    Here's the excerpt from my WLS 8.1 generated WSDL file:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tp="java:com.xxx.framework.persist"
    xmlns:stns="java:com.xxx.businessservices.indexservice.valueobjects"
    elementFormDefault="qualified"
    attributeFormDefault="qualified"
    targetNamespace="java:com.xxx.businessservices.indexservice.valueobjects">
    <xsd:import namespace="java:com.xxx.framework.persist" />
    <xsd:import namespace="java:language_builtins.util" />
    <xsd:complexType name="IndexVO">
    <xsd:complexContent>
    <xsd:extension xmlns:tp="java:com.xxx.framework.persist"
    base="tp:FW_PersistentObject">
    <xsd:sequence>
    <xsd:element type="xsd:string" name="code" minOccurs="1" nillable="true"
    maxOccurs="1" />
    <xsd:element type="xsd:string" name="description" minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:long" name="indexID" minOccurs="1" maxOccurs="1"
    />
    <xsd:element type="stns:IndexProviderVO" name="indexProviderVO"
    minOccurs="1" nillable="true" maxOccurs="1" />
    <xsd:element type="stns:IndexSourceVO" name="indexSourceVO" minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:string" name="name" minOccurs="1" nillable="true"
    maxOccurs="1" />
    <xsd:element type="xsd:dateTime" name="nextUpdateDate" minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:long" name="providerID" minOccurs="1"
    maxOccurs="1" />
    <xsd:element type="xsd:long" name="scheduleID" minOccurs="1"
    maxOccurs="1" />
    <xsd:element type="stns:UpdateScheduleVO" name="scheduleVO" minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:long" name="sourceID" minOccurs="1" maxOccurs="1"
    />
    <xsd:element xmlns:tp="java:language_builtins.util" type="tp:List"
    name="updateFrequencies" minOccurs="1" nillable="true" maxOccurs="1" />
    <xsd:element xmlns:tp="java:com.xxx.framework.persist"
    type="xsd:dateTime" name="updatesDisabledDate" minOccurs="1" nillable="true"
    maxOccurs="1" />
    <xsd:element xmlns:tp="java:language_builtins.util" type="tp:List"
    name="values" minOccurs="1" nillable="true" maxOccurs="1" />
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    "Scott Ziegler" <[email protected]> wrote in message
    news:[email protected]...
    On Mon, 21 Jul 2003 09:31:45 -0500, Mark Fine wrote:
    I've been debugging an XML-RPC generated client and came across the
    following problem:
    I have a webserice serialized Object, "IndexVO" that has an attribute
    (ie.
    element) "code".
    The WLS8.1 generated WSDL schema declares that code is in the
    "com...valueobjects" namespace by virtue of a default (target)namespace.
    At runtime, the SOAP envelope that is created seems to put the
    attribute/element "code" in the EMPTY namespace, and not in the
    "com...valueobjects" namespace. The XML-RPC generated client code is
    looking for "code" in the "com...valueobjects" namespace and skips overit
    because it is in the "", blank namespace (according to the XML parser).
    I'm not a XML expert but from what I can tell, the SOAP envelope that is
    returned does not match the WSDL file with respect to the namespace ofthe
    attributes in IndexVO.
    Am I reading this wrong?We did this for interoperability reasons. Some other stacks that we were
    trying to work with would not work if those elements were qualified. The
    problem really stems from SOAP 1.1:http://www.w3.org/TR/SOAP/#_Toc478383520
    >
    "Accessors whose names are local to their containing types have
    unqualified element names; all others have qualified names."
    SOAP stacks that are not schema aware basically require this behavior.
    You might try using a doc-literal service (which is more faithful to the
    schema) if that fits your situation.
    --Scott

    Currently there is no option to make elementFormDefault
    unqualified. I filed an enhancement CR (112776).
    Regards,
    -manoj
    http://manojc.com
    "Mark Fine" <[email protected]> wrote in message
    news:[email protected]...
    Why does the WLS8.1 generated WSDL file specify
    elementFormDefault="qualified" in the schema for complex types.
    The resulting runtime SOAP bodies that are sent have unqualified child
    elements and tools like JAX-RPC, determine from the WSDL schema that these
    child elements SHOULD be qualified and fail to parse the body. Iunderstand
    that the spec states that they should not be qualified but then why doesthe
    schema not specify
    elementFormDefault="unqualified"?
    I have to manually edit the WSDL (to say "unqualified") to generate aclient
    using JAX-RPC.
    Is there some way I can tell <wsdlgen> task to do this?
    Thanks,
    M
    Here's the excerpt from my WLS 8.1 generated WSDL file:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tp="java:com.xxx.framework.persist"
    xmlns:stns="java:com.xxx.businessservices.indexservice.valueobjects"
    elementFormDefault="qualified"
    attributeFormDefault="qualified"
    targetNamespace="java:com.xxx.businessservices.indexservice.valueobjects">
    <xsd:import namespace="java:com.xxx.framework.persist" />
    <xsd:import namespace="java:language_builtins.util" />
    <xsd:complexType name="IndexVO">
    <xsd:complexContent>
    <xsd:extension xmlns:tp="java:com.xxx.framework.persist"
    base="tp:FW_PersistentObject">
    <xsd:sequence>
    <xsd:element type="xsd:string" name="code" minOccurs="1"nillable="true"
    maxOccurs="1" />
    <xsd:element type="xsd:string" name="description" minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:long" name="indexID" minOccurs="1" maxOccurs="1"
    />
    <xsd:element type="stns:IndexProviderVO" name="indexProviderVO"
    minOccurs="1" nillable="true" maxOccurs="1" />
    <xsd:element type="stns:IndexSourceVO" name="indexSourceVO"minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:string" name="name" minOccurs="1"nillable="true"
    maxOccurs="1" />
    <xsd:element type="xsd:dateTime" name="nextUpdateDate" minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:long" name="providerID" minOccurs="1"
    maxOccurs="1" />
    <xsd:element type="xsd:long" name="scheduleID" minOccurs="1"
    maxOccurs="1" />
    <xsd:element type="stns:UpdateScheduleVO" name="scheduleVO"minOccurs="1"
    nillable="true" maxOccurs="1" />
    <xsd:element type="xsd:long" name="sourceID" minOccurs="1"maxOccurs="1"
    />
    <xsd:element xmlns:tp="java:language_builtins.util" type="tp:List"
    name="updateFrequencies" minOccurs="1" nillable="true" maxOccurs="1" />
    <xsd:element xmlns:tp="java:com.xxx.framework.persist"
    type="xsd:dateTime" name="updatesDisabledDate" minOccurs="1"nillable="true"
    maxOccurs="1" />
    <xsd:element xmlns:tp="java:language_builtins.util" type="tp:List"
    name="values" minOccurs="1" nillable="true" maxOccurs="1" />
    </xsd:sequence>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    "Scott Ziegler" <[email protected]> wrote in message
    news:[email protected]...
    On Mon, 21 Jul 2003 09:31:45 -0500, Mark Fine wrote:
    I've been debugging an XML-RPC generated client and came across the
    following problem:
    I have a webserice serialized Object, "IndexVO" that has an attribute
    (ie.
    element) "code".
    The WLS8.1 generated WSDL schema declares that code is in the
    "com...valueobjects" namespace by virtue of a default (target)namespace.
    At runtime, the SOAP envelope that is created seems to put the
    attribute/element "code" in the EMPTY namespace, and not in the
    "com...valueobjects" namespace. The XML-RPC generated client code is
    looking for "code" in the "com...valueobjects" namespace and skips
    over
    it
    because it is in the "", blank namespace (according to the XML
    parser).
    >>>
    I'm not a XML expert but from what I can tell, the SOAP envelope thatis
    returned does not match the WSDL file with respect to the namespace ofthe
    attributes in IndexVO.
    Am I reading this wrong?We did this for interoperability reasons. Some other stacks that we
    were
    trying to work with would not work if those elements were qualified.The
    problem really stems from SOAP 1.1:
    http://www.w3.org/TR/SOAP/#_Toc478383520
    "Accessors whose names are local to their containing types have
    unqualified element names; all others have qualified names."
    SOAP stacks that are not schema aware basically require this behavior.
    You might try using a doc-literal service (which is more faithful to the
    schema) if that fits your situation.
    --Scott

  • Maybe you are looking for

    • Problems printing with Officejet 7410 with Windows XP

      Hi I have an Officejet 7410 set up at home on my woriesless network. For the last two months it has been working perfectly this way, I have two laptops that print to it, one that runs on Windows 7 and one on Windows XP that have both have the most up

    • InCopy Crashes at launch

      One of my coworkers is having trouble launching InCopy. It gets part-way through the launch sequence then quits. I have had him repair disk permissions and fix disk errors. Here is the top part of the error report: <?xml version="1.0" encoding="UTF-8

    • Where are Image Trace custom presets saved?

      I had to reinstall CS6 and am now looking for my old AI Image Trace custom presets. I'd like to restore them if possible from a Time Machine backup so I don't have to recreate a setting, but I can't seem to find where those are located. Can someone p

    • HT3421 I run Mac OSX 10.6.8 Snow:  Downloaded this battery firmware update, it tells me I need OSX Tiger 10.4.11 , Leopard 10.5.6 or newer.... WTH?

      I run Mac OSX Snow Leopard 10.6.8  -----> I downloaded this battery firmware update and upong launching the update it tells me that I need OSX Tiger 10.4.11 , Leopard 10.5.6 or newer. Then the updater quits automatically. Can anyone plese help me? Wh

    • IMessage videochat won't work on MacBook pro?

      If a friend calls me, it just has the preview window up and nothing else happens -- on their side, it says the call failed. If I try to start the videochat, it pops up with an error. This is only a recent issue. I have all of my updates done on my la