0
votes

I'm trying to consume a web service created in Java (XFire) from Visual Studio 2010. The service works in Visual Studio 2008 without an issue. In both cases I'm using a web reference to access the service. I've also tried svcutil.exe generate the web service consumer code and walk through it and it still will not return data.

I have access to the log4j logs and I don't see the call causing any execution on the Java side.

Does anyone know if I'm missing a setting somewhere? Or if consumption of web services via a web reference is somehow more strict in 2010.

In the below code rwsResponse is something but rwsResponse.WorkerServiceResponse is Nothing after the call to retrieveWorker:

Dim rwsService As New rws.WorkerService
Dim rwsResponse As New rws.retrieveWorkerResponse
Dim rwsRequest As New rws.retrieveWorker

rwsRequest.SearchOption = New rws.RetrieveKeyType()
rwsRequest.SearchOption.Items = New String() {userID}
rwsRequest.SearchOption.ItemsElementName = New rws.ItemsChoiceType() {rws.ItemsChoiceType.user_Id}

rwsResponse = rwsService.retrieveWorker(rwsRequest)

Dim rwsWorker As rws.EnterpriseWorkerType
Dim rwsMessage As rws.MessageType

If rwsResponse Is Nothing OrElse rwsResponse.WorkerServiceResponse Is Nothing Then
    Throw New Exception(String.Format("retrieveWorkerService:WorkerServiceResponse is null{0}userID:{1}", vbCrLf, userID))
End If

What is strange is this code works fine in Visual Studio .NET 2008. Both 2008 and 2010 are targeting 3.5 for this app.

1
Before you call .retreiveWorker(), what is the serialized value of rwsRequest? Is it same as in 2008? i.e. is the same value being sent to the service? You can use Fiddler for this. At the same time, you'll be able to find the response coming back. - p.campbell
VB.NET command line exe. - user1195358
I can see the SearchOption Item values in 2010 and 2008. Thanks for the Fiddler suggestion. I'll give it a shot. - user1195358
By using Fiddler I was able to confirm that the web service is returning a valid SOAP response. The IDE is not able to serialize that response into the rwsResponse object. - user1195358

1 Answers

0
votes

Try using the old way of reference a web service. When you do a "Add Service Reference", on the dialog that comes up, click on the Advanced button in the button left corner, and click add web reference.