Having problem invoking WS operation from consumed WSDL

kguilmartin

New member
Joined
Jul 10, 2009
Messages
4
Programming Experience
10+
Hello,

I am a Java programmer, but new to vb.net. I have created a new Web Reference for the WSDL that I am trying to consume.

Below is from the Reference.vb file:

<System.Web.Services.Protocols.SoapDocumentMethodA ttribute("", Use:=System.Web.Services.Description.SoapBindingUs e.Literal, ParameterStyle:=System.Web.Services.Protocols.Soap ParameterStyle.Bare)> _
Public Function getCountries(<System.Xml.Serialization.XmlElementA ttribute("getCountries", [Namespace]:="http://server.services.web.eventdb.hermes.com/")> ByVal getCountries1 As getCountries) As <System.Xml.Serialization.XmlArrayAttribute("getCo untriesResponse", [Namespace]:="http://server.services.web.eventdb.hermes.com/"), System.Xml.Serialization.XmlArrayItemAttribute("re turn", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable:=False)> country()
Dim results() As Object = Me.Invoke("getCountries", New Object() {getCountries1})
Return CType(results(0), country())
End Function

But I am having a problem invoking this operation (getCountries). It should not have any input parameters, but it looks here like it does. Below is what I have so, which may be way off. Any help would be greatly appreciated!

Dim MyService As RefDataFunctionsBean.RefDataFunctionsImplService = New RefDataFunctionsBean.RefDataFunctionsImplService
Dim Countries As RefDataFunctionsBean.country()

Try
Countries = MyService.getCountries()
Catch ex As Exception
MsgBox(ex.Message)
End Try
 

Attachments

  • RefDataFunctionsImplService.wsdl.txt
    11.5 KB · Views: 37
Last edited:
This is the service description shown in browser for this wsdl:
"RefDataFunctionsImplService" Description

Methods

  • getContactTypes ( getContactTypes As getContactTypes ) As getContactTypesResponse
  • getCountries ( getCountries As getCountries ) As getCountriesResponse
  • getEventKeys ( getEventKeys As getEventKeys ) As getEventKeysResponse
  • getGenders ( getGenders As getGenders ) As getGendersResponse
  • getMaritalStatusTypes ( getMaritalStatusTypes As getMaritalStatusTypes ) As getMaritalStatusTypesResponse
  • getStates ( getStates As getStates ) As getStatesResponse
 
What is the input parameter?

I am not sure where the "getCountries As getCountries " is coming from. Maybe this is standard in VB.Net. That's where I am lost. When I consume this WSDL in a gui tool such as SOATest, there are no input parameters for "getCountries". Also when I generate client stubs in java it works fine. I am confused...
 
I don't know how to view the request xml in VS.net, so I am posting the resquest xml from a SOATest client.

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<getCountries
xmlns="http://server.services.web.eventdb.hermes.com/">
<ns1:getCountries
xmlns="" xmlns:ns1="http://server.services.web.eventdb.hermes.com/"/>
</getCountries>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


I still cannot invoke this operation in vb.net. It works fine in SOATest without any input arguments. The code below generates an exception:

Dim MyService As RefDataFunctionsBean.RefDataFunctionsImplService = New RefDataFunctionsBean.RefDataFunctionsImplService
Dim service As RefDataFunctionsBean.getCountries

Try

Dim Countries As RefDataFunctionsBean.country() = MyService.getCountries(service)
Catch ex As Exception

MsgBox(ex.Message)
End Try


Exception: javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://server.services.web.even
tdb.hermes.com/}RefDataFunctionsImplPort does not contain operation meta data for empty soap body

Please help! Thanks in advance!
 
Instead of passing Nothing as you do now, why not create an empty parameter instance and pass that? The naming of this service is just ridiculous, but the code would be this:
VB.NET:
Dim Countries As RefDataFunctionsBean.country() = MyService.getCountries(New RefDataFunctionsBean.getCountries)
 

Latest posts

Back
Top