SqlServer 2008에서 데이터를 검색하려는 안드로이드 응용 프로그램이 있습니다.System.Web.Services.Protocols.SoapException : 서버가 요청을 처리 할 수 없습니다 .--- System.Data.SqlClient.SqlException :
안드로이드 어플은 데이터베이스에서 데이터를 검색하는 방법 "getCommentsTest"을 호출 시도 SQLSERVER 데이터베이스, 에 액세스하는 웹 서비스에 연결하고이 오류가있어 :
System.Web.Services.Protocols.SoapException을 : 서버가 요청을 처리 할 수 없습니다 .---> System.Data.SqlClient.SqlException : 데이터베이스를 열 수 없습니다 "내 데이터베이스" lo 요청한 진. 로그인에 실패했습니다. 'NT AUTHORITY \ NETWORK SERVICE'사용자가 로그인하지 못했습니다.
게시 한 후 브라우저에서 웹 서비스를 보려고 시도했음을 알았으므로이 함수를 호출하고 작동했습니다.() { 이이 문제와 관련된 권한입니다 {
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="";
for (int i = 0; i < 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());
}
}
먼저 Windows 인증을 사용하여 로그인하도록 브라우저를 조정했기 때문에 브라우저에 로그인하라는 메시지가 표시되지 않았습니다. 다음은 연결 문자열입니다. "data source = .; 초기 카탈로그 = 크롤러; 통합 보안 = true;" 그리고 나는 안드로이드 코드를 넣어 웹 서비스를 호출 할 것이다. –
웹 서비스가 'NT AUTHORITY \ NETWORK SERVICE.'사용자를 사용하여 데이터베이스에 액세스합니다.이 사용자는 sqlServer의 시스템 관리자입니다. –
내 편집보기 ... – bytebender