调用时出现:前言中不允许有内容的问题

涂作权的博客
博客专家认证
2014-04-10 12:11:40
MULE ESB中的mflow中的写法是:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xmlns:ws="http://www.mulesoft.org/schema/mule/ws"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/stdio
http://www.mulesoft.org/schema/mule/stdio/current/mule-stdio.xsd
http://www.mulesoft.org/schema/mule/ws
http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/pattern
http://www.mulesoft.org/schema/mule/pattern/current/mule-pattern.xsd"
version="CE-3.3.1">
<!-- MEPGS服务代理 -->
<pattern:web-service-proxy name="mspgs-ws-proxy-pattern"
inboundAddress="http://10.28.17.129:8088/MSPGS/MPService"
outboundAddress="http://10.10.31.88/MSPGSWeb/MSPGS/MPService.svc"></pattern:web-service-proxy>
<!-- MICAPS日志发布成服务消息注册到ESB中 -->
<pattern:web-service-proxy name="acquisition-ws-proxy-pattern"
inboundAddress="http://10.28.17.129:8089/misps_acquisition/ws/micapsL"
outboundAddress="http://localhost:8080/misps_acquisition/ws/micapsL"></pattern:web-service-proxy>
<!-- <ws:proxy name="mspgs-ws-proxy-pattern"
inboundAddress="http://10.28.17.129:8088/MSPGS/MPService" outboundAddress="http://10.10.31.88/MSPGSWeb/MSPGS/MPService.svc">
</ws:proxy> -->
</mule>

报的问题是:

2014-04-10 11:57:53,731-[QZ] WARN http-bio-8080-exec-9 org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://tempuri.org/}IMPServiceService#{http://tempuri.org/}MPServiceFile has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:237)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:60)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:799)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1627)
.......

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: 前言中不允许有内容。
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:598)
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.nextTag(XMLStreamReaderImpl.java:1238)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:138)
... 104 more

webservice服务端使用的WCF
webservice客户端使用的是CXF


烦请哪位大神帮看看。
...全文
41504 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
涂作权的博客 2014-04-10
  • 打赏
  • 举报
回复
看那个文件呢?网上说: 1、解析xml文件报错 2、xml文件可能不是UTF-8的 但是我不清楚到底是那个不是UTF-8的。我建MULE ESB项目的时候将项目编码设置成了UTF-8,也将http://10.10.31.88/MSPGSWeb/MSPGS/MPService.svc代理成了http://10.28.17.129:8088/MSPGS/MPService,我用http://10.28.17.129:8088/MSPGS/MPService生成CXF客户端了。但是就是不能用这个生成的客户端进行传参制图。如果直接用http://10.10.31.88/MSPGSWeb/MSPGS/MPService.svc则可以
Juedaifanghua 2014-04-10
  • 打赏
  • 举报
回复
不懂帮顶,看错误提示像配置问题
  • 打赏
  • 举报
回复
你的文件类型不是utf8吧,打开后另存为编码设置为utf8

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