2016-11-16 107 views
0

我有一个API资源在WSO2这样的:WSO2 ESB WstxEOFException阅读ADRESS端点

<?xml version="1.0" encoding="UTF-8"?> 
<api context="/akademik" name="GetListStudent" xmlns="http://ws.apache.org/ns/synapse"> 
<resource methods="GET" uri-template="/students"> 
    <inSequence> 
     <header scope="default"> 
      <m:complexHeader xmlns:m="http://org.synapse.example"> 
       <property key="SOAPAction" value="getListStudent"/> 
       <property key="Content-Type" value="text/xml"/> 
      </m:complexHeader> 
     </header> 
     <send> 
      <endpoint> 
       <address format="soap11" uri="http://localhost:8080/AkademikSOAP/Service?wsdl"/> 
      </endpoint> 
     </send> 
    </inSequence> 
    <outSequence> 
     <send/> 
    </outSequence> 
    <faultSequence/> 
</resource> 

和WSDL:https://dl.dropboxusercontent.com/u/49439028/Service.xml

当我尝试访问它的API显示

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/> 
<S:Body> 
    <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope> 
     <faultcode>S:Client</faultcode> 
     <faultstring>Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog 
at [row,col {unknown-source}]: [1,0]</faultstring> 
    </S:Fault> 
</S:Body> 

但是当我尝试wsdl从wso2 sample wsdl它完美的工作

会发生什么? 如何解决这个问题?

回答

0

与地址终点,你应该在你的URI成为最后删除WSDL:http://localhost:8080/AkademikSOAP/Service

+0

我已经改变了它,并且错误仍然是相同的 –

+0

当您“尝试访问API “,你给它发送一条消息,根据有效负载设置ContentType:text/xml,用于带有xml序言(版本,编码)的soap11消息以及完整的soap信封/ body? –