Package org.jboss.ws.core.jaxrpc.binding.jbossxb

Examples of org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl.unmarshal()


      unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, getJavaWSDLMapping());

      String xml = "<ns1:arrayOfCalendar xmlns:ns1='" + TARGET_NAMESPACE + "'>" + " <value>1968-06-16T14:23:55.000Z</value>"
            + " <value>1969-07-17T15:24:56.000Z</value>" + " <value>1970-08-18T16:25:57.000Z</value>" + "</ns1:arrayOfCalendar>";

      objArr = (Calendar[]) unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));

      assertNotNull("Resulting obj array cannot be null", objArr);
      assertEquals("Unexpected array length", 3, objArr.length);

      Calendar cal1 = new GregorianCalendar(1968, 5, 16, 14, 23, 55);
View Full Code Here


      unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
      unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, getJavaWSDLMapping());

      String xml = "<result>" + " <value>100</value>" + " <value>200</value>" + " <value>300</value>" + "</result>";

      objArr = (BigDecimal[]) unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));

      assertNotNull("Resulting obj array cannot be null", objArr);

      assertEquals("Unexpected array length", 3, objArr.length);
      assertEquals(new BigDecimal(100), objArr[0]);
View Full Code Here

         " <a>0</a>" +
         " <b>0</b>" +
         " <d xsi:nil='1'/>" +
         "</ns1:SimpleUser>";

      obj = (SimpleUserType)unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));

      SimpleUserType exp = new SimpleUserType();
      assertNotNull("Resulting object cannot be null", obj);
      assertEquals(exp, obj);
   }
View Full Code Here

      unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
      unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, getJavaWSDLMapping());
      unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
      unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);

      Object obj = unmarshaller.unmarshal(new ByteArrayInputStream(xmlStr.getBytes()));
      assertTrue("Unexpected return type: " + obj.getClass().getName(), obj instanceof Base);
      assertEquals(exp, obj);
   }

   public void testDerivedType() throws Exception
View Full Code Here

      unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
      unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, getJavaWSDLMapping());
      unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
      unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);

      Object obj = unmarshaller.unmarshal(new ByteArrayInputStream(xmlStr.getBytes()));

      assertEquals(exp, obj);
   }

   /**
 
View Full Code Here

      unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
      unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, getJavaWSDLMapping());
      unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
      unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);

      Object obj = unmarshaller.unmarshal(new ByteArrayInputStream(xmlStr.getBytes()));
      assertNotNull("Unexpected null object", obj);
      assertTrue("Unexpected return type: " + obj.getClass().getName(), obj instanceof Derived);
      assertEquals(exp, obj);
   }
View Full Code Here

      unmarshaller.setProperty(JBossXBConstants.JBXB_XS_MODEL, model);
      unmarshaller.setProperty(JBossXBConstants.JBXB_JAVA_MAPPING, getJavaWSDLMapping());
      unmarshaller.setProperty(JBossXBConstants.JBXB_TYPE_QNAME, xmlType);
      unmarshaller.setProperty(JBossXBConstants.JBXB_ROOT_QNAME, xmlName);

      Object obj = unmarshaller.unmarshal(new ByteArrayInputStream(xmlStr.getBytes()));
      assertNotNull("Unexpected null object", obj);
      assertTrue("Unexpected return type: " + obj.getClass().getName(), obj instanceof Composite);
      assertEquals(exp, obj);
   }
View Full Code Here

      String xml = "<ns1:arrayOfQName xmlns:ns1='" + TARGET_NAMESPACE + "'>" + " <value xmlns:ns2='http://ns2'>ns2:local2</value>"
            + " <value xmlns:ns3='http://ns3'>ns3:local3</value>" + " <value xmlns:ns4='http://ns4'>ns4:local4</value>"
            + "</ns1:arrayOfQName>";

      objArr = (QName[]) unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));

      assertNotNull("Resulting obj array cannot be null", objArr);
      assertEquals("Unexpected array length", 3, objArr.length);
      assertEquals(new QName("http://ns2", "local2"), objArr[0]);
      assertEquals(new QName("http://ns3", "local3"), objArr[1]);
View Full Code Here

         " <a>0</a>" +
         " <b>0</b>" +
         " <d xsi:nil='1'/>" +
         "</ns1:SimpleUser>";

      obj = (SimpleUserType)unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));

      SimpleUserType exp = new SimpleUserType();
      assertNotNull("Resulting object cannot be null", obj);
      assertEquals(exp, obj);
   }
View Full Code Here

         " <a>0</a>" +
         " <b>0</b>" +
         " <d xsi:nil='1'/>" +
         "</ns1:SimpleUser>";

      obj = (SimpleUserType)unmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes()));

      SimpleUserType exp = new SimpleUserType();
      assertNotNull("Resulting object cannot be null", obj);
      assertEquals(exp, obj);
   }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.