发送肥皂体内的布尔值作为参数

时间:2018-11-15 06:18:21

标签: ios objective-c soap soap-client nsmutableurlrequest

如何在皂体中发送布尔值,使其打印为false和true而不是0或1?

"<AllDayEvent>boolean</AllDayEvent>\n"

我希望正文打印为:

"<AllDayEvent>false</AllDayEvent>\n"

感谢与问候

2 个答案:

答案 0 :(得分:0)

布尔词法形式“ 1”和“ true”,“ 0”和“ false”可以互换。 从Soap spec:

定义为布尔值的数据类型的实例:

Function AttachDSNLessTable(stLocalTableName As String, stRemoteTableName As String, stDriverName As String, stServer As String, stDatabase As String, Optional stUsername As String, Optional stPassword As String)
    On Error GoTo AttachDSNLessTable_Err
    Dim td As TableDef
    Dim stConnect As String

    For Each td In CurrentDb.TableDefs
        If td.Name = stLocalTableName Then
            CurrentDb.TableDefs.Delete stLocalTableName
            Exit For
        End If
    Next

    If Len(stUsername) = 0 Then
        '//Use trusted authentication if stUsername is not supplied.
        stConnect = "ODBC;DRIVER=" & stDriverName & ";SERVER=" & stServer & ";DATABASE=" & stDatabase & ";Trusted_Connection=Yes"
    Else
        '//WARNING: This will save the username and the password with the linked table information.
        stConnect = "ODBC;DRIVER=" & stDriverName & ";SERVER=" & stServer & ";DATABASE=" & stDatabase & ";UID=" & stUsername & ";PWD=" & stPassword
    End If

    Set td = CurrentDb.CreateTableDef(stLocalTableName)
    td.SourceTableName = stRemoteTableName
    td.Connect = stConnect

    CurrentDb.TableDefs.Append td
    AttachDSNLessTable = ""
    Exit Function

AttachDSNLessTable_Err:

    AttachDSNLessTable = err.Description

End Function

可以具有以下合法文字{true,false,1,0}。

布尔值的规范表示形式是一组文字{true,false}。

答案 1 :(得分:0)

只需创建BOOL变量,如

BOOL isAllDayEvent;
isAllDayEvent=true;
<AllDayEvent>isAllDayEvent</AllDayEvent>

尝试