Question

First time trying to use webservices. I am using VS2005 and trying to call a webservice function. I added my webreference to the WSDL, got my autogenerated code.

I am able to call it with no errors/exceptions but I get nothing back from the service function. I packet sniffed the network traffic when I ran my code and saw that the webservice actually sent back the data it was supposed to, I just never recieved it in my code below

    Dim proxy As New MyServer.MyService
    Dim response As New Object()
    response = proxy.getAllThings(Nothing)

In the WSDL it says it requires Object as parameter and returns Object. Also tried:
Dim response As New Object and
Dim response As String=""

Response is always Nothing/Null

The sniffed data shows a plaintext SOAP envelope which is what I was expecting 'response' to contain.

Sniffed Data sent from webservice to my computers IP address:

    Server: Apache-Coyote/1.1
    Content-Type: text/xml;charset=utf-8
    Transfer-Encoding: chunked
    Date: Mon, 23 Apr 2012 08:26:01 GMT
    321
    <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><cmp:things xmlns:cmp="http://cmp.com"><cmp:thing><cmp:id>10</cmp:id><cmp:name>ASM</cmp:name></cmp:thing><cmp:thing><cmp:id>1</cmp:id><cmp:name>CHP</cmp:name></cmp:thing><cmp:thing><cmp:id>11</cmp:id><cmp:name>UDB</cmp:name></cmp:thing><cmp:thing><cmp:id>8</cmp:id><cmp:name>GKH</cmp:name></cmp:thing><cmp:thing><cmp:id>5</cmp:id><cmp:name>GGW</cmp:name></cmp:thing><cmp:thing><cmp:id>6</cmp:id><cmp:name>LRZ</cmp:name></cmp:thing><cmp:thing><cmp:id>7</cmp:id><cmp:name>MRN</cmp:name></cmp:thing><cmp:thing><cmp:id>2</cmp:id><cmp:name>KBV</cmp:name></cmp:thing><cmp:thing><cmp:id>3</cmp:id><cmp:name>CXE</cmp:name></cmp:thing></cmp:things></soapenv:Body></soapenv:Envelope>
    0

This sniffed data never shows up in 'response'

I used http://msdn.microsoft.com/en-us/library/aa275675%28v=sql.80%29.aspx as an example.

Any help would be greatly appreciated.

Edit: 'response' should contain the data from the result of the webservice call shouldnt it?

Was it helpful?

Solution

Installed VS2010 express on a different computer and connected to the service and I got an error message. Basically the response from the service does not match the WSDL. Dont know why VS2005 didnt give me any errors.

It is a service in production being consumed by a java client, apparently it doesnt care about the mismatch.

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