Christian Blaß
unread,Nov 18, 2011, 7:19:26 AM11/18/11You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hallo,
ich habe mir in VisualStudio ein VB Project angelegt. Dann habe ich
einen Dienstverweis erstellt und den Link zu meiner WSDL angegeben.
Es wurde dann reichlich Code erzeugt und die Schnittstelle funtkioniert
soweit auch ganz gut. Nur bei bestimmten Calls habe ich Probleme.
Ich muss dazu eine Klasse aufrufen. z.B. PlentySoapRequest_GetItemsPrice
In dieser Klasse wiederrum gibt es eine Eigenschaft, die selber eine
Klasse auffruft. Und das ganz auch noch als Array.
Hier mal mein Code:
//Das ist die Klasse für den Request
Dim MyRequest1() As pSOAP.PlentySoapRequest_GetItemsStock = New
pSOAP.PlentySoapRequest_GetItemsStock(0) {}
//Dieses Klasse wird auch von der ersten Klasse aufgerufen. Code folgt
weiter unten
Dim MyObject1() As pSOAP.PlentySoapObject_GetItemsStock = New
pSOAP.PlentySoapObject_GetItemsStock(0) {}
//Mein Response Objekt. Hier eigentlich unwichtig
Dim MyResopnse1 As New pSOAP.PlentySoapResponse_GetItemsStock
//Jetzt wird dan Object noch mal instanziert, weil sonst ein Fehler
kommt. Dann werden Werte zugewiesen.,
MyObject1(0) = New pSOAP.PlentySoapObject_GetItemsStock()
MyObject1(0).SKU = "TESTSJU"
MyObject1(0).WarehouseID = "3"
MyRequest1(0).GetItemsStock() = New
pSOAP.PlentySoapObject_GetItemsStock(0) {MyObject1(0)}
//*Hier hält der Compiler an, weil MyRequest NULL ist. Irgentwie ist die
Instanzierung nicht richtig
MyRequest1(0).GetItemsStock(0) = MyObject1(0)
MyResopnse1 = pCallHead.GetItemsStock(MyRequest1(0))....
Frage: Wie kann ich eine Klasse innerhalb einer Klasse richtig instanzieren?
Mit freundlichen grüssen
Christian Blaß
*****************Anhang der Datendefinitionen PlentySoapRequest
Partial Public Class PlentySoapRequest_GetItemsStock
Inherits Object
Implements System.ComponentModel.INotifyPropertyChanged
Private getItemsStockField() As PlentySoapObject_GetItemsStock
'''<remarks/>
<System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)> _
Public Property GetItemsStock() As PlentySoapObject_GetItemsStock()
Get
Return Me.getItemsStockField
End Get
Set
Me.getItemsStockField = value
Me.RaisePropertyChanged("GetItemsStock")
End Set
End Property.....................
***************Anhang der Datendefinitionen PlentySoapObject
Partial Public Class PlentySoapObject_GetItemsStock
Inherits Object
Implements System.ComponentModel.INotifyPropertyChanged
Private sKUField As String
Private warehouseIDField As String
'''<remarks/>
<System.Xml.Serialization.SoapElementAttribute(IsNullable:=true)> _
Public Property SKU() As String
Get
Return Me.sKUField
End Get
Set
Me.sKUField = value
Me.RaisePropertyChanged("SKU")
End Set
End Property