XML objects

can anyone tell me about what are XML objects ? (r they different from a XML file)
is it some special way of writing a xml file
and can these XML objects be transferred over HTTP ? anything diff then transferring a xml file ?

Maybe you mean XML parsers objects

Similar Messages

  • Reading XML object from Request object

    Hi,
    We are using Flash in our web application in which we are sending an XML object using HTTP post method to a JSP where we need to parse the XML object and get the values. Can anyone tell how we can do it?

    In fact we are not getting error in our page. following is the error
    Error: 500
    Location: /team/par/getData10.jsp
    Internal Servlet Error:
    java.lang.IllegalArgumentException
         at javax.servlet.http.HttpUtils.parseQueryString(HttpUtils.java:151)
         at javax.servlet.http.HttpUtils.parsePostData(HttpUtils.java:254)
         at org.apache.tomcat.util.RequestUtil.readFormData(RequestUtil.java:101)
         at org.apache.tomcat.core.RequestImpl.handleParameters(RequestImpl.java:719)
         at org.apache.tomcat.core.RequestImpl.getParameterValues(RequestImpl.java:259)
         at org.apache.tomcat.core.RequestImpl.getParameter(RequestImpl.java:250)
         at org.apache.tomcat.facade.HttpServletRequestFacade.getParameter(HttpServletRequestFacade.java:223)
         at org.apache.jasper.servlet.JspServlet.preCompile(JspServlet.java:437)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:480)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread

  • Passing data from an XML object to an itemRenderer

    I'm trying to color the background of a column in a datagrid and have found a sample file that illustrate the concept. However, the sample has data stored in an arrayCollection whereas mine is in an XML object. The problem is that the data in the sample file is apparently automatically passed to the itemRenderer (shown below: note the trace statement). My XML object does not appear to automatically pass data to the itemRenderer. So my questions are:
    1. Is there a simple way to pass data stored in an XML object to an itemRenderer
    or
    2. Should I convert my XML to an arrayCollection? If so, what's the best way to do this-- I've tried the following, but without success:
    <mx:Model id="xmldata" source="example3.xml"/>
      <mx:ArrayCollection id="myAC" source="{ArrayUtil.toArray(xmldata.Example1)}" />
    Here's what the xml looks like:
    <TABLE>
       <EXAMPLE1>
          <difficulty> 0.5 </difficulty>
          <discrimination> 0.7 </discrimination>
          <item> 3 </item>
       </EXAMPLE1>
    </TABLE>  
    Here's the itemRenderer:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml">
        <!--
            This item renderer simply extends Label and overrides the updateDisplayList function to
            draw a gradient-filled rectangle. The colors in the gradient are determined from the
            data.
        -->
        <mx:Script>
        <![CDATA[
            import flash.geom.Matrix;
            import flash.display.GradientType;
            import flash.display.Graphics;
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                super.updateDisplayList(unscaledWidth,unscaledHeight);
                var m:Matrix = new Matrix();
                m.createGradientBox(unscaledWidth,unscaledHeight);
                var g:Graphics = graphics;
                            trace("data.col3="+data.col3)
                var colors:Array = (data.col3 < 2000 ? [0x0000CC,0x0000FF] : [0x00CC00,0x00FF00]);
                g.clear();
                g.beginGradientFill(GradientType.LINEAR, colors, [0.2,0.6], [0,255], m);
                // the rectangle is drawn a little high and a little tall to compensate for the gap
                // the DataGrid introduces between rows.
                g.drawRect(0, -2, unscaledWidth, unscaledHeight+4 );
                g.endFill();
        ]]>
        </mx:Script>
    </mx:Label>

    This sample code should answer your question of how to bring data into the renderer automatically. It comes in via the DataGrid dataProvider and then you refer to it in the renderer as data.XYZ, where XYZ is the field in the XML with the data. See FB 3 help sys on e4x syntax.
    ------------------ mainapp.mxml --------------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="srvc.send();">
      <mx:Script>
        <![CDATA[
          import mx.rpc.events.ResultEvent;
          import mx.collections.XMLListCollection;
          [Bindable] private var xlc:XMLListCollection;
          private function dataHandler(evt:ResultEvent):void{
            xlc = new XMLListCollection(evt.result..EXAMPLE1 as XMLList);
        ]]>
      </mx:Script>
      <mx:HTTPService id="srvc" url="data2.xml" result="dataHandler(event)"
        resultFormat="e4x"/>
      <mx:DataGrid dataProvider="{xlc}">
        <mx:columns>
          <mx:DataGridColumn headerText="Difficulty" dataField="difficulty"/>
          <mx:DataGridColumn headerText="Discrimination" dataField="discrimination"/>
          <mx:DataGridColumn headerText="Item" itemRenderer="MyLabel"/>
        </mx:columns>
      </mx:DataGrid>
    </mx:Application>
    ----------- MyLabel.mxml --------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import flash.geom.Matrix;
          import flash.display.GradientType;
          import flash.display.Graphics;
          override protected function updateDisplayList(unscaledWidth:Number,
            unscaledHeight:Number):void{
            super.updateDisplayList(unscaledWidth,unscaledHeight);
            this.text = data.col3;
            var m:Matrix = new Matrix();
            m.createGradientBox(unscaledWidth,unscaledHeight);
            var g:Graphics = graphics;
            var colors:Array = (data.col3 < 2000 ? [0x0000CC,0x0000FF] : [0x00CC00,0x00FF00]);
            g.clear();
            g.beginGradientFill(GradientType.LINEAR, colors, [0.2,0.6], [0,255], m);
            g.drawRect(0, -2, unscaledWidth, unscaledHeight+4 );
            g.endFill();
        ]]>
      </mx:Script>
    </mx:Label>
    ------------ data2.xml ----------------
    <?xml version="1.0" encoding="utf8"?>
    <TABLE>
       <EXAMPLE1>
          <difficulty> 0.5 </difficulty>
          <discrimination> 0.7 </discrimination>
          <col3> 3 </col3>
       </EXAMPLE1>
    </TABLE>

  • Placing a variable value into an XML Object

    I am trying to figure out how I would get the value of a variable into an XML Object.
    I have the variable
    var dragonName:String = "Samuel";
    var listing:XML = new XML();
    listing = <thedragon>
                            <dragon>
                                  <myname> dragonName.valueOf()</myname>
                             </dragon>
                   </thedragon>
    However, the dragon name does not show up when I go trace(listing);
    How do I do it and should I have imported something as well or what?

    yeah - in fact you can do all sort of things. This is extremely useful when you creating an XML dynamically e.g.
    var names:Array = ["Sammy", "Samuel", "Sancho"];
    var xml:XML =     <dragon>
                         <myname>{Math.floor(Math.random()*names.length) < 2 ? names[1] : names[Math.round(Math.PI) - 1]}</myname>
                      </dragon>;
    or you can even run a function:
    var xml:XML =     <dragon>
                         <myname>{dragonName()}</myname>
                      </dragon>;
    private function dragonName():String {
       return "Samuel";

  • Calling Bpel Process From a Jsp(Need a string output instead of XML object)

    Hi
    I am calling a BPEL process(Synchrononus) from a JSP page, Where Bpel process calls a java web service.The output from Bpel process is returned as an XML object. I need the output in a string format.Please let me know the steps to get the string output.
    I also executed invokeCreditRatingService.jsp(from samples shipped with SOA Suite) that calls CreditRatingService bpel, but i was getting the following output where the rating value is printed as an XML object.
    Output:-
    BPELProcess CreditRatingService executed!
    Credit Rating is oracle.xml.parser.v2.XMLElement@9511c8
    Please let me know, what changes i need to make to get the string output.I followed all the steps given in "orabpel-Tutorial7-InvokingBPELProcesses.PDF" to execute credit rating jsp.
    We are using SOA Suite 10.1.3.1.0 version.Do I need to make any changes to the code, to make it work with this version.
    Thanks
    Vandana.

    The call payload.get("payload") returns, as you have observed, an XMLElement. You can simply convert the XMLElement into an XML string by using a DOMSerializer implementation. The following code is very useful for this purpose:
    http://javafaq.nu/java-example-code-432.html
    Best,
    Manfred

  • How can i filter an xml object on an attribute?

    I want address an xml object with .(@ attributeNameHere == "textToSearchForHere") and have it return the node it’s associated with. 
    This is the text from the adobe help site and it’s similar to my actual code.  I’m querying this xml object: staticVar.employee.(@id=="347").  FlashBuilder 4.7 is returning an error “No such variable: @id”. when I look in debugger.
    This example is found in Adobe's help site: Adobe Flash Platform * Traversing XML structures
    The help site says
    The following expressions are all valid:
    x.employee.(lastName == "McGee")—This is the secondemployeenode.
    x.employee.(lastName == "McGee").firstName—This is thefirstNameproperty of the secondemployeenode.
    x.employee.(lastName == "McGee").@id—This is the value of theidattribute of the secondemployeenode.
    x.employee.(@id == 347)—The firstemployeenode.
    public var staticVar:XML = 
    <employeeList>
          <employee id="347">
               <lastName>Zmed</lastName>
               <firstName>Sue</firstName>
               <position>Data analyst</position>
          </employee>
          <employee id="348">
               <lastName>McGee</lastName>
               <firstName>Chuck</firstName>
               <position>Jr. data analyst</position>
          </employee>
    </employeeList>;
    I’m expecting this: staticVar.employee.(@id=="347") will return the following node:
    <employee nu="347">
    <lastName>Zmed</lastName>
    <firstName>Sue</firstName>
    <position>Data analyst</position>
    </employee>
    If this is the wrong, then what is the correct way to access the xml node based on an attribute?  How can i get that node 347 in this example to be found and returned?  I've opened a ticket with the adobe help team and we're on the 8th day and they have not been helpful at all.

    If you are using e4x as the result format for your service
    you can do the following
    //a XMLList of all day information
    var result:Object = event.result.day;
    //consits all information for month zero
    var month0:XMLList = result.(@month == 0);
    //consists of booking info for day 28 of month 0
    var day28Month0:XMLList = month0.(@day == 28);
    //this also can be done
    //contains booking info for all months for day 28
    var day28AllMonths:XMLList = result.(@day == 28);
    Using this technique you should be able to gather info about
    all user selected dates and build the smaller (filtered) list.
    HTH

  • Conversion of string into XML object

    Hi
    I am having some problems with conversion of string (containing XML data) into Flex XML object and binding it later to UI elements to output/maintain this data.
    Binding of XML structure to UI elements works perfectly fine if I will do following:
    1)      Hardcode XML object within Flex file
    2)      Read xml file from repository (xml file inside the Flex project)
    3)      Use HTTP request to retrieve XML data
    Unfortunately none of the above scenarios suits my solution.
    I am developing a prototype application for processing Flex forms inside SAP system. I have decided to make data bindings using XML structure stored in Data Base. When rendering form inside web browser based application I am retrieving corresponding XML schema (empty for new forms and populated for saved forms) and pass it to Flex form as a string type import parameter. Data is being passed correctly (I can display it on TextArea control for instance) but after conversion to XML and binding to DataGrid I am not getting any results.
    I am converting string (containing XML) to XML object in following way:
    Private var xml_obj:XML = new XML(string_xml );
    I am catching any potential errors but conversion is going well. After conversion I am not getting any results after binding it to DataGrid control and I am not able to access any of the nodes using AS code either. At the same time variable xml_obj is not empty (not null).
    Any help would be much appreciated.
    Regards
    Michael

    David
    First of all sorry for not stating it clearly but I am using Flex 3 for this development (at the moment it is the only choice when embedding Flex objects inside SAP applications).
    You must have missed the bit where I am describing how this XML data finds its way inside Flex. I am passing it to Flex as String type parameter during rendering (directly from DB where it is stored).
    Now, following code works perfect (XML is embedded inside Flex project):
                    <mx:XML id="form_data" source="../assets/example_xml_data.xml"/>
                    <mx:Script>
                                    <![CDATA[
                                                    import mx.collections.XMLListCollection;
                                                    import mx.controls.Alert;
                                                    [Bindable]
                                                    public var XML_list:XMLListCollection;
                                                    private function setParameters():void
                                                                   XML_list = new XMLListCollection(form_data.*);             
                                    ]]>
                    </mx:Script>
                    <mx:DataGrid id="myDataGrid" dataProvider="{XML_list}">
                                    <mx:columns>
                                                    <mx:DataGridColumn dataField="COMMON" headerText="Popular name"/>
                                                    <mx:DataGridColumn dataField="BOTANICAL" headerText="Botanical name"/>
                                                    <mx:DataGridColumn dataField="ZONE" headerText="Zone"/>
                                                    <mx:DataGridColumn dataField="LIGHT" headerText="Light"/>                                                                                                                                               
                                                    <mx:DataGridColumn dataField="PRICE" headerText="Price"/>                                               
                                                    <mx:DataGridColumn dataField="AVAILABILITY" headerText="Availability"/>                                    
                                    </mx:columns>               
                    </mx:DataGrid>
    But following code does not work (XML passed to Flex form as String input parameter):
    import sap.FlashIsland;
    import mx.controls.Alert;
    import mx.collections.XMLListCollection;
    [Bindable]
    public var xml_data:String;
    private var form_data:XML;
    [Bindable]
    private var XML_list:XMLListCollection;
    private function initApp():void
                    FlashIsland.register(this);
    private function setParameters():void
                    try
                                    form_data=new XML(xml_data);
                    catch (error:Error)
                                    Alert.show(error.toString());
                      XML_list = new XMLListCollection(form_data.*);           
    XML string does find its way inside Flex form. I can display content of variable xml_data in TextArea and all looks fine. Conversion to XML (variable form_data) goes well (no error)
    Please helpJ
    Regards
    Michael

  • How to create a xml object dynamically

    Hi all,
    In my current project the database is returning the query result in xml string format(using oracle's DBMS-XML package).
    Now I need to use this xml string and build a xml object and transform it into XSLT and then in a servlet and then pass it to the browser and display it using xsl stylesheets.
    Can some one help me in building an xml object using a string( the xml string is in the xml format i.e in <..> format) and then transform it into xslt in the servlet and send across to the browser.
    Any hands on code or references to the code will be most favourable.
    any help regarding this issue will be most appreciated. Pls do reply as early as possible as I do not have much time to implement this.
    Thanking in advance for your kind help.
    Srinivas.

    What's an "xml object"?
    If you want to transform it using XSLT (transforming it "into" XSLT doesn't make much sense), you can transform direct from the string. Like this:try {
      TransformerFactory xformFactory  = TransformerFactory.newInstance();
      Source xsl = new StreamSource("your.xsl");
      Transformer stylesheet = xformFactory.newTransformer(xsl);
      Source request  = new StreamSource(new StringReader(yourXMLString));
      Result response = new StreamResult(out);
      stylesheet.transform(request, response);
    catch (TransformerException e) {
      System.err.println(e);
    }By the way, if you haven't seen this code before then I suggest you go and read ERH's book about XML with Java:
    http://www.cafeconleche.org/books/xmljava/chapters/index.html

  • String to xml object java

    Hello,
    can anyone suggest me how to convert string to xml object in java?
    I have a string (Data) ant now I have to pass it as parameter as xml object, which structure should be:
    <MGWData>Data</MGWData>
    Where I surf I always see only solutions for converting string to xml document, but never to xml object.
    maybe the problem is I don't completely understand what xml object is in first place :/
    Any answer would help.
    Thanks.

    894871 wrote:
    here is the method to call:
    +/**+
    * Sets the p_DATAXMLTYPEIN value for this SVARCHAR2INSERT_RECEIVESInput.
    *+
    * @param p_DATAXMLTYPEIN
    *public void setP_DATAXMLTYPEIN(com.oracle.xmlns.orawsv.SISTEMA_MOKA.MGW_PUBLIC_FUNCTIONS.SVARCHAR2INSERT_RECEIVESInputP_DATAXMLTYPEIN p_DATAXMLTYPEIN) {*
    this.p_DATAXMLTYPEIN = p_DATAXMLTYPEIN;
    one of the classes contains:
    *public class SVARCHAR2INSERT_RECEIVESInputP_DATAXMLTYPEIN  implements java.io.Serializable, org.apache.axis.encoding.AnyContentType {*
    *private org.apache.axis.message.MessageElement [] _any;*
    this method and some classes where generated using eclipse and wsdl file by creating web service client.
    wsdl says for that part: *<xsd:element name="P_DATA-XMLTYPE-IN">*
    So I suppose it should involve smth org.apache.axis.message.MessageElement. But when I create any type of parameter, it gives me error:
    + ....cannot be cast to com.oracle.xmlns.orawsv.SISTEMA_MOKA.MGW_PUBLIC_FUNCTIONS.SVARCHAR2INSERT_RECEIVESInputP_DATAXMLTYPEIN+
    I am new in web service stuff so thank you for response.Can you explain in plain English what you are trying to do? Or provide a [url http://sscce.org/]SSCE.

  • Mapping XML object to java object gives ClassCastException

    Hi All,
    I am trying to map a specific XML object to a specific java object using web
    services and received the following exception:
    java.lang.ClassCastException: weblogic.soap.xml.XMLObject
    at $Proxy0.getMonster(Unknown Source)
    at serviceClient.TestServiceClient.main(TestServiceClient.java:46)
    Exception in thread "main"
    I tried to map a simple type:
    <types>
    <schema targetNamespace='java:biomaterials'
    xmlns='http://www.w3.org/1999/XMLSchema'>
    <element name="Monster">
    <complexType>
    <all>
    <element name="name"
    type="string"/>
    <element name="age"
    type="int"/>
    </all>
    </complexType>
    </element>
    </schema>
    </types>
    To the following java bean:
    package biomaterials;
    public class
    ster{
    private String name;
    private Integer age;
    public Monster(String name, int age) {
    this.name=name;
    this.age=new Integer(age);
    public String getName() {
    return name;
    public void setName(String s) {
    this.name=s;
    public Integer getAge() {
    return age;
    public void setAge(int n) {
    this.age=new Integer(n);
    Here is my client code:
    package serviceClient;
    import java.util.Properties;
    import weblogic.soap.codec.CodecFactory;
    import weblogic.soap.codec.SoapEncodingCodec;
    import weblog
    ic.soap.codec.LiteralCodec;
    import weblogic.soap.WebServiceProxy;
    import weblogic.soap.SoapMethod;
    import weblogic.soap.SoapType;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.ejb.*;
    import biomaterials.ServiceSession;
    import java.io.File;
    import java.io.IOException;
    import org.w3c.dom.Element;
    import biomaterials.Monster;
    public class TestServiceClient
    public static void main( String[] arg ) throws Exception
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.soap.http.SoapInitialContextFactory");
    h.put("weblogic.soap.wsdl.interface",
    ServiceSession.class.getName() );
    Context context = new InitialContext(h);
    ServiceSession serv =
    (ServiceSession)context.lookup("http://localhost:7001/biocat/biomaterials.Se
    rviceSession/biomaterials.ServiceSession.wsdl");
    //try
    //int result = serv.getTheNum();
    //String result=serv.getBIXBiologicals();
    //int result=serv.setBIXInfo("TARNUMBER");
    Monster result=serv.getMonster();
    System.out.print("The value is "+result);
    } /* end of main */
    } /* end of class */
    Here is the method in my stateless session bean:
    public Monster getMonster()
    return new Monster("Sully",3);
    And here is my whole wsdl file:
    <% response.setHeader( "Content-Type", "text/xml; charset=utf-8" ); %>
    <definitions
    targetNamespace="java:biomaterials"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="java:biomaterials"
    >
    <types>
    <schema targetNamespace='java:biomaterials'
    xmlns='http://www.w3.org/1999/XMLSchema'>
    <element name="Monster">
    <complexType>
    <all>
    <element name="name" type="string"/>
    <element name="age" type="int"/>
    </all>
    </complexType>
    </element>
    </schema>
    </types>
    <message name="getBIXBiologicalsRequest"></message>
    <message name="getBIXBiologicalsResponse">
    <part name="return" type="xsd:string" />
    </message>
    <message name="setBIXInfoRequest">
    <part name="arg0" type="xsd:string" />
    <part name="arg1" type="xsd:string" />
    <part name="arg2" type="xsd:integer" />
    </message>
    <message name="setBIXInfoResponse"></message>
    <message name="getMonsterRequest"></message>
    <message name="getMonsterResponse">
    <part name="body" element="tns:Monster"/>
    </message>
    <portType name="ServiceSessionPortType">
    <operation name="getBIXBiologicals">
    <input message="tns:getBIXBiologicalsRequest"/>
    <output message="tns:getBIXBiologicalsResponse"/>
    I am using weblogic 6.1 SP1 on WIN NT.
    Please help me out in this issue.
    Thanks in advance.
    Sapan

    HI !
    i dont think that the servicepack is an issue in this case.
    anyway i ahve tried it on 6.1SP4 and still getting similar results.
    any pointers will be highly appreciated.
    Thanks,
    sapan
    "manoj cheenath" <[email protected]> wrote in message
    news:[email protected]...
    I just skimmed through your email. You said you
    are using WLS 6.1 SP1. Can you try this using
    the latest SP. There are many bug fixes done
    after SP1.
    Web service support in 6.1 is very limited. But, It
    looks like 6.1 can handle the case you are trying out.
    regards,
    -manoj
    "Sapan Agarwal" <[email protected]> wrote in message
    news:[email protected]...
    Hi All,
    I am trying to map a specific XML object to a specific java object usingweb
    services and received the following exception:
    java.lang.ClassCastException: weblogic.soap.xml.XMLObject
    at $Proxy0.getMonster(Unknown Source)
    at
    serviceClient.TestServiceClient.main(TestServiceClient.java:46)
    >>
    Exception in thread "main"
    I tried to map a simple type:
    <types>
    <schema targetNamespace='java:biomaterials'
    xmlns='http://www.w3.org/1999/XMLSchema'>
    <element name="Monster">
    <complexType>
    <all>
    <element name="name"
    type="string"/>
    <element name="age"
    type="int"/>
    </all>
    </complexType>
    </element>
    </schema>
    </types>
    To the following java bean:
    package biomaterials;
    public class
    ster{
    private String name;
    private Integer age;
    public Monster(String name, int age) {
    this.name=name;
    this.age=new Integer(age);
    public String getName() {
    return name;
    public void setName(String s) {
    this.name=s;
    public Integer getAge() {
    return age;
    public void setAge(int n) {
    this.age=new Integer(n);
    Here is my client code:
    package serviceClient;
    import java.util.Properties;
    import weblogic.soap.codec.CodecFactory;
    import weblogic.soap.codec.SoapEncodingCodec;
    import weblog
    ic.soap.codec.LiteralCodec;
    import weblogic.soap.WebServiceProxy;
    import weblogic.soap.SoapMethod;
    import weblogic.soap.SoapType;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.ejb.*;
    import biomaterials.ServiceSession;
    import java.io.File;
    import java.io.IOException;
    import org.w3c.dom.Element;
    import biomaterials.Monster;
    public class TestServiceClient
    public static void main( String[] arg ) throws Exception
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.soap.http.SoapInitialContextFactory");
    h.put("weblogic.soap.wsdl.interface",
    ServiceSession.class.getName() );
    Context context = new InitialContext(h);
    ServiceSession serv =
    (ServiceSession)context.lookup("http://localhost:7001/biocat/biomaterials.Se
    rviceSession/biomaterials.ServiceSession.wsdl");
    file://try
    file://int result = serv.getTheNum();
    file://String result=serv.getBIXBiologicals();
    file://int result=serv.setBIXInfo("TARNUMBER");
    Monster result=serv.getMonster();
    System.out.print("The value is "+result);
    } /* end of main */
    } /* end of class */
    Here is the method in my stateless session bean:
    public Monster getMonster()
    return new Monster("Sully",3);
    And here is my whole wsdl file:
    <% response.setHeader( "Content-Type", "text/xml; charset=utf-8" ); %>
    <definitions
    targetNamespace="java:biomaterials"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="java:biomaterials"
    >
    <types>
    <schema targetNamespace='java:biomaterials'
    xmlns='http://www.w3.org/1999/XMLSchema'>
    <element name="Monster">
    <complexType>
    <all>
    <element name="name" type="string"/>
    <element name="age" type="int"/>
    </all>
    </complexType>
    </element>
    </schema>
    </types>
    <message name="getBIXBiologicalsRequest"></message>
    <message name="getBIXBiologicalsResponse">
    <part name="return" type="xsd:string" />
    </message>
    <message name="setBIXInfoRequest">
    <part name="arg0" type="xsd:string" />
    <part name="arg1" type="xsd:string" />
    <part name="arg2" type="xsd:integer" />
    </message>
    <message name="setBIXInfoResponse"></message>
    <message name="getMonsterRequest"></message>
    <message name="getMonsterResponse">
    <part name="body" element="tns:Monster"/>
    </message>
    <portType name="ServiceSessionPortType">
    <operation name="getBIXBiologicals">
    <input message="tns:getBIXBiologicalsRequest"/>
    <outputmessage="tns:getBIXBiologicalsResponse"/>
    >>
    >>
    >>
    >>
    >>
    >>
    >>
    I am using weblogic 6.1 SP1 on WIN NT.
    Please help me out in this issue.
    Thanks in advance.
    Sapan

  • XML object returns attributes but not elements

    Hi,
    I'm very new to this so my problem is probably down to bad practices but anyhow... I have code as follows:
    var s:String = load.data; //This turns up as fully-formed correct XML every time.
    var docx:XML = new XML(s);
    trace(new String(docx..@src));
    trace(new String(docx..entry));
    In the above the first trace works fine and returns the value of all 'src' attributes found in the document.
    However, the second statement does nothing at all. It should return a list of 'entry' nodes I think.
    The XML document I'm using is found here: http://picasaweb.google.com/data/feed/api/all
    Is the XML object malfunctioning or is my code wrong?
    Thanks
    Jack

    Turns out it was a namespace issue. Here's an explanation for others who get stuck with a similar issue.
    I added these lines to the script in my mxml file:
    private namespace webNameSpace = "http://www.w3.org/2005/Atom";
    use namespace webNameSpace;
    The string "http://www.w3.org/2005/Atom" is taken from the root node of my xml document. In this case it was from the tag:
    <feed
         xmlns='http://www.w3.org/2005/Atom'
         xmlns:exif='http://schemas.google.com/photos/exif/2007'
         xmlns:gphoto='http://schemas.google.com/photos/2007'
         xmlns:media='http://search.yahoo.com/mrss/'
         xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
         xmlns:gml='http://www.opengis.net/gml'
         xmlns:georss='http://www.georss.org/georss'
    >
    Presumably, if I want to use tags that have NS prefixes (eg <gphoto:url>) then I'll need to add the other namespaces for use.
    Still, if anyone has any comments on whether there is a cleaner way to do this, or even just to let me know I'm doing it right, then please post back as I'm very knew to this and would like my code to be corrected/affirmed if possible.
    Thanks all,
    Jack
    EDIT: can I mark my own posts as answered?

  • XML Object to BPM Object, is possible?

    My process consumes a Web Service that returns a Object (XSD).
    When I catalog this Web Service in the BPM catalog, BPM saves the return of Web Service as a XML Object.
    The problem is that I use JSP in my application, so when I need to show this object in JSP, I need to create a BPM Object similar to XML Object and map the values of the XML Object to Object BPM, then if I need change the Web Service returns (XML object) I also need to change the BPM Object. This is very annoying.
    Exists a way to convert a XML Object to BPM Object? BPM provides some API to make this?

    Yo can create a BPM Object that inherits from an XML Object.
    Hope it helps

  • Pulling particular attributes from the XML Object

    Hi !
    My requirement is onChange of a value from the first drop down, particular values needs to load in the second drop down. Values that needs to pull are designed in XML Object as Map entries Key,Pair Values.
    We can pull the first drop down values from the XML Object using Rule library and find the following code snippet ;
    <block>
    <set name='appData'>
    <invoke name='getExtension'>
    <invoke name='getObject'>
    <ref>ctx</ref>
    <invoke name='findType' class='com.waveset.object.Type'>
    <s>Configuration</s>
    </invoke>
    <s>Config_SDD_ReferenceData</s>
    </invoke>
    </invoke>
    </set>
    <ref>appData</ref>
    </block>
    Here, Config_SDD_ReferenceData.xml is the file where the map entries are written and the ref name is appData. Later in BPE the code "appData.units" are referred in ValueMap property.
    But we are stuggling to populate the second drop down values based on the valu selected in the first drop down.
    Please find the XML Object also;
    <Attribute name='units'>
    <Map>
    <MapEntry key='1' value='units1'/>
    <MapEntry key='2' value='units2'/>
    <MapEntry key='3' value='units3'/>
    </Map>
    </Attribute>
    Thanks in advance.

    u could use removeChild() method of the node interface....get the parent node named 'xxxxxx' from the DOM and perform a removeChild operation on it specifying the senderID, receiverID and dateTimeStamp Nodes as arguments to the method....
    Hope this helps
    VP

  • How to access a nested child tag values in  XML Object(getting error:No Such variable)

    Hi,
    I could see the XML object data and while accessing a perticular attribute let say "SlotA"  it is showing "No such variable Error".
    I appreciate any of your  inputs or suggestions to solve this error.
    You can find the screen snapshot of the problem as part of the attachment here.
    Thanks in advance
    CSNPrasad.

    Dear Natasha,
    Thanks for your mails & cooperation as well.
    This time i  have added the trace() and can see the value.Now the problem is "can't access a property or method of a null object reference"
    Noe: This code mxml file is called at Runtime based on the data defined in the XMLSocket data.
    I need to display Remote devices like davice1,device2 device3 etc. these are added/delete at any time ,so we need to show same changes in UI at Runtime.
    I implemented Polymorphism concept to construct the device object at runtime like follows
    var device:Object;
    for each (var deviceData:XML indeviceListXML..Device)
                        device = getBatteryBay(deviceData.deviceId)
                        // If device already exists with the deviceId, update the details
                        // Else create a newdevice and add it to the container for displaying it.
                                                                                    if (device == null)
                            if (device.Type == "DEVICE1")
                                device = new Device1();
                            else if (device.Type == "DEVICE2")
                            device = new Device2();
                            else
                                device = new DefaultDevice();
                            device.id = deviceData.deviceId;
                          device.name = deviceData.devicename;
                         device.setData(deviceData);
    Here new Device1(); and new Device2() are the UIComponents and created at Runtime, upto here no problem to display, when i try to setData to the devices it is throwing error
    "can't access a property or method of a null object reference". because Device1 and Device2 has Child components like "DataIndicator" and need to set properties to these components which are not created yet.
    I appreciate any of your Input or suggestions at the earliest
    Thanks in Advance
    Regards

  • Web Services and XML Object

    Hi All ,
    The types supported by JAX-RPC seem not to include any XML object (i.e. org.JDom.Document). But OC4J supports this. Any one can give me direction if any other tools can permit me in creating web services which will permit to exchange XML objects (Documents or Elements ) .
    Regards,
    Rao

    Apache Axis has support for RPC, Document, Wrapped and Message service styles.
    see http://ws.apache.org/axis/java/user-guide.html#PublishingServices and scroll down to the 'Message services' subheading.
    JAX-RPC supports the RPC service style.
    Pete

  • [svn:fx-3.x] 9493: Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects .

    Revision: 9493
    Author:   [email protected]
    Date:     2009-08-23 16:09:56 -0700 (Sun, 23 Aug 2009)
    Log Message:
    Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects.
    QE notes:  None
    Doc notes: None
    Bugs: SDK-13919
    Reviewer: N/A
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22435
        http://bugs.adobe.com/jira/browse/SDK-13919
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/utils/ObjectUtil.as

Maybe you are looking for

  • Safari crashes to desktop after recent install of Lion

    Hello community, I'm obviously VERY late to the game in upgrading to lion, but now that I have done it (about two days ago) Safari crashes a few seconds after opening.  I've read that this had been a pretty common problem, and it's problems like thes

  • Opening mac image in windows 2000

    Can anyone please help me? I have a mact pict file saved on a usb key and need to open it in windows. Any ideas?

  • Aurora Firefox wont install. installation interrupted

    hi. earlier today i installed mozilla firefox, the stable version from mozilla website. however my intent was to install aruora firefox. so i uninstalled mozilla firefox and then proceeded to install aurora. when it begins to install it stops and a m

  • Query needed for sorting by time value

    Hi Folks We have table it consists two columns like below Job_name varchar2(50) Scheduled_time date The filed scheduled time keep date and time value like below 25-Jul-2009 4:00:10 AM 26-Jul-2009 4:00:01 PM 27-Jul-2009 4:00:00 PM 28-Jul-2009 4:05:00

  • Is index helpful for "group by"?

    In an application a statement is executed: SELECT a b c d MAX(e) SUM(f) FROM my_db_tab GROUP BY a b c d. Does it make sense to add an index to my_db_tab for the fields a, b, c and d? Context: The ABAP is generated so I can not change it. my_db_tab co