Balwant Kumar Singh
Balwant Kumar Singh

Reputation: 1178

Getting error in Mule WSDL parsing - COULD_NOT_READ_XML_STREAM with Root Exception stack: Unexpected character '/' (code 47) in prolog;

I'm trying to consume SOAP service in mule through Web Service Consumer connector.Every thing looks fine but while running the application I'm getting exception given below :

org.apache.cxf.interceptor.Fault: COULD_NOT_READ_XML_STREAM
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:151)
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:135)
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:131)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:119)
at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.mule.module.cxf.transport.MuleUniversalConduit$1.write(MuleUniversalConduit.java:143)

:44)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:109)
at org.mule.execution.FlowProcessingPhase$1.run(FlowProcessingPhase.java:62)
at org.mule.transport.TrackingWorkManager$TrackeableWork.run(TrackingWorkManager.java:267)
at org.mule.work.WorkerContext.run(WorkerContext.java:286)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '/' (code 47) in prolog; expected '<'
 at [row,col {unknown-source}]: [1,1]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:639)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2029)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1114)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:606)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:565)
at org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter.write(StaxDataBinding.java:142)
... 214 more

My Mule flow looks something like this :

 <ws:consumer-config name="Web_Service_Consumer" wsdlLocation="D:\Balwant\docs\greet.wsdl" service="GreeterService" port="GreeterPort" serviceAddress="http://localhost:63081/services/unsecure" doc:name="Web Service Consumer"/>

<flow name="jax-ws-external" doc:name="jax-ws-external">
    <http:inbound-endpoint exchange-pattern="request-response"
        host="localhost" port="8084"  doc:name="HTTP" />
    <ws:consumer config-ref="Web_Service_Consumer" operation="greet" doc:name="Web Service Consumer" mtomEnabled="true"/>

</flow>

Your help on this would be appreciated.

Upvotes: 1

Views: 883

Answers (1)

Evangelina Martinez
Evangelina Martinez

Reputation: 31

Can you share the SOAP Xml that you're posting to http://localhost:8084? Is it possible that you're not sending one and that's why it's failing? By default the inbound endpoint will set the payload to the request path when there is none, in this case "/" since there is no path configured in the endpoint and that's what the consumer seems to be complaining about.

Upvotes: 1

Related Questions