2011-05-04 35 views
0
<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<soap:Body> 
<DownloadFaxDocResponse xmlns="http://tempuri.org/"> 
<DownloadFaxDocResult> 
<FileDownload xmlns="" /> 
</DownloadFaxDocResult> 
</DownloadFaxDocResponse> 
</soap:Body> 
</soap:Envelope> 

該文件說我要獲得base64編碼的TIF/PNG文件。我什麼也沒看到。這是否意味着我的Web服務調用有問題?如何處理以下webservice響應?

的文檔是:

http://glostream.faxregistration.com/sfaxapi.asmx?op=DownloadFaxDoc

這是我標題代碼:

//---set the headers--- 
    NSString *msgLength = [NSString stringWithFormat:@"%d", [xmlString length]]; 
    [request addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; 
    [request addValue:@"http://tempuri.org/DownloadFaxDoc" forHTTPHeaderField:@"SOAPAction"]; 
    [request addValue:msgLength forHTTPHeaderField:@"Content-Length"]; 

    //---set the HTTP method and body--- 
    [request setHTTPMethod:@"POST"]; 
    [request setHTTPBody: data]; 

回答

1

是的,我會說有問題的查詢。如果您獲取的是base64編碼數據,則看起來如下所示:

<DownloadFaxDocResult>iVBORw0KGgoAAAANSUhEUgA25CSFPinfIIQQvaGIMQyjrYj98hohhOgNRYxhGH1F7AghhOg 
NOviD1GCCF6QxFjGER ... LOTS MORE ... <DownloadFaxDocResult> 
+0

發現Web服務文檔的標籤拼寫錯誤。想象一下。 – jini 2011-05-04 21:54:24

+0

很高興你的工作。 – Rayfleck 2011-05-04 23:52:45

0

從你附加的鏈接,它顯示:

<soap:Body> 
    <DownloadFaxDocResponse xmlns="http://tempuri.org/"> 
    <DownloadFaxDocResult>xml</DownloadFaxDocResult> 
    </DownloadFaxDocResponse>  
</soap:Body> 

返回結果期望爲XMLNode對象,而不是二進制文件。