【问题标题】:WSDL ArrayType in Domino Designer 8.5.2Domino Designer 8.5.2 中的 WSDL ArrayType
【发布时间】:2014-04-08 15:01:24
【问题描述】:

我正在使用下面代码创建的 WSDL 文件 -

Class test_n0 As ArrayType_n1 
    Public test() As test_test2_n0
    Sub NEW
End Sub

End Class
Class  As test_test2_n0 

Public t1 As StringType_n1
Public t2 As StringType_n1
Public t3 As StringType_n1

Sub NEW
End Sub

End Class

我无法在 lotus 脚本中处理 ArrayType。谁能帮帮我。

示例 WSDL - 我无法复制整个..但如下所示

 <xs:complexType name="SDDBComputer2InstanceType">
 <xs:sequence>
 <xs:element name="test" type="cmn:StringType" nillable="true" minOccurs="0"/>
 <xs:element name="test.hba" minOccurs="0">
 <xs:complexType>
 <xs:complexContent>
 <xs:extension base="cmn:ArrayType">
 <xs:sequence>
 <xs:element name="test.hba" minOccurs="0" maxOccurs="unbounded">
 <xs:complexType>
 <xs:complexContent>
 <xs:extension base="cmn:StructureType">
 <xs:sequence>
 <xs:element name="t1" type="cmn:StringType" nillable="true" minOccurs="0"/>
 <xs:element name="t2" type="cmn:StringType" nillable="true" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>

名称空间详细信息。

<definitions 
xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:ns="http://schemas.hp.com/SM/7" 
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/">

我无法在 lotusscript 中处理数组。 Lotus 脚本代码如下 -

  Dim testSome_Sub As New test_n0 
  Dim testsome2_Sub As New test_test2_n0
  testsome2_Sub.t1.Value = "some value"
  testsome2_Sub.t2.Value = "some value"
  testsome2_Sub.t3.Value = "some value"
  Set testSome_Sub.test(0) = testsome2_Sub 

//这是我遇到问题的地方,因为我将一个结构元素分配给数组。

【问题讨论】:

  • 您可以发布您的示例 WSDL 吗?
  • @Simon 添加了示例 WSDL。由于它是由第三方提供的,所以我不能放整个。
  • 还有很多事情要做。您可以在 标记中发布命名空​​间吗?如果没有,我将发布一些步骤进行调查。
  • &lt;definitions xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/http: //schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns="http://schemas.hp.com/SM/7" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"&gt; 这行得通吗?感谢您的快速帮助。
  • 很遗憾,因为无法看到架构,所以我无法发表更多评论。

标签: web-services wsdl lotus-notes lotusscript


【解决方案1】:

终于解决了。感谢@Simon 的所有指导和帮助。

我在 lotuscript 代码中做了一些变通方法来重新声明此处声明的数组并且它有效。 启动 Web 服务并声明 Web 服务的所有其他元素后,我再次使用 - 声明了数组 test() -

Redim test(10) as test_test2_n0

现在我可以在上面声明的数组中分配 test_test2_n0(结构类型)的元素。

所以我的最终代码在这里 -

Web 服务使用者 - 使用 WSDL 由注释创建 -

Class test_n0 As ArrayType_n1
Public test() As test_test2_n0
Sub NEW
End Sub
 End Class

Class test_test2_n0 As StructureType_n1

Public t1 As StringType_n1
Public t2 As StringType_n1
Public t3 As StringType_n1
Sub NEW
End Sub
End Class

Notes 代理中的示例代码 -

Dim testStruct_Sub As New test_test2_n0
Dim testArray_Sub As New test_n0
Redim test(10) as test_test2_n0
Set testStruct_Sub.t1= "Some Value"
Set testStruct_Sub.t2= "Some Value"
Set testStruct_Sub.t3= "Some Value"
Set testArray_Sub.test(0) = testStruct_Sub

我的学习-

  1. 如果在 lotussript 代码中没有识别出任何类型,请使用兼容的类型类重新声明变量。
  2. 如果您在使用者中创建了几个具有相同名称的类(一个使用 StructureType,另一个使用 ArrayType),则必须重新设计架构,使其只有一个结构数组。

我花了很多时间来理解第二点,我发现 Notes 有局限性。

【讨论】:

    【解决方案2】:

    您的命名空间看起来不对。我怀疑你删除了那些你不能发布的东西。

    据我了解,问题出在这条线上?

    <xs:extension base="cmn:ArrayType">
    

    创建这个类:

    Class test_n0 As ArrayType_n1 
        Public test() As test_test2_n0
        Sub NEW
        End Sub
    End Class
    

    如果是这种情况,您需要检查cmn 的架构。这将在 DEFINITIONS 标记中的命名空间中引用,在 LS 代码中为:

    const n1 = "URL to Schema"
    

    一旦你有了这个架构,你就需要看看它是什么结构。根据您的 LS 代码,这将是

    的一种方法
    Public test() As test_test2_n0
    

    test_test2 将在 n0 架构中被引用。您还需要检查。目前,代码 sn-p 看起来有效,但如果没有完整的 WSDL/XSD 文件(不是默认文件),我无法确认这一点。

    除此之外,还有一些其他的事情要检查。

    1. 将 WSDL 作为提供者导入 Designer 客户端。有时,如果它不喜欢某些东西,它会给出更具描述性的信息。

    2. 将 WSDL 作为 Java 使用者导入,并将创建的对象与 LotusScript 进行比较,看看有什么不同(假设它作为 Java 导入)。

    3. LotusScript 对命名方法/变量有 36 个字符的限制。但我没有看到证据表明这是您的 sn-ps 中的一个问题。

    4. LotusScript 不区分大小写,而 Java 是。因此,您最终可能会得到重复的引用。

    5. LotusScript + WSDL 不检查彼此的保留关键字(例如文本、文件、注释文档)。如果您有其中之一,则可能会导致导入问题。

    【讨论】:

    • 是的。那是对的。代码的创建方式与您上面提到的相同。当我访问 Class test_n0 As ArrayType_n1 Public test() As test_test2_n0 Sub NEW End Sub End Class 中的 test() 时,我无法在 lotusscript 中处理数组。 Lotus 脚本代码如下 - Dim testSome_Sub As New test_n0 Dim testsome2_Sub As New test_test2_n0 testsome2_Sub.t1.Value = "some value"
    猜你喜欢
    • 2013-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多