我在wso2中有这样的api资源:
<?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>
但是当我从wso2 sample wsdl尝试wsdl时,它完全有效
发生了什么? 如何解决这个问题?答案 0 :(得分:0)
使用地址端点,您应该删除uri末尾的?wsdl:sudo su