Question

I am consuming WSDL file which is creating below code -

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

I am not able to handle the ArrayType in lotus script. Can some one help me out here.

Sample WSDLs - I can not copy the whole..but it looks like below

 <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>

Name space details.

<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/">

I am not able to have handle of the array in lotusscript. Lotus script code is as below -

  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 

//this is where I am getting issue as I am assigning the one structure elements to array.

Was it helpful?

Solution

Finally its resolved. Thank you @Simon for all your guidance and help.

I did some workaround in lotuscript code to re-declare the array declared here and it worked. After initiating the web service and declaring all other elements of the web service I declared the array test() again using -

Redim test(10) as test_test2_n0

Now I can assign the elements of test_test2_n0 (which is of structure type) in array declared above.

So my final code here -

Web Service Consumer - created by notes using the 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

Sample code in Notes Agent -

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

My learning -

  1. If any type is not getting identified in lotussript code, re-declare the variable with the compatible type class.
  2. If you have couple of classes created with same name (one with StructureType and other with ArrayType) in consumer, you have to re-design your schema so that it has only single array of structures.

It took a lot of time me to understand the 2nd point and I found that Notes has limitations.

OTHER TIPS

Your Namespaces look wrong. I suspect you deleted those you couldn't post.

As I understand the question the issue is with this line?

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

Which is creating this class:

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

If this is the case, you need to check the schema for cmn. This will either be referenced in the namespaces in the DEFINITIONS tag, in the LS code as:

const n1 = "URL to Schema"

Once you have that schema, you need to see what structure it is. Based on your LS code it would be one method of

Public test() As test_test2_n0

test_test2 will be referenced in the n0 schema. Which you need to check also. At the moment the code snippet looks valid, but I can't confirm that without a full WSDL/XSD files (not default ones).

Other then that, some other things to check.

  1. Import the WSDL as a provider into Designer client. Sometimes if there is something it doesn't like it will give a more descriptive message.

  2. Import the WSDL as a Java consumer and compare the objects created vs LotusScript to see what is different (Assuming it imports as Java).

  3. LotusScript has a 36 character limitation for naming methods/variables. But I don't see evidence of this being an issue in your snippets.

  4. LotusScript is not case sensitive while Java is. So you can end up with duplicated references.

  5. LotusScript + WSDL do not check each others reserved keywords (eg. text, file, notes document). If you have one of those it can cause issues on importing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top