我使用apache axis 2创建了一个Web服务。
我刚刚创建了一个简单的类,然后创建了该类的Web服务。
WSDL已成功创建,我可以访问相同的URL。现在,当我尝试使用Web服务资源管理器调用Web服务方法时,将出现错误。
有人可以帮忙吗?
ERROR
IWAB0135E发生了意外错误。 400 检测到多跳周期
SERVER - Apache Tomcat 7 Apache Axis 2版本 - axis2-1.6.0
WSDL
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://com" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://com">
<wsdl:documentation>
Please Type your service description here
</wsdl:documentation>
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://com">
<xs:element name="getSum">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="a" type="xs:int"/>
<xs:element minOccurs="0" name="b" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getSumResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getMessage">
<xs:complexType>
<xs:sequence/>
</xs:complexType>
</xs:element>
<xs:element name="getMessageResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getSumRequest">
<wsdl:part name="parameters" element="ns:getSum"/>
</wsdl:message>
<wsdl:message name="getSumResponse">
<wsdl:part name="parameters" element="ns:getSumResponse"/>
</wsdl:message>
<wsdl:message name="getMessageRequest">
<wsdl:part name="parameters" element="ns:getMessage"/>
</wsdl:message>
<wsdl:message name="getMessageResponse">
<wsdl:part name="parameters" element="ns:getMessageResponse"/>
</wsdl:message>
<wsdl:portType name="DemoPortType">
<wsdl:operation name="getSum">
<wsdl:input message="ns:getSumRequest" wsaw:Action="urn:getSum"/>
<wsdl:output message="ns:getSumResponse" wsaw:Action="urn:getSumResponse"/>
</wsdl:operation>
<wsdl:operation name="getMessage">
<wsdl:input message="ns:getMessageRequest" wsaw:Action="urn:getMessage"/>
<wsdl:output message="ns:getMessageResponse" wsaw:Action="urn:getMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DemoSoap11Binding" type="ns:DemoPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getSum">
<soap:operation soapAction="urn:getSum" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getMessage">
<soap:operation soapAction="urn:getMessage" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="DemoSoap12Binding" type="ns:DemoPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="getSum">
<soap12:operation soapAction="urn:getSum" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getMessage">
<soap12:operation soapAction="urn:getMessage" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="DemoHttpBinding" type="ns:DemoPortType">
<http:binding verb="POST"/>
<wsdl:operation name="getSum">
<http:operation location="getSum"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getMessage">
<http:operation location="getMessage"/>
<wsdl:input>
<mime:content type="text/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Demo">
<wsdl:port name="DemoHttpSoap11Endpoint" binding="ns:DemoSoap11Binding">
<soap:address location="http://localhost:8080/DemoService/services/Demo.DemoHttpSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="DemoHttpSoap12Endpoint" binding="ns:DemoSoap12Binding">
<soap12:address location="http://localhost:8080/DemoService/services/Demo.DemoHttpSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="DemoHttpEndpoint" binding="ns:DemoHttpBinding">
<http:address location="http://localhost:8080/DemoService/services/Demo.DemoHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
UPDATE - 我刚刚使用soap ui使用了这个Web服务WSDL,我得到了完美的回复
答案 0 :(得分:0)
为了他人的利益,我想向您提供导致此问题的原因。
出现此问题的原因是使用了内部代理,其中请求转到一台服务器,然后被重定向到另一台服务器。
一旦我删除了代理,我的代码就开始正常工作了。
Cherio。