Friday 15 February 2013

SOAP from Android giving 404 -



SOAP from Android giving 404 -

so i'm getting http error 404 indicating i'm trying access isn't there. can't seem figure out whats missing or i've misunderstood.

namespace: http://tempuri.org/ url: http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc?wsdl action: setpulseoxi soap_action: http://tempuri.org/ipulseoxi/setpulseoxi

the soap service works soapui not ksoap2 android implementation. i've tryed sending raw soap know worked through soapui.

example request android ksoap:

<v:envelope xmlns:i="http://www.w3.org/2001/xmlschema-instance" xmlns:d="http://www.w3.org/2001/xmlschema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"> <v:header /> <v:body> <setpulseoxi xmlns="http://tempuri.org/"> <deviceid>test1</deviceid> <unitid>test2</unitid> </setpulseoxi> </v:body> </v:envelope>

this total wsdl:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="pulseoxisvc" targetnamespace="http://tempuri.org/"> <wsp:policy wsu:id="ipulseoxi_policy"> <wsp:exactlyone> <wsp:all> <http:basicauthentication xmlns:http="http://schemas.microsoft.com/ws/06/2004/policy/http"/> </wsp:all> </wsp:exactlyone> </wsp:policy> <wsdl:types> <xsd:schema targetnamespace="http://tempuri.org/imports"> <xsd:import schemalocation="http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc?xsd=xsd0" namespace="http://tempuri.org/"/> <xsd:import schemalocation="http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/serialization/"/> <xsd:import schemalocation="http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/wcfhomecare"/> </xsd:schema> </wsdl:types> <wsdl:message name="ipulseoxi_getpulseoxibyid_inputmessage"> <wsdl:part name="parameters" element="tns:getpulseoxibyid"/> </wsdl:message> <wsdl:message name="ipulseoxi_getpulseoxibyid_outputmessage"> <wsdl:part name="parameters" element="tns:getpulseoxibyidresponse"/> </wsdl:message> <wsdl:message name="ipulseoxi_getallpulseoxi_inputmessage"> <wsdl:part name="parameters" element="tns:getallpulseoxi"/> </wsdl:message> <wsdl:message name="ipulseoxi_getallpulseoxi_outputmessage"> <wsdl:part name="parameters" element="tns:getallpulseoxiresponse"/> </wsdl:message> <wsdl:message name="ipulseoxi_setpulseoxi_inputmessage"> <wsdl:part name="parameters" element="tns:setpulseoxi"/> </wsdl:message> <wsdl:message name="ipulseoxi_setpulseoxi_outputmessage"> <wsdl:part name="parameters" element="tns:setpulseoxiresponse"/> </wsdl:message> <wsdl:porttype name="ipulseoxi"> <wsdl:operation name="getpulseoxibyid"> <wsdl:input wsaw:action="http://tempuri.org/ipulseoxi/getpulseoxibyid" message="tns:ipulseoxi_getpulseoxibyid_inputmessage"/> <wsdl:output wsaw:action="http://tempuri.org/ipulseoxi/getpulseoxibyidresponse" message="tns:ipulseoxi_getpulseoxibyid_outputmessage"/> </wsdl:operation> <wsdl:operation name="getallpulseoxi"> <wsdl:input wsaw:action="http://tempuri.org/ipulseoxi/getallpulseoxi" message="tns:ipulseoxi_getallpulseoxi_inputmessage"/> <wsdl:output wsaw:action="http://tempuri.org/ipulseoxi/getallpulseoxiresponse" message="tns:ipulseoxi_getallpulseoxi_outputmessage"/> </wsdl:operation> <wsdl:operation name="setpulseoxi"> <wsdl:input wsaw:action="http://tempuri.org/ipulseoxi/setpulseoxi" message="tns:ipulseoxi_setpulseoxi_inputmessage"/> <wsdl:output wsaw:action="http://tempuri.org/ipulseoxi/setpulseoxiresponse" message="tns:ipulseoxi_setpulseoxi_outputmessage"/> </wsdl:operation> </wsdl:porttype> <wsdl:binding name="ipulseoxi" type="tns:ipulseoxi"> <wsp:policyreference uri="#ipulseoxi_policy"/> <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getpulseoxibyid"> <soap:operation soapaction="http://tempuri.org/ipulseoxi/getpulseoxibyid" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="getallpulseoxi"> <soap:operation soapaction="http://tempuri.org/ipulseoxi/getallpulseoxi" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="setpulseoxi"> <soap:operation soapaction="http://tempuri.org/ipulseoxi/setpulseoxi" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="pulseoxisvc"> <wsdl:port name="ipulseoxi" binding="tns:ipulseoxi"> <soap:address location="http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc/wcfhomecare"/> </wsdl:port> </wsdl:service> </wsdl:definitions>

