Hmm, well I thought I was logging in correctly but perhaps not.
Here's what I've got so far:
Dim login As New UserPasswordCredentials("ellisws1", "Routing", "Administrator", "")
Using serviceManager As New WebServiceManager(login)
Try
Dim myeco As ChangeOrderService
myeco = New ChangeOrderService
' get the default routing
Dim workflow As Workflow = myeco.GetDefaultWorkflow()
Dim routings As Routing() = myeco.GetRoutingsByWorkflowId(workflow.Id)
Dim defaultRouting As Routing = routings.FirstOrDefault(Function(n) n.IsDflt)
If defaultRouting Is Nothing Then
Throw New Exception("No default routing")
End If
' get the next number in the default sequence
Dim numberingSchemes As ChangeOrderNumSchm() = _
myeco.GetNumberingSchemesByType(NumSchmType.ApplicationDefault)
Dim defaultNumberingScheme As ChangeOrderNumSchm = numberingSchemes.FirstOrDefault()
If defaultNumberingScheme Is Nothing Then
Throw New Exception("No default numbering scheme")
End If
Dim coNumber As String = myeco.GetChangeOrderNumberBySchemeId(defaultNumberingScheme.Id)
Dim newCo As ChangeOrder = myeco.AddChangeOrder(defaultRouting.Id, coNumber, "test", "testing desc", DateTime.Now.AddMonths(1), Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
Catch ex As Exception
MessageBox.Show(ex.Message, "Error creating ECO")
Return
End Try
End Using
The 106 error comes from the GetDefaultWorkflow function.
Any advice?
Thanks.