def executeProcess(self, processUrl, requestXml): self._processExecuted = False self.noFilesToFetch = 0 postData = QByteArray() postData.append(requestXml) scheme = processUrl.scheme() path = processUrl.path() server = processUrl.host() port = processUrl.port() processUrl.removeQueryItem('Request') processUrl.removeQueryItem('identifier') processUrl.removeQueryItem('Version') processUrl.removeQueryItem('Service') qDebug("Post URL=" + pystring(processUrl)) thePostHttp = QgsNetworkAccessManager.instance() request = QNetworkRequest(processUrl) request.setHeader(QNetworkRequest.ContentTypeHeader, "text/xml") # add cookies in header serverCookie = WpsServerCookie(processUrl) if serverCookie.checkServerCookies(): request.setRawHeader("Cookie", serverCookie.getServerCookies()) self.thePostReply = thePostHttp.post(request, postData) self.thePostReply.finished.connect( partial(self.resultHandler, self.thePostReply))
def executeProcess(self, processUrl, requestXml): self._processExecuted = False self.noFilesToFetch = 0 postData = QByteArray() postData.append(requestXml) scheme = processUrl.scheme() path = processUrl.path() server = processUrl.host() port = processUrl.port() processUrl.removeQueryItem('Request') processUrl.removeQueryItem('identifier') processUrl.removeQueryItem('Version') processUrl.removeQueryItem('Service') qDebug("Post URL=" + pystring(processUrl)) thePostHttp = QgsNetworkAccessManager.instance() request = QNetworkRequest(processUrl) request.setHeader( QNetworkRequest.ContentTypeHeader, "text/xml" ) # add cookies in header serverCookie = WpsServerCookie(processUrl) if serverCookie.checkServerCookies(): request.setRawHeader("Cookie", serverCookie.getServerCookies()) self.thePostReply = thePostHttp.post(request, postData) self.thePostReply.finished.connect(partial(self.resultHandler, self.thePostReply) )
def requestDescribeProcess(self): """ Request process description """ self._requestExecuted = False self.doc = None self.inputs = [] self.outputs = [] url = self.requestUrl() myHttp = QgsNetworkAccessManager.instance() request = QNetworkRequest(url) # add cookies in header serverCookie = WpsServerCookie(url) if serverCookie.checkServerCookies(): request.setRawHeader("Cookie", serverCookie.getServerCookies()) self._theReply = myHttp.get(request) self._theReply.finished.connect(self._describeProcessFinished)
def requestCapabilities(self): """ Request server capabilities """ self.doc = None url = QUrl() if '?' in self.baseUrl: myRequest = "&Request=GetCapabilities&identifier=&Service=WPS&Version=" + self.version else: myRequest = "?Request=GetCapabilities&identifier=&Service=WPS&Version=" + self.version url.setUrl(self.baseUrl + myRequest) myHttp = QgsNetworkAccessManager.instance() request = QNetworkRequest(url) # add cookies in header serverCookie = WpsServerCookie(url) if serverCookie.checkServerCookies(): request.setRawHeader("Cookie", serverCookie.getServerCookies()) self._theReply = myHttp.get(request) self._theReply.finished.connect(self._capabilitiesRequestFinished)