Search code examples
eclipseapacheweb-servicessoapwsdl

cant invoke WSDL through web service explorer in eclipse


I have created a web service using apache axis 2.

I have just created a simple class and then created web service of that class.

The WSDL has been created successfully and i can access the same via URL. Now when i try to invoke the web service method using web service explorer an error is coming.

Can anyone help ?

ERROR

IWAB0135E An unexpected error has occurred. 400 Multi-Hop Cycle Detected

SERVER -- Apache Tomcat 7 Apache Axis 2 version -- 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 -- I just consumed this web service WSDL using soap ui and i am getting perfect response


Solution

  • In the interest of others, i would like to provide you with the reason that caused this issue.

    This issue came as there was internal proxy being used wherein the request was going to one server and then was getting redirected to another.

    Once i removed the proxy my code started working fine.

    Cherio.