i not sure if help or breakthrough ... or nil

if alter url http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc/wcfhomecare target http://tempuri.org/ipulseoxi/setpulseoxi got result (android ksoap2) result is: object reference not set instance of object.

if utilize action http://tempuri.org/setpulseoxi got 500 response unfortunately not right response, @ to the lowest degree url thing 100% breakthrough.

here code used:

final string namespace = "http://tempuri.org/"; final string url = "http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc/wcfhomecare"; string methodname = "setpulseoxi"; string soapaction = "http://tempuri.org/ipulseoxi/setpulseoxi";//namespace + methodname; soapobject request = new soapobject(namespace, methodname); propertyinfo hhh = new propertyinfo(); hhh.setname("deviceid"); hhh.setvalue("testa"); hhh.settype(string.class); request.addproperty(hhh); propertyinfo ddd = new propertyinfo(); ddd.setname("unitid"); ddd.setvalue("testb"); ddd.settype(string.class); request.addproperty(ddd); propertyinfo asas = new propertyinfo(); asas.setname("userid"); asas.setvalue("1"); asas.settype(string.class); request.addproperty(asas); propertyinfo jkjk = new propertyinfo(); jkjk.setname("pulse_avg"); jkjk.setvalue("1"); jkjk.settype(string.class); request.addproperty(jkjk); propertyinfo location = new propertyinfo(); location.setname("pulse_max"); location.setvalue("1"); location.settype(string.class); request.addproperty(location); propertyinfo xx = new propertyinfo(); xx.setname("pulse_min"); xx.setvalue("1"); xx.settype(string.class); request.addproperty(xx); propertyinfo yy = new propertyinfo(); yy.setname("spo2_avg"); yy.setvalue("1"); yy.settype(string.class); request.addproperty(yy); propertyinfo = new propertyinfo(); as.setname("spo2_max"); as.setvalue("1"); as.settype(string.class); request.addproperty(as); propertyinfo ff = new propertyinfo(); ff.setname("spo2_min"); ff.setvalue("1"); ff.settype(string.class); request.addproperty(ff); propertyinfo tt = new propertyinfo(); tt.setname("uid"); tt.setvalue("1"); tt.settype(string.class); request.addproperty(tt); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = true; envelope.setoutputsoapobject(request); httptransportse androidhttptransport = new httptransportse(url, 15000); androidhttptransport.debug=true; seek { androidhttptransport.call(soapaction, envelope); string result = envelope.getresponse().tostring() ; log.i("yazan", result); } grab (ioexception e) { e.printstacktrace(); } grab (xmlpullparserexception e) { e.printstacktrace(); }

** plz ignore property stupid names :) **

wish luck, if helped you, kindly mark reply :)

more details: if open http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc?wsdl go downwards end of file, see this

<wsdl:service name="pulseoxisvc"> <wsdl:port name="ipulseoxi" binding="tns:ipulseoxi"> <soap:address location="http://testnet.medisat.dk:81/wcfhomecare/pulseoxisvc.svc/wcfhomecare"/> </wsdl:port> </wsdl:service>

as can see location="http://.../wcfhomecare" worked soap services before, location same url not sure if optional set different url location or it's based on specific needs.

from there, think rest of story yours :)

android soap http-status-code-404 android-ksoap2

No comments:

Post a Comment