Tag: web应用程序

CGImageSourceCreateWithURL进行身份validation

我正在尝试从像这样的URL读取图像属性: http://www.example.com/ws/img/8 因为这是一个web服务,我需要通过身份validation到URL。 我不想下载图像来阅读它的属性。 所以我试图使用这样的CGImageSourceCreateWithURL: CGImageSourceRef imageSourceRef = CGImageSourceCreateWithURL((__bridge CFURLRef)[NSURL URLWithString:@"http://admin:admin@www.example.com/ws/img/8"], NULL); CFDictionaryRef props = CGImageSourceCopyPropertiesAtIndex(imageSourceRef, 0, NULL); 但props仍然返回null。 有没有办法通过身份validation访问图像属性? (如果我通过RestKit函数下载图片,当然是有效的) 谢谢

从iOS应用程序调用Web服务

我想制作一个调用Web服务的简单的iOS应用程序。 我有以下链接http://www.codeproject.com/Tips/622376/iOS-Soap-Webservice-Calling-and-Parsing-the-Respon 我试图运行我从这个链接得到的示例项目。但是我得到的答复像 “soap:ClientServer无法识别HTTP Header SOAPAction的值: http : //tempuri.org/” 。 我无法找出这个错误背后的原因是什么。而且我对web服务非常陌生。任何人都可以帮助我解决这个错误?有人请告诉我,调用Web服务的基本步骤是什么?从iOS应用程序。是否有Xcode和iOS调用Web服务的任何特殊的版本要求?请帮助我…预先感谢任何帮助… 这是我用来发送请求的代码 NSString *soapMessage = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" "<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/\">\n" "<soap:Body>\n" " <CelsiusToFahrenheit xmlns=\"http://tempuri.org/\">\n" "<Celsius>%@</Celsius>\n" "</CelsiusToFahrenheit>\n" "</soap:Body>\n" "</soap:Envelope>\n" ,textFieldCelcisus.text]; NSURL *url = [NSURL URLWithString:@"http://w3schools.com/webservices/tempconvert.asmx"]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]]; [theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [theRequest […]

iOSnetworking应用程序:防止屏幕变暗/locking

如何防止iOS调暗和/或locking我的WEB应用程序的屏幕? 这是一个WEB应用程序,所以任何本机代码build议将不适用。 WEB应用程序运行时没有用户input,我想避免iOS自动调暗/locking屏幕(不需要在全局设置中closures设置)。 有没有办法让一个WEB应用程序告诉iOS不要调暗/locking屏幕? 如果上述内容不可用,是否有任何第三方应用程序可以监视系统,并在给定的Web应用程序运行时closures屏幕locking/调暗? 谢谢。

结合ios(推送通知)和android(GCM)API(webservice)进行通知

我是一个Android开发人员,所以我不太了解PHP。 我们正在开发Android和IOS的考试纸应用程序。 并创build通知function完美的作品。 但问题是IOS使用推送通知和Android使用GCM。 而这两个是使用不同的api。 我的问题是如何结合这两个API。 我想将这两个API(web服务)合并为一个。 当pipe理员上传文件,然后所有用户通知使用通知天气它是Android或IOS设备。 我该怎么办? 非常感谢提前帮助。 我正在使用这个链接 这是我的努力 Android API <?php require_once('connect.php'); // API access key from Google API's Console define( 'API_ACCESS_KEY', 'AIzaSyBWcc6ONXvNEHECxzLwFDSDCTKDTjEhfT8' ); //$registrationIds = array( $_GET['id'] ); $conn = new mysqli('host name', 'server name', 'password', 'database name'); $select_qury = "SELECT gcm_registration_id FROM gtu_registration"; $result = $conn->query($select_qury); $registrationIds = array(); […]

触摸两个DOM元素的事件?

我有两个dom元素紧挨着。 在触摸事件期间,我希望能够滑过每个元素。 就我而言,根据我所处的环境,我想要发生不同的事情。 这是什么样子? 由于触摸已closures,新的触摸事件不会在滑入新元素时触发。 谢谢! 编辑:这是实际的代码 ul li 1 li 2 li 3 我想在每个项目上进行不断的触摸移动事件,我真的需要它能够知道当前li的索引 现在我试着: $('ul').live 'touchmove', (event) -> element = document.elementFromPoint(event.clientX, event.clientY) #now i need the index of this element somehow

