Janis Peisenieks
Janis Peisenieks

Reputation: 4998

SoapUI not finding my web-service

So I've been struggling with web-services for a couple of days now, and It seemed that I finally had a breakthrough.

I followed this tutorial to the letter, and I have my web-service up and running. The only problem is, that I can't seem to test it via soapUI.

If I go to http://localhost:8084/soapwebservices It displays the data about my web-service, eg, the location of wsdl, and so on. Judging by that, the link is correct.

But when I try to send this request to it:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="soapwebservices.jdevelop.eu">
   <soapenv:Header/>
   <soapenv:Body>
      <soap:calculateValues>
         <value1>10</value1>
         <value2>3.21</value2>
      </soap:calculateValues>
   </soapenv:Body>
</soapenv:Envelope>

I get a 404 error:

<head><title>Not Found (404)</title></head>
<body><h1>Not Found (404)</h1>
<b>Original request:</b> http://localhost:8084/soapwebservices<br><br>
<b>Not found request:</b> http://localhost:8084/soapwebservices</body>

Here is my WSDL:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns:ns1="soapwebservices.jdevelop.eu" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://schemas.xmlsoap.org/soap/encoding/" name="SOAPWebServices" targetNamespace="soapwebservices.jdevelop.eu">
    <types>
        <xsd:schema>
            <xsd:import namespace="soapwebservices.jdevelop.eu" schemaLocation="webservices.xsd"/>
        </xsd:schema>
    </types>
    <message name="calculateValues">
        <part name="calculateValues" element="ns1:calculateValues"/>
    </message>
    <message name="calculateValuesResponse">
        <part name="calculateValuesResponse" element="ns1:calculateValuesResponse"/>
    </message>
    <portType name="SOAPWebServices">
        <operation name="getCalculateValues">
            <input message="ns1:calculateValues"/>
            <output message="ns1:calculateValuesResponse"/>
        </operation>
    </portType>
    <binding name="SOAPWebServicesPortBinding" type="ns1:SOAPWebServices">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="getCalculateValues">
            <soap:operation soapAction="urn:http://blog.jdevelop.eu/services/getCalculateValues"/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="SOAPService">
        <port name="WebServices" binding="ns1:SOAPWebServicesPortBinding">
            <soap:address location="http://blog.jdevelop.eu:80/services"/>
        </port>
    </service>
</definitions>

What could be the problem here?

I am using Netbeans 6.0.1, Apache Tomcat 6.0 and Java SDK 1.7 Thanks!

Upvotes: 0

Views: 24753

Answers (2)

Deepu Surendran
Deepu Surendran

Reputation: 215

Check the namespce in your endpoint class and the schema , both should be same

Upvotes: 0

Santosh
Santosh

Reputation: 17923

Couple of observations:

  1. In your SOAP message, the operation name you are sending is calculateValues (<soap:calculateValues>) whereas the operation name mentioned in the WSDL is getCalculateValues (<operation name="getCalculateValues">). This may be the reason behind 404 error as calculateValues operation is not defined.

  2. I assume that you are not posting the SOAP message at the service URL mentioned in the WSDL (<soap:address location="http://blog.jdevelop.eu:80/services"/>).

Upvotes: 3

Related Questions