通訊協定處理常式組織架構方法

下一節說明設計新的通訊協定處理常式或修改現有的通訊協定處理常式時,所使用的「通訊協定處理常式組織架構」方法。

getContent ()

getContent() 方法用於商業物件處理。它執行下列動作:

語法

public abstract Object getContent (Object input, String mimeType,
 String BOprefix) throws IOException
 

參數

input
指定商業物件介面 (要傳送的商業物件)

mimeType
指定傳遞給資料處理常式之資料的 MIME 類型

BOprefix
指定傳遞給資料處理常式之資料的 BOPrefix

回覆值

傳回商業物件介面

呼叫 WebSphere Business Integration Adapter 提供的通訊協定處理常式

下列程式碼範例說明如何呼叫 WebSphere Business Integration Adapter 提供的通訊協定處理常式。

try
 {
 // 設定系統內容,以便 Java 知道到何處尋找
 // 通訊協定處理常式。您僅需要執行一次即可。
 Properties prop = System.getProperties();
 prop.put("java.protocol.handler.pkgs",
 "com.crossworlds.connectors.utils.ProtocolHandlers");
  
 URL url = new URL(『http://www.crossworlds.com』);
 CWURLConnection uc = (CWURLConnection) url.openConnection();
 BusinessObjectInterface respBO = (BusinessObjectInterface)
 uc.getContent (input, mime, prefix);
  
 }
 catch (Exception XX)
 {
 //旗標錯誤
 }
 

Copyright IBM Corp. 1997, 2003