在swift中处理XMLparsing的响应

以下是我使用集成密钥,用户名和密码将SOAP消息发送到Web服务的代码。 我能够得到响应并将其parsing为foundCharacters。 现在我需要存储在parsing的响应中find的两个元素,以便稍后可以使用它们来处理另一个请求。 我一直在寻找教程,但我不能安静地理解这些教程,因为其中大多数是关于XML文件本地存储,而不是从真正的WebService。 class LoginCentralViewController: UIViewController, XMLParserDelegate, NSURLConnectionDelegate { var chaveWS = ChaveWebService().chave() var mutableData:NSMutableData = NSMutableData() var currentElement:NSString = "" @IBAction func btnAcessarACTION(_ sender: Any) { let soapMessage = "<soapenv:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:log='LoginCentral'><soapenv:Header/><soapenv:Body><log:LoginCentral soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><Autenticacao xsi:type='urn:Autenticacao' xmlns:urn='urn:RouterBoxMobile'><ChaveIntegracao xsi:type='xsd:string'>\(chaveWS)</ChaveIntegracao></Autenticacao><DadosLoginCentral xsi:type='urn:DadosLoginCentral' xmlns:urn='urn:RouterBoxMobile'><Usuario xsi:type='xsd:string'>wagner</Usuario><Senha xsi:type='xsd:string'>mudar123</Senha></DadosLoginCentral></log:LoginCentral></soapenv:Body></soapenv:Envelope>" let urlString = "https://example.com?wsdl" let url = NSURL (string: urlString) let […]

iOS 8.3 – 1.0以下的元视口初始缩放比例会导致方向更改时出现奇怪的内容缩放

将我的iOS设备升级到iOS 8.3后,我注意到了元视口初始缩放属性的一些奇怪的行为。 如果我将初始缩放比例设置为1.0,并在网页上旋转我的设备,则整个内容将逐渐变小,最终浏览器将崩溃。 我注意到,每个方向变化的内容变小的程度与您设置初始缩放比例有关。 例如,如果我将其设置为0.9,内容将每次减less10%。 如果将其设置为0.6,则内容将每次减less40%。 由于这个bug的性质,它不能在jsfiddle上放置或体验。 相反,我将在这里粘贴代码,以便您可以在某处testing它: <!doctype html> <html> <head> <title>initial scale under 1.0</title> <meta name="viewport" content="width=device-width, initial-scale=0.7, user-scalable=0" /> </head> <body> <div id = "wrapper"> <h1>Hello, run this page on iOS 8.3 device and change the orientation multiple times to make this text go smaller and eventually crash the browser!</h1> </div> </body> […]

如何在Swift 3中从webservice创buildJson响应的模型类

我是新来的迅速。 而我正在迅速的项目。 我得到如下所示的响应服务器响应 kNetworkManager.executePostRequest(urlString: kAppSocialLoginURL, params:mainDictionary, requestVC: self,completionHandler: {(responseObject) -> () in // print("response object:\(responseObject!)") if responseObject != nil { let responseDictionary = responseObject as! NSDictionary if responseDictionary is NSDictionary{ let obj = responseDictionary.value(forKey:"user") if obj is NSDictionary{ //success case print("NSDictionary is",obj ?? NSDictionary()) UtilityClass.sharedInstance.userDetailsDictionary = responseDictionary as! [String : AnyObject] if let obj = […]

来自ios Client的NTLM身份validation

我在.net中有一个Web服务,它需要NTLM (基于IIS的Windows服务器)身份validation才能访问。 我如何从iOS客户端获得NTLMauthentication。

HTTPS web服务与PHP会话

我需要在使用HTTPS和PHP Session的PHP中构build一个WebService。 我如何从iOS(目标c)获得服务以及如何在login到服务器时保存/使用php的会话?