WebSphere Enterprise Service Bus, 버전 6.2.0 운영 체제: AIX, HP-UX, i5/OS, Linux, Solaris, Windows


Java에서 XML로 변환

시스템에서 사전 정의된 규칙을 사용하여 Java 유형 기반의 XML을 생성합니다.

유형간 변환

표 1은 Java™ 유형 과 XML간의 시스템 변환 방법을 나타냅니다. 시스템이 WSDL(Web Services Description Language) 문서 유형 섹션에 XML을 저장합니다.

표 1. Java 및 XML
Java 유형 XML 유형
문자 또는 java.lang.Character
<ati:schema 
	targetNamespace="http://xml.apache.org/xml-soap"
xmlns="http://www.w3.org/2001/XMLSchema" 
xmlns:ati="http://www.w3.org/2001/XMLSchema">    
	<ati:simpleType name="char">     
		<ati:restriction base="xsd:string">      
			<ati:length value="1"/>     
		</ati:restriction>    
	</ati:simpleType>   
</ati:schema>  

tns2:char 또는 tns2:char nillable = true
부울 xsd:boolean
java.lang.Boolean xsd:boolean nillable=true
바이트 또는 java.lang.Byte xsd:byte 또는 xsd:byte nillable=true
축약형 또는 java.lang.Short xsd:short 또는 xsd:short nillable=true
int 또는 java.lang.Integer xsd:int 또는 xsd:int nillable = true
long 또는 java.lang.Long xsd:long 또는 xsd:long nillable=true
float 또는 java.lang.Float xsd:float 또는 xsd:float nillable=true
Double 또는 java.lang.Double xsd:double 또는 xsd:double nillable=true
java.lang.String xsd:string nillable=true
java.math.BigInteger xsd:integer nillable=true
Java.math.BigDecimal xsd:decimal nillable=true
Java.util.Calendar xsd:dateTime nillable=true
java.util.Date xsd:dateTime nillable=true
Java.xml.namespace.QName xsd:Qname nillable=true
java.net.URI xsd:anyURI nillable=true
byte[] xsd:base64Binary
유형 배열 xsd:유형 요소 및 maxocurrs > 1 또는 바운드되지 않음이 포함된 complexType
Java 클래스
중요사항: Java 클래스가 사용자 정의 클래스인 경우 클래스는 JAX-RPC 1.1의 5.4 섹션을 준수해야 합니다.
xsd:JAX-PRC 1.1의 5.4 섹션의 규칙에 따른 complexType
java.lang.Object xsd:anyType
java.util 클래스(콜렉션, List,ArrayList, 설정, SortedSet, AbstractCollection, AbstractList, AbstractSet, Hashset LinkedHashSet, LinkedList, 스택, Treeset)
중요사항: 열거된 Java 유형 콜렉션만 현재 지원됩니다.
<complexType name="ArrayOfXSDAnyType">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" 
			name="anyType" nillable="true" 
			cleanStagingModules="true"/>
    </sequence>
</complexType>
  • java.util.Map
  • java.util.HashMap
targetNamespace="http://xml.apache.org/xml-soap"    

<complexType name="Item">     
	<all>      
		<element name="key" type="xsd:anyType"/>      
		<element name="value" type="xsd:anyType"/>     
	</all>    
</complexType>

<complexType name="Map">     
	<sequence>      
		<element maxOccurs="unbounded" minOccurs="0" 
		name="item" type="tns2:Item"/>     
	</sequence>    
</complexType>
java.util.Vector
targetNamespace="http://xml.apache.org/xml-soap" 

<complexType name="Vector">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" 
				name="item" type="xsd:anyType"/>
    </sequence>
</complexType>
java.util.types

여기에서 유형은 배열, SortedMap, AbstractMap, Bitset, 사전, IdentityHashmap, LinkedHashMap, TreeMap이 될 수 있습니다.

이것은 WSDL xsd:anytype 유형을 생성할 수 있는 고장을 야기시키는 java.util 유형 목록이 아닙니다.

xsd:anytype
Object[] - 오브젝트 배열
<complexType name="ArrayOfXSDAnyType">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" 
			name="anyType" nillable="true" 
			cleanStagingModules="true"/>
    </sequence>
</complexType>
생성된 변환은 어떤 것이든 대체할 수 있습니다.

reference 참조 주제

이용약관 | 피드백


시간소인 아이콘 마지막 갱신 날짜: 2010년 7월 7일 수요일


http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic//com.ibm.websphere.wesb620.doc/doc/rref_javatowsdltypemap.html
Copyright IBM Corporation 2005, 2010. All Rights Reserved.
이 Information Center는 Eclipse 기술을 기반으로 합니다(http://www.eclipse.org 웹 사이트 참조).