Hi,

My name is Paulo, and i'm from Portugal.
I need to make a client to a web service, but i'm still fresh with SOAP/WSDL
and Axis.
I would appreciate any hel on this.

I'm trying to access the services under
http://meteo.estg.ipleiria.pt/webservice/service1.asmx

The following is a sample SOAP 1.2 request and response example available on
that page

REQUEST

POST /webservice/service1.asmx HTTP/1.1
Host: meteo.estg.ipleiria.pt
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope";>
  <soap12:Body>
    <ValoresActuais_GetTemperatura xmlns="http://tempuri.org/"; />
  </soap12:Body>
</soap12:Envelope>

RESPONSE

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope";>
  <soap12:Body>
    <ValoresActuais_GetTemperaturaResponse xmlns="http://tempuri.org/";>
      
<ValoresActuais_GetTemperaturaResult>float</ValoresActuais_GetTemperaturaResult>
    </ValoresActuais_GetTemperaturaResponse>
  </soap12:Body>
</soap12:Envelope>

-------------------------------------------

And here The following is a sample SOAP 1.1 request and response on
the same page

REQUEST

POST /webservice/service1.asmx HTTP/1.1
Host: meteo.estg.ipleiria.pt
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/ValoresActuais_GetTemperatura";

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
    <ValoresActuais_GetTemperatura xmlns="http://tempuri.org/"; />
  </soap:Body>
</soap:Envelope>


RESPONSE

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
    <ValoresActuais_GetTemperaturaResponse xmlns="http://tempuri.org/";>
      
<ValoresActuais_GetTemperaturaResult>float</ValoresActuais_GetTemperaturaResult>
    </ValoresActuais_GetTemperaturaResponse>
  </soap:Body>
</soap:Envelope>


And here's the code i'm using to request that service

public String consume() {
    try {
       String endpoint = "
http://meteo.estg.ipleiria.pt/webservice/service1.asmx";;

       Service  service = new Service();
       Call call = (Call) service.createCall();

       call.setTargetEndpointAddress( new java.net.URL(endpoint) );
       call.setOperationName(new QName("http://tempuri.org/";,
"ValoresActuais_GetTemperatura"));


       System.out.print(call.getOperationName());
       System.out.print(call.getSOAPActionURI());

      String ret = (String) call.invoke(new Object[] { "" }  );

       System.out.print(ret);

      } catch (Exception e) {
        System.err.println(e.toString());
        return e.toString();
      }

    }

And i'm always getting the following error:

Server did not recognize the value of HTTP Header SOAPAction: .

So, what i 'm i doing wrong?
Can someone help me on this, please?

Thanks

Paulo

Reply via email to