*Disclaimer - *I have looked at this post but did not get help - 
http://cxf.547215.n5.nabble.com/Problem-with-service-call-in-osgi-Unmarshalling-Error-unexpected-element-uri-quot-quot-local-quot-cu-td2651066.html
http://cxf.547215.n5.nabble.com/Problem-with-service-call-in-osgi-Unmarshalling-Error-unexpected-element-uri-quot-quot-local-quot-cu-td2651066.html
 
[http://cxf.547215.n5.nabble.com/Problem-with-service-call-in-osgi-Unmarshalling-Error-unexpected-element-uri-quot-quot-local-quot-cu-td2651066.html]

I am writing a java application that starts simple apache cxf web service
server as standalone application (without any web container or application
server.)

I am using the following: - 
 - Java6
 - cxf-api-2.2.5.jar
 - cxf-common-schemas-2.2.5.jar
 - cxf-common-utilities-2.2.5.jar
 - cxf-rt-bindings-soap-2.2.5.jar
 - cxf-rt-bindings-xml-2.2.5.jar
 - cxf-rt-core-2.2.5.jar
 - cxf-rt-databinding-jaxb-2.2.5.jar
 - cxf-rt-frontend-jaxws-2.2.5.jar
 - cxf-rt-frontend-simple-2.2.5.jar
 - cxf-rt-transports-http-2.2.5.jar
 - cxf-rt-transports-http-jetty-2.2.5.jar
 - cxf-rt-ws-addr-2.2.5.jar
 - cxf-tools-common-2.2.5.jar
 - geronimo-activation_1.1_spec-1.0.2.jar
 - geronimo-annotation_1.0_spec-1.1.1.jar
 - geronimo-j2ee-management_1.0_spec-1.0.jar
 - geronimo-javamail_1.4_spec-1.6.jar
 - geronimo-jaxws_2.1_spec-1.0.jar
 - geronimo-jms_1.1_spec-1.1.1.jar
 - geronimo-servlet_2.5_spec-1.2.jar
 - geronimo-stax-api_1.0_spec-1.0.1.jar
 - geronimo-ws-metadata_2.0_spec-1.1.2.jar
 - jaxb-api-2.1.jar
 - jaxb-impl-2.1.12.jar
 

I have written client for this service in Dot-Net and invoking the service
using the Dot-Net client.

There are two cases: - 

        1. When I run my service from eclipse IDE, and hitting the service using
DotNet client which I am invoking using a batch file, then everything works
well.

        2. When I run my java service using a batch file, then hitting the 
service
using the DotNet client in the same manner as I have done earlier, then I am
getting this exception: - 


------------------------------------------------------------------------------------------------------------------------

DefaultValidationEventHandler: [ERROR]: unexpected element
(uri:"http://www.abc.com/ghes/message";, local:"ReplyAddress"). Expected
elements are <{}CorrelationI
d>,<{}MessageId>,<{}Password>,<{}UserId>,<{}ReplyAddress>
     Location: line 1
Apr 11, 2012 10:23:20 AM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
WARNING: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element
(uri:"http://www.abc.com/ghes/message";, local:"ReplyAddress"). Expected
elements are
<{}CorrelationId>,<{}MessageId>,<{}Password>,<{}UserId>,<{}ReplyAddress>
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:764)
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:623)
        at
org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:128)
        at
org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:101)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://www.abc.com/ghes/message";, local:"ReplyAddress"). Expected
elements are <{}CorrelationId>,<
{}MessageId>,<{}Password>,<{}UserId>,<{}ReplyAddress>]
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:425)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339)
        at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:749)
        ... 19 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://www.abc.com/ghes/message";, local:"ReplyAddress"). Expected
elements are <{}Correl
ationId>,<{}MessageId>,<{}Password>,<{}UserId>,<{}ReplyAddress>
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:642)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:254)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:249)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:101)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:245)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:478)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:459)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:242)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:176)
        at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
        ... 21 more
Caused by: javax.xml.bind.UnmarshalException: unexpected element
(uri:"http://www.abc.com/ghes/message";, local:"ReplyAddress"). Expected
elements are <{}Correl
ationId>,<{}MessageId>,<{}Password>,<{}UserId>,<{}ReplyAddress>
        ... 32 more
Total performance time in GSIS is = 0
Apr 11, 2012 10:23:20 AM com.abc.gsis.client.GSISTestClient$1 run
INFO: Total performance time in GSIS is = 0
Apr 11, 2012 10:23:20 AM
org.apache.cxf.transport.http.AbstractHTTPDestination flushHeaders
WARNING: Response object is null
Apr 11, 2012 10:23:20 AM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
WARNING: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
        at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:284)
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
        at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.io.IOException: Response object is null
        at
org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:507)
        at
org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.close(AbstractHTTPDestination.java:576)
        at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
        ... 18 more

------------------------------------------------------------------------------------------------------------------------

It is entirely making me blank, when I start the same service through a
batch file then it does not work at all. Although I have set the same
classpath which has been set in eclipse.

Using fiddler I have also captured the request, the request from the DotNet
client is same in both the cases. The only difference is that when I run my
Java service using batch file, then the service is unable to marshal some of
the elements from the request.

Anyone in this forum have any idea about the above exception stack trace? Am
I missing anything here, please do let me know?

Thanks in advance for your efforts and solutions.
------------------------------------------------------------------------------------------------------------------------

The Java service wsdl definition is: - 

<wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:tns="http://www.abc.com/ghes/GHESReceiveService";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; name="GHESReceiveService"
targetNamespace="http://www.abc.com/ghes/GHESReceiveService";>
<wsdl:types>
        <xs:schema xmlns:tns="http://www.abc.com/ghes/GHESReceiveService";
xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="unqualified"
targetNamespace="http://www.abc.com/ghes/GHESReceiveService"; version="1.0">
                <xs:element name="Header" type="tns:Header"/>
                <xs:element name="ReadByMeterId" type="tns:ReadByMeterId"/>
                <xs:element name="ReadingQuality" type="tns:ReadingQuality"/>
                <xs:element name="ReadingType" type="tns:ReadingType"/>
                <xs:element name="Request" type="tns:Request"/>
                <xs:element name="TimeSchedule" type="tns:TimeSchedule"/>
                <xs:complexType name="ReadByMeterId">
                        <xs:sequence>
                        <xs:element form="qualified" minOccurs="0" name="header"
type="tns:Header"/>
                        <xs:element form="qualified" maxOccurs="unbounded" 
minOccurs="0"
name="requests" type="tns:Request"/>
                        </xs:sequence>
                </xs:complexType>
                <xs:complexType name="Header">
                        <xs:sequence>
                        <xs:element minOccurs="0" name="ReplyAddress" 
type="xs:string"/>
                        <xs:element minOccurs="0" name="CorrelationId" 
type="xs:string"/>
                        <xs:element minOccurs="0" name="MessageId" 
type="xs:string"/>
                        <xs:element minOccurs="0" name="UserId" 
type="xs:string"/>
                        <xs:element minOccurs="0" name="Password" 
type="xs:string"/>
                        </xs:sequence>
                </xs:complexType>
                <xs:complexType name="Request">
                        <xs:sequence>
                        <xs:element maxOccurs="unbounded" minOccurs="0" 
name="MeterIds"
type="xs:string"/>
                        <xs:element maxOccurs="unbounded" minOccurs="0" 
name="ReadingTypes"
type="tns:ReadingType"/>
                        <xs:element maxOccurs="unbounded" minOccurs="0" 
name="ReadingQualities"
type="tns:ReadingQuality"/>
                        <xs:element maxOccurs="unbounded" minOccurs="0" 
name="TimeSchedules"
type="tns:TimeSchedule"/>
                        </xs:sequence>
                </xs:complexType>
                <xs:complexType name="TimeSchedule">
                        <xs:sequence>
                        <xs:element minOccurs="0" name="Start" 
type="xs:dateTime"/>
                        <xs:element minOccurs="0" name="End" 
type="xs:dateTime"/>
                        </xs:sequence>
                </xs:complexType>
                <xs:simpleType name="ReadingType">
                        <xs:restriction base="xs:string">
                        <xs:enumeration value="notSpecified"/>
                        <xs:enumeration value="invalidReadingType"/>
                        <xs:enumeration value="energizationStatus"/>
                        <xs:enumeration value="switchPosition"/>
                        <xs:enumeration value="forwardApparentEnergy"/>
                        <xs:enumeration value="forwardActiveEnergy"/>
                        <xs:enumeration value="forwardReactiveEnergy"/>
                        <xs:enumeration value="reverseApparentEnergy"/>
                        <xs:enumeration value="reverseActiveEnergy"/>
                        <xs:enumeration value="reverseReactiveEnergy"/>
                        <xs:enumeration value="totalApparentEnergy"/>
                        <xs:enumeration value="totalActiveEnergy"/>
                        <xs:enumeration value="totalReactiveEnergy"/>
                        </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="ReadingQuality">
                        <xs:restriction base="xs:string">
                        <xs:enumeration value="notSpecified"/>
                        <xs:enumeration value="dataValid"/>
                        <xs:enumeration value="validated"/>
                        <xs:enumeration value="knownMissingRead"/>
                        <xs:enumeration value="failedValidation"/>
                        <xs:enumeration value="manuallyEdited"/>
                        <xs:enumeration value="estimatedGeneric"/>
                        <xs:enumeration value="indeterminate"/>
                        <xs:enumeration value="manuallyAccepted"/>
                        <xs:enumeration value="derivedGeneric"/>
                        <xs:enumeration value="derivedInferred"/>
                        <xs:enumeration value="revenueProtectedSuspect"/>
                        <xs:enumeration value="staticDataFlag"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:schema>
</wsdl:types>
<wsdl:message name="ReadByMeterId">
<wsdl:part element="tns:ReadByMeterId" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="GHESReceiveInterface">
<wsdl:operation name="ReadByMeterId">
<wsdl:input message="tns:ReadByMeterId" name="ReadByMeterId"></wsdl:input>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="GHESReceiveServiceSoapBinding"
type="tns:GHESReceiveInterface">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ReadByMeterId">
<soap:operation
soapAction="http://www.abc.com/ghes/GHESReceiveService/ReadByMeterId";
style="document"/>
<wsdl:input name="ReadByMeterId">
<soap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="GHESReceiveService">
<wsdl:port binding="tns:GHESReceiveServiceSoapBinding"
name="BasicHttpBinding_GHESReceiveInterface">
<soap:address location="http://127.0.0.1:9001/GSIS"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
------------------------------------------------------------------------------------------------------------------------

--
View this message in context: 
http://cxf.547215.n5.nabble.com/Calling-java-service-from-DotNet-client-getting-unmarshal-exception-tp5631860p5631860.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to