Hi,
I'm having a problem accessing my web-service.
For now, i'm am running the WS in localhost.
This is my code:
private static final String SOAP_ACTION = "";
private static final String METHOD_NAME = "getPOIS";
private static final String NAMESPACE = "http://ws.projectName/";
private static final String URL = "http://10.0.2.2:8084/projectName/GetPOIS";
//--//
object = new SoapObject(NAMESPACE, METHOD_NAME);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
object.addProperty("username", "ze");
object.addProperty("latitude", 40.211491);
object.addProperty("longitude", -8.429201);
envelope.setOutputSoapObject(object);
HttpTransportSE aht = new HttpTransportSE(URL);
try{
aht.call(SOAP_ACTION, envelope);
SoapPrimitive primitive = (SoapPrimitive) envelope.getResponse();
tv.setText("From Server: " + primitive);
}catch(Exception e){
e.printStackTrace();
}
//--//
I have the internet permission in the manifest file.
And i am also using a mapactivity, instead of a normal activity
However, I can't get the webservice to respond.
This is my WSDL:
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. --><definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.projectName/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.projectName/" name="GetPOISService">
<types>
<xsd:schema>
<xsd:import namespace="http://ws.projectName/" schemaLocation="http://localhost:8084/projectName/GetPOIS?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="getPOIS">
<part name="parameters" element="tns:getPOIS"></part>
</message>
<message name="getPOISResponse">
<part name="parameters" element="tns:getPOISResponse"></part>
</message>
<portType name="GetPOIS">
<operation name="getPOIS">
<input message="tns:getPOIS"></input>
<output message="tns:getPOISResponse"></output>
</operation>
</portType>
<binding name="GetPOISPortBinding" type="tns:GetPOIS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<operation name="getPOIS">
<soapperation soapAction=""></soapperation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="GetPOISService">
<port name="GetPOISPort" binding="tns:GetPOISPortBinding">
<soap:address location="http://localhost:8084/projectName/GetPOIS"></soap:address>
</port>
</service>
</definitions>
Can anyone help me?
I'm having a problem accessing my web-service.
For now, i'm am running the WS in localhost.
This is my code:
private static final String SOAP_ACTION = "";
private static final String METHOD_NAME = "getPOIS";
private static final String NAMESPACE = "http://ws.projectName/";
private static final String URL = "http://10.0.2.2:8084/projectName/GetPOIS";
//--//
object = new SoapObject(NAMESPACE, METHOD_NAME);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
object.addProperty("username", "ze");
object.addProperty("latitude", 40.211491);
object.addProperty("longitude", -8.429201);
envelope.setOutputSoapObject(object);
HttpTransportSE aht = new HttpTransportSE(URL);
try{
aht.call(SOAP_ACTION, envelope);
SoapPrimitive primitive = (SoapPrimitive) envelope.getResponse();
tv.setText("From Server: " + primitive);
}catch(Exception e){
e.printStackTrace();
}
//--//
I have the internet permission in the manifest file.
And i am also using a mapactivity, instead of a normal activity
However, I can't get the webservice to respond.
This is my WSDL:
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. --><definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.projectName/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.projectName/" name="GetPOISService">
<types>
<xsd:schema>
<xsd:import namespace="http://ws.projectName/" schemaLocation="http://localhost:8084/projectName/GetPOIS?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="getPOIS">
<part name="parameters" element="tns:getPOIS"></part>
</message>
<message name="getPOISResponse">
<part name="parameters" element="tns:getPOISResponse"></part>
</message>
<portType name="GetPOIS">
<operation name="getPOIS">
<input message="tns:getPOIS"></input>
<output message="tns:getPOISResponse"></output>
</operation>
</portType>
<binding name="GetPOISPortBinding" type="tns:GetPOIS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<operation name="getPOIS">
<soapperation soapAction=""></soapperation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="GetPOISService">
<port name="GetPOISPort" binding="tns:GetPOISPortBinding">
<soap:address location="http://localhost:8084/projectName/GetPOIS"></soap:address>
</port>
</service>
</definitions>
Can anyone help me?