I am trying to run a program in Java that takes a custom XML file and parses it. I'm using the XML file for storage. I am getting the following error in the error logs.
WARN - OtherFault:
javax.xml.bind.UnmarshalException: Content is not allowed in prolog.
- with linked exception:
[org.xml.sax.SAXParseException: Content is not allowed in prolog.]
at com.wsc.cca.ns20100530.fault.xml.impl.runtime.SAXUnmarshallerHandlerImpl.handleEvent(Unknown Source)
at com.wsc.cca.ns20100530.fault.xml.impl.runtime.ErrorHandlerAdaptor.propagateEvent(Unknown Source)
at com.wsc.cca.ns20100530.fault.xml.impl.runtime.ErrorHandlerAdaptor.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.wsc.cca.ns20100530.fault.xml.impl.runtime.ErrorHandlerAdaptor.fatalError(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1039)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at com.wsc.cca.ns20100530.fault.xml.impl.runtime.UnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
at com.cts.util.CCARetrieveThread.run(CCARetrieveThread.java:325)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
The beginning of the XML file is included:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<retrieveResponse xmlns="urn:wsc.com/cca/2010/05/30">
<Number>1234</Number>
<Info>
<ID>12</ID>
<Status>ACTIVE</Status>
<ClosedDate xsi:nil="true"/>
<Info>
<To>1</To>
<From>2</From>
<Date>2011-05-16-04:00</Date>
</Info>
<Multi>true</Multi>
<CardExpiryDate>2012-12-03-05:00</CardExpiryDate>
</Info>
<PInfo>
<PID>000005471</PID>
<Title xsi:nil="true"/>
<FName>TAYLOR</FName>
<LName>NGWHIP</LName>
<Language>en</Language>
<PRelationship>PRIMARY</PRelationship>
<Number>1234</Number>
<TravelVIP xsi:nil="true"/>
<DesignatedUser1 xsi:nil="true"/>
<DesignatedUser2 xsi:nil="true"/>
</PInfo>
</retrieveResponse>
</soapenv:Body></soapenv:Envelope>
The program is able to read in the XML file. I get the error above.
Here is a code snippet:
if (pAWSType == Constants.AWS_CASHBACK) {
sLogger.info("Setting stub parameter for Cashback");
File lStubFile = new File(lConfig.getString("com.CCAWS.STUB.FilePath")+"CCBResponse-"+pAcctNum+".xml");
if (!lStubFile.exists()) {
mRetrieveThread = new CCARetrieveThread(new File(lConfig.getString("com.CCAWS.STUB.FilePath")+"CCBResponse.xml"));
} else {
mRetrieveThread = new CCARetrieveThread(lStubFile);
}
} else {
sLogger.info("Setting stub parameter for Travel Points");
File lStubFile = new File(lConfig.getString("com.CCAWS.STUB.FilePath")+"CCAResponse-"+pAcctNum+".xml");
if (!lStubFile.exists()) {
mRetrieveThread = new CCARetrieveThread(new File(lConfig.getString("com.CCAWS.STUB.FilePath")+"CCAResponse.xml"));
} else {
mRetrieveThread = new CCARetrieveThread(lStubFile);
}
}
It doesn't seem to me that I have invalid content in the prolog of my XML file. I can't figure out what is wrong. Please help. Thanks.
It usually means you have some hidden character at the beginning of the xml file.
Try opening it with an editor and view all characters and make sure there isn't a hidden character.
This error often means that the content you are trying to parse is either empty or is not well-formed XML.
In your case, it looks like some of your ending tags are missing. Where is the ending tag like </retrieveResponse> or </soapenv:Body>?
Related
I have gone through this posted question earlier, however my issue is different:
org.apache.axis2.AxisFault: javax.xml.stream.XMLStreamException:
Premature end of file encountered at
org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
org.apache.axis2.AxisFault: javax.xml.stream.XMLStreamException:
Premature end of file encountered at
org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:122)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:66)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:347)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:414)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
Can anybody help me out please what I'm missing as this is working perfectly fine in my local machine. But failing onto my server environment.
Please let me know if more details are required.
I had added this jars in my server Web-Inf :
Please have a look at this SOAP request that we are hitting :
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:tem="http://tempuri.org/">
<soap:Header>
<tem:UserAuth>
<!--Optional:-->
<tem:UserName>?</tem:UserName>
<!--Optional:-->
<tem:Password>?</tem:Password>
</tem:UserAuth>
</soap:Header>
<soap:Body>
<tem:Cities/>
</soap:Body>
</soap:Envelope>
My intention is to send ebxml message to MSH (Hermes2 http://www.cecid.hku.hk/hermes.php) through another Hermes2.
I am sending fairly simple message (with no attachments), this is the message:
POST /corvus/httpd/ebms/sender HTTP/1.0
User-Agent: PEAR-SOAP 0.12.0-beta
Host: 10.0.4.9
Content-Type: text/xml; charset=UTF-8
Content-Length: 698
SOAPAction: "PaymentAddRequest"
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<cpaId>ZSK_KOLEK</cpaId>
<service>http://www.squiz.pl/zsk/ebxml</service>
<action>PaymentAddRequest</action>
<convId>convId</convId>
<fromPartyId>KOLEK</fromPartyId>
<fromPartyType>urn:oasis:names:tc:ebxml-cppa:partyid-type:duns</fromPartyType>
<toPartyId>ZSK-C</toPartyId>
<toPartyType>urn:oasis:names:tc:ebxml-cppa:partyid-type:duns</toPartyType>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
In response I get following:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<message_id xmlns="http://service.ebms.edi.cecid.hku.hk/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">20150112-092001-65410#127.0.1.1</message_id>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Message gets registered, but then in logs/ebms.log I get following error
[Thread-1855 ] <ERROR> <cecid.ebms.spa> <Error in outbox task>
hk.hku.cecid.ebms.spa.task.MessageValidationException: Cannot reconstruct the message 20150112-092435-20713#127.0.1.1 from repository
by java.lang.RuntimeException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
by com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
by javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
Also looking at repository table in DB I can see that a row has been inserted, content column contains message in hex form (\x3c3f786d6c2076657273696f6e3d...), once converted to ASCII it says:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://www.oasis-open.org/committees/ebxml-msg/schema/envelope.xsd">
<SOAP-ENV:Header xsi:schemaLocation="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
<eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
<eb:From>
<eb:PartyId eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">KOLEK</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">ZSK-C</eb:PartyId>
</eb:To>
<eb:CPAId>ZSK_KOLEK</eb:CPAId>
<eb:ConversationId>convId</eb:ConversationId>
<eb:Service>http://www.squiz.pl/zsk/ebxml</eb:Service>
<eb:Action>PaymentAddRequest</eb:Action>
<eb:MessageData>
<eb:MessageId>20150112-092435-20713#127.0.1.1</eb:MessageId>
<eb:Timestamp>2015-01-12T09:24:35.207+01:00</eb:Timestamp>
</eb:MessageData>
<eb:DuplicateElimination/>
</eb:MessageHeader>
<eb:SyncReply SOAP-ENV:actor="http://schemas.xmlsoap.org/soap/actor/next" SOAP-ENV:mustUnderstand="1" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
<eb:AckRequested SOAP-ENV:actor="urn:oasis:names:tc:ebxml-msg:actor:toPartyMSH" SOAP-ENV:mustUnderstand="1" eb:signed="false" eb:version="2.0" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
</SOAP-ENV:Header>
<SOAP-ENV:Body xsi:schemaLocation="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"/>
</SOAP-ENV:Envelope>
but it doesn't get delivered to the endpoint, seems like Hermes2 doesn't even try to send it to the second Hermes2. Both instances have proper partnership configured.
Can someone point me in the right direction?
Ok, it took me a longer while to find the issue and then a solution, so hopefully I can save someones time.
Documentation on Hermes 2 installation says that it requires PostgreSQL 8.0 or later. This is a lie! Removing Postgres 9.3 and reinstalling Hermes with Postgres 8.4 solved the problem.
I am new to JAXB. I was provided a wsdl file, I used apache-cxf utility wsdl2java to gain a number of java classes, from which I implemented my webservice. But when I start client server test on my service, I get the following exception:
мар 25, 2013 12:19:36 PM org.apache.cxf.wsdl.EndpointReferenceUtils createSchema
WARNING: SAXException for newSchema()
org.xml.sax.SAXParseException; src-import.1.1: The namespace attribute 'http://www.aaa.com/bbb/ccc/ddd' of an <import> element information item must not be the same as the targetNamespace of the schema it exists in.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
at org.apache.cxf.wsdl.EndpointReferenceUtils.createSchema(EndpointReferenceUtils.java:698)
at org.apache.cxf.wsdl.EndpointReferenceUtils.getSchema(EndpointReferenceUtils.java:743)
at org.apache.cxf.binding.soap.interceptor.SoapHeaderInterceptor.handleMessage(SoapHeaderInterceptor.java:107)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:800)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1590)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1488)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1307)
at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:50)
at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:229)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:133)
.............
INFO: Schema for: http://www.globe.com/warcraft/wsdl/amax
<?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:tns="http://www.aaa.com/bbb/ccc/ddd" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.aaa.com/bbb/ccc/ddd" version="1.0">
<xs:import namespace="http://www.aaa.com/bbb/ccc/ddd"/>
...........
Why this intermediate XML is generated so, that it is importing itself? Can appearance of this import tag be cancelled somehow? I suppose, that the reason may be in the initial wsdl, or maybe it is some bug.
Thanks in advance
The problem was because in my generated ProxyServiceImpl class, I was missing a wsdlLocation in #WebService annotation:
#javax.jws.WebService(
serviceName = "ServiceName",
portName = "ServicePort",
targetNamespace = "http://www.aaa.com/bbb/ccc/ddd",
wsdlLocation = "path_to_wsdl",
endpointInterface = "ProxyService_class")
When I added it, everything worked.
as the exception suggest
org.xml.sax.SAXParseException; src-import.1.1: The namespace attribute 'http://www.aaa.com/bbb/ccc/ddd' of an element information item must not be the same as the targetNamespace of the schema it exists in.
Change the target name space and try refer this
Your answer about wsdlLocation helped me, but since I can't comment yet, I will just add more info.
As an option it is also possible to modify pom.xml and add wsdlLocation there
<wsdlOption>
<wsdl>${basedir}/src/main/resources/cxf/webservice.wsdl</wsdl>
<wsdlLocation>classpath:cxf/webservice.wsdl</wsdlLocation>
<wsdlOption>
We are sending the following SOAP XML to the server
<?xml version="1.0" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns2:search xmlns:ns2="http://search.tbx.codegen.it">
<arg0/>
<arg1/>
<arg2 xmlns:ns4="http://criteria.search.tbx.codegen.it" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:AccomSearchCriteria">
<adult>1</adult>
...
</arg2>
<arg3>50</arg3>
</ns2:search>
</SOAP-ENV:Body></SOAP-ENV:Envelope>
But server encountrs errors for this as follows
SEVERE: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxParsingException: Duplicate declaration for namespace prefix 'SOAP-ENV'.
at [row,col {unknown-source}]: [1,132]
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxParsingException: Duplicate declaration for namespace prefix 'SOAP-ENV'.
at [row,col {unknown-source}]: [1,132]
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:359)
at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:318)
Is there any thing wrong with the XML message we are sending (Duplicate namespace prefix 'SOAP-ENV')?
Thank you all in advance
i am trying to parse xml Stream from third party url. in my console it is looks like.
`
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/">
<string>CMSDocs</string>
<string>CRMIncomingDocs</string>
<string>CRMOutgoingDocs</string>
<string>Customized Reports</string>
<string>scripts</string>
<string>Site Assets</string>
<string>Site Pages</string>
<string>Style Library</string>
</ArrayOfString>
`
and i am getting error following error.
Exception in thread "main" javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException: Premature end of file.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:315)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:481)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:199)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
at com.cms.webservice.converter.BaseMarshaller.convertToObject(BaseMarshaller.java:41)
at com.cms.webservice.converter.BaseMarshaller.main(BaseMarshaller.java:90)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1058)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:195)
... 5 more
Java Result: 1
but it is working with XML like
`
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ArrayOfString>
<string>Kshitij-1</string>
<string>Kshitij-2</string>
<string>Kshitij-3</string>
<string>Kshitij-4</string>
<string>Kshitij-5</string>
</ArrayOfString>
`
thanks
You can use the #XmlSchema annotation to specify namespace qualification. Package annotations are placed on a special class called package-info that must reside in the same package as your domain classes. Below is an example that would work for your use case.
package-info
#XmlSchema(
namespace = "http://tempuri.org/",
elementFormDefault = XmlNsForm.QUALIFIED)
package example;
import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlSchema;
For More Information
http://blog.bdoughan.com/2010/08/jaxb-namespaces.html