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))
예제 #2
0
    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)
예제 #4
0
    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)
예제 #5
0
    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)
예제 #6
0
    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)