S
Scott
I create a proxy class and instantiate it, then I try to make multiple
calls to the methods of the class. 75% of the time, all of the 7
calls work great, but 1 in 4 times one of the calls fails with 400 Bad
Request. In each call, I am loading a dataset and sending it to the
webservice.
I have tried numerous solutions here....
1. Originally, I started my application and instantiated my object
once and then, I would call the methods one by one. I received the
error here (25% of the time).
2. I then decided to start the application and dispose of the object
before making each call and "new" the object again. I still received
the error (25% of the time)
3. I then decided to start the application and create a completely
new object for each call in attempt to circumvent the error, but it
still appears 25% of the time.
4. Lastly, I tried starting my application and only making one call
each time the application runs. This worked beautifully, and no
errors have been received.
Here is my code (from #3 above):
try
For Each myTable In dsBuildout.Tables
strTableName = myTable.TableName()
If strTableName = "seats" And retval = 0 Then
If dsBuildout.Tables("seats").Rows.Count > 0 Then
tbTemp = dsBuildout.Tables("seats").Copy()
dsTemp.Tables.Add(tbTemp)
Dim obj1 As New WebNetApp.WebReference.CBPS
obj1 = New WebNetProcessApp.WebReference.CBPS
obj1.PreAuthenticate = True
obj1.Credentials = New
System.Net.NetworkCredential("uuu", "ppp")
obj1.Timeout = 300000
retval = obj1.ProcS(dsTemp, x, y, z, "seats",
dsBuildout.Tables("seats").Rows.Count)
iDataSetCount += 1
End If
End If
..... call more methods here the same as above and below ....
If strTableName = "options" And retval = 0 Then
If dsBuildout.Tables("options").Rows.Count > 0
Then
tbTemp.Clear()
tbTemp = dsBuildout.Tables("options").Copy()
dsTemp.Tables.Add(tbTemp)
Dim obj2 As New
WebNetProcessApp.WebReference.CBPS
obj2 = New WebNetProcessApp.WebReference.CBPS
obj2.PreAuthenticate = True
obj2.Credentials = New
System.Net.NetworkCredential("uuu", "ppp")
obj2.Timeout = 300000
retval = obj2.ProcessSeats(dsTemp, x, y, z,
"options", dsBuildout.Tables("options").Rows.Count)
iDataSetCount += 1
End If
End If
catch
end try
If it was on the same call every time I run through my code, I could
narrow it down, but it's sporadic.
My only guess is that I'm running framework 1.1 and the webservice I'm
calling is using 1.0. This is the only thing I can think of that
would cause the problem...I'm sending from an asp.net application and
also a windows application and both act the same.
calls to the methods of the class. 75% of the time, all of the 7
calls work great, but 1 in 4 times one of the calls fails with 400 Bad
Request. In each call, I am loading a dataset and sending it to the
webservice.
I have tried numerous solutions here....
1. Originally, I started my application and instantiated my object
once and then, I would call the methods one by one. I received the
error here (25% of the time).
2. I then decided to start the application and dispose of the object
before making each call and "new" the object again. I still received
the error (25% of the time)
3. I then decided to start the application and create a completely
new object for each call in attempt to circumvent the error, but it
still appears 25% of the time.
4. Lastly, I tried starting my application and only making one call
each time the application runs. This worked beautifully, and no
errors have been received.
Here is my code (from #3 above):
try
For Each myTable In dsBuildout.Tables
strTableName = myTable.TableName()
If strTableName = "seats" And retval = 0 Then
If dsBuildout.Tables("seats").Rows.Count > 0 Then
tbTemp = dsBuildout.Tables("seats").Copy()
dsTemp.Tables.Add(tbTemp)
Dim obj1 As New WebNetApp.WebReference.CBPS
obj1 = New WebNetProcessApp.WebReference.CBPS
obj1.PreAuthenticate = True
obj1.Credentials = New
System.Net.NetworkCredential("uuu", "ppp")
obj1.Timeout = 300000
retval = obj1.ProcS(dsTemp, x, y, z, "seats",
dsBuildout.Tables("seats").Rows.Count)
iDataSetCount += 1
End If
End If
..... call more methods here the same as above and below ....
If strTableName = "options" And retval = 0 Then
If dsBuildout.Tables("options").Rows.Count > 0
Then
tbTemp.Clear()
tbTemp = dsBuildout.Tables("options").Copy()
dsTemp.Tables.Add(tbTemp)
Dim obj2 As New
WebNetProcessApp.WebReference.CBPS
obj2 = New WebNetProcessApp.WebReference.CBPS
obj2.PreAuthenticate = True
obj2.Credentials = New
System.Net.NetworkCredential("uuu", "ppp")
obj2.Timeout = 300000
retval = obj2.ProcessSeats(dsTemp, x, y, z,
"options", dsBuildout.Tables("options").Rows.Count)
iDataSetCount += 1
End If
End If
catch
end try
If it was on the same call every time I run through my code, I could
narrow it down, but it's sporadic.
My only guess is that I'm running framework 1.1 and the webservice I'm
calling is using 1.0. This is the only thing I can think of that
would cause the problem...I'm sending from an asp.net application and
also a windows application and both act the same.