android - System.Web.Services.Protocols.SoapException: Server was unable to process request.---> System.Data.SqlClient.SqlException: -


i have android application in want retrieve data sqlserver 2008.

the android application connects web service accesses sqlserver database, tried calling method "getcommentstest" retrieves data database , got error:

system.web.services.protocols.soapexception: server unable process request.---> system.data.sqlclient.sqlexception: cannot open database "my database" requested login. login failed. login failed user 'nt authority\network service.'

knowing tried view web service on browser after publishing it, called function , worked.

and here's android code call web service:

public void calltestgetcomments() { try {

        soapobject request = new soapobject(namespace, method_name_get_comments);         request.addproperty("eid", 140);             soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11);         envelope.dotnet=true;         envelope.setoutputsoapobject(request);          httptransportse androidhttptransport = new httptransportse(url_test);         androidhttptransport.call(soap_action_get_comments, envelope);          object result = (object)envelope.getresponse();          string xml=result.tostring();         document doc=xmlfromstring(xml);          doc.getdocumentelement().normalize();          //system.out.println("root element :" + doc.getdocumentelement().getnodename());         nodelist nlist = doc.getelementsbytagname("comment");         //system.out.println("-----------------------");                 //string commentbody,username;                 string commentbody="";          (int = 0; < nlist.getlength(); i++)          {             node nnode = nlist.item(i);            if (nnode.getnodetype() == node.element_node)             {                element eelement = (element) nnode;                       //comment c=new comment();              commentbody += gettagvalue("comment", eelement);               commentbody+= gettagvalue("uphone", eelement);                   //system.out.println("nick name : " + gettagvalue("nickname", eelement));               //system.out.println("salary : " + gettagvalue("salary", eelement));                       //comments.add(c);            }        // tv.settext(result.tostring());            tv.settext(commentbody);         }      }     catch (exception e) {         tv.settext(e.getmessage());         } } 

this permissions related issue. when view web service in browser did ask login?

what method using talk webservice? can post code. willing bet not passing credentials can't without seeing code.

do have access sql server? if have checked error logs invalid logins?

based on so question there no easy way authenticate windows service using ntlm android.

it doesn't matter user on sql server because standpoint of android device not authenticated.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -