2011-10-31 82 views
2

我試圖在Flex Builder 3項目中使用我的.Net Web服務。該功能在服務簽名是:在Flex Builder 3中手動使用WSDL

bool MyFunction(Enums.Channels var1, Enums.Payments.PayMethods var2) 

我試圖導入具有嚮導中的WSDL,但是當我試圖把它導致一個錯誤,說明

「不能馬歇爾式」 http://www.w3.org/2001/XMLSchema::EnumsChannel Web服務「 簡單類型」

什麼樣的對象,我需要在Flex Builder 3創建傳遞到Web服務,以便它會將其識別爲適當的類型?嚮導沒有正確創建適當的類型。這是枚舉的xsd。

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/My.Shared" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/My.Shared"> 
    <xs:simpleType name="Enums.Channels"> 
    <xs:restriction base="xs:string"> 
     <xs:enumeration value="Web"/> 
     <xs:enumeration value="ContactCenter"/> 
    </xs:restriction> 
    </xs:simpleType> 
    <xs:element name="Enums.Channels" nillable="true" type="tns:Enums.Channels"/> 
    <xs:simpleType name="Enums.Payments.PayMethods"> 
     <xs:restriction base="xs:string"> 
     <xs:enumeration value="CreditCard"/> 
     <xs:enumeration value="PayPal"/> 
     <xs:enumeration value="eBillme"/> 
     <xs:enumeration value="BillMeLater"/> 
     <xs:enumeration value="TeleCheck"/> 
     </xs:restriction> 
    </xs:simpleType> 
    <xs:element name="Enums.Payments.PayMethods" nillable="true" type="tns:Enums.Payments.PayMethods"/> 
</xs:schema> 

我想嘗試建立自己的對象稱自己的服務(不使用嚮導)....創建mx:WebServicemx:Operation,但不知道如何處理枚舉參數。

我想這有點類似於這個問題Flex, .NET Web Service and Numeric Enums但有點相反。

回答

-1

試試這個

<s:WebService id="myWS" wsdl="yourServicePath?WSDL" result="resultHandler(event)" fault="faultHandler(event)"> 
    <s:operation name="MyFunction"> 
     <s:request xmlns=""> 
      <var1>{var1 value}</var1> 
      <var2>{var2 value}</var2> 
     </s:request> 
    </s:operation> 
</s:WebService> 

調用web服務:類型

myWS.MyFunction.send(); 
+0

-1,因爲這不是一個問題的答案。用戶明確指出他使用帶有操作的web服務,但他不知道如何處理枚舉。因此你的回答可以被認爲對這個問題沒有幫助。 –