Hi,
I have encountered a strange error. I’m not too sure if it’s Eclipse or XML Beans. When I regenerated the ResponseBatch.jar from the following XSD’s all the methods appear correctly in the Package Explorer, but when I try to use them in Eclipse it can not find them. Also, when I save I get errors. Here are the XSD’s and the java code which will show the errors.
Any help would be greatly appreciated.
ResponseBatch.xsd
<?xml version="1.0" encoding="UTF-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://infor.com/FactsResponseBatch" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://infor.com/FactsCodeData" schemaLocation="CodeData.xsd"/>
<xs:element name="ResponseBatch" type="fac:ResponseBatchType" xmlns:fac="http://infor.com/FactsResponseBatch"/>
<xs:complexType name="ResponseType"> <xs:sequence> <xs:element ref="fac:Codes" minOccurs="0" maxOccurs="unbounded" xmlns:fac="http://infor.com/FactsCodeData"/> </xs:sequence> <xs:attribute name="RequestID" type="xs:string"/> <xs:attribute name="Company" type="xs:int"/> <xs:attribute name="SerialID" type="xs:string"/> </xs:complexType>
<xs:complexType name="ResponseBatchType" mixed="true"> <xs:sequence> <xs:element type="fac:ResponseType" name="Response" maxOccurs="unbounded" minOccurs="0" xmlns:fac="http://infor.com/FactsResponseBatch"/> </xs:sequence> <xs:attribute name="ConsumerKey" type="xs:string" xmlns:fac="http://infor.com/FactsResponseBatch"/> <xs:attribute name="Language" type="xs:string"/> <xs:attribute name="DateTime" type="xs:string"/> <xs:attribute name="SerialID" type="xs:string"/> </xs:complexType> </xs:schema>
CodeData.xsd
<?xml version="1.0" encoding="UTF-8"?> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://infor.com/FactsCodeData" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Codes" type="fac:CodesType" xmlns:fac="http://infor.com/FactsCodeData"/>
<xs:complexType name="CodesType"> <xs:sequence> <xs:element type="fac:CodeType" name="Code" maxOccurs="unbounded" xmlns:fac="http://infor.com/FactsCodeData"/> </xs:sequence> </xs:complexType>
<xs:complexType name="CodeType"> <xs:sequence> <xs:element type="xs:string" name="Code"/> <xs:element type="xs:string" name="Description"/> <xs:element type="xs:string" name="ParentCode"/> </xs:sequence> </xs:complexType> </xs:schema>
TestGLCodes2.java
import com.infor.factsResponseBatch.ResponseBatchDocument;
import com.infor.factsResponseBatch.ResponseBatchType;
import com.infor.factsResponseBatch.ResponseType; import com.infor.factsCodeData.CodesType; import com.infor.factsCodeData.CodeType; import java.io.File;
public class TestGLCodes2 {
public static void main ( String[] args ) throws Exception { System.out.println("ITS RUNNING!!!");
// load the xml instance into the store and return a // strongly typed instance of StatementDocument ResponseBatchDocument stmtDoc = ResponseBatchDocument.Factory.parse( new File( "C:\\FACTSXML\\XML\\GlCodes2.xml"));
com.infor.factsResponseBatch.ResponseBatchType ResponseBatchElement = stmtDoc.getResponseBatch();
System.out.println("ValidateCustomer details " + ", Consumer ID = " + ResponseBatchElement.getConsumerKey() + ", Language = " + ResponseBatchElement.getLanguage() + ", Date/Time = " + ResponseBatchElement.getDateTime() + ", Serial ID = " + ResponseBatchElement.getSerialID());
ResponseBatchType stmt = stmtDoc.getResponseBatch(); ResponseType[] responses = stmt.getResponseArray();
System.out.println("Total Responses " + responses.length);
for ( int i = 0 ; i < responses.length ; i++ ){
System.out.println( responses[ i ].getRequestID()); System.out.println( responses[ i ].getCompany()); System.out.println( responses[ i ].getSerialID());
System.out.println("Restart Point: " + responses[ i ].getRestartPoint());
System.out.println("Before Get Codes "); CodesType codes = responses[ i ].getCodes();
System.out.println("Before GetCode Array "); CodeType[] code = codes.getCodeArray();
System.out.println("Before the loop ");
for ( int j = 0 ; j < code.length ; j++ ){
System.out.println( code[ j ].getCode()); System.out.println( code[ j ].getDescription()); System.out.println( code[ j ].getParentCode()); } } } }
Richard Butterwood | Senior Analyst/Programmer | Infor | office: 770-418-2000 X 1167 | cell: 678-492-3080 | fax: 770-418-2022 | [EMAIL PROTECTED]
SAVE THE DATE:
|
- Methods appear in Package Explorer, but not intellisen... Butterwood, Richard
- RE: Methods appear in Package Explorer, but not i... Butterwood, Richard
- RE: Methods appear in Package Explorer, but not i... Cordes, Hans-Dieter