Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > ASP.NET > Web Services

Web Services Anything about web service development with VB.NET

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-10-2009, 10:27 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jul 2009
Posts: 4
Reputation: 0
kguilmartin is on a distinguished programming path ahead
Default Having problem invoking WS operation from consumed WSDL in vb.net

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.SoapDocumentMetho dA 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("get Co 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
Attached Files
File Type: txt RefDataFunctionsImplService.wsdl.txt (11.5 KB, 6 views)

Last edited by kguilmartin; 07-10-2009 at 10:33 AM. Reason: attaching WSDL file.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-10-2009, 12:04 PM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,322
Reputation: 1315
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

This is the service description shown in browser for this wsdl:
Quote:
"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
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-10-2009, 12:52 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jul 2009
Posts: 4
Reputation: 0
kguilmartin is on a distinguished programming path ahead
Default 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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-13-2009, 8:58 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jul 2009
Posts: 4
Reputation: 0
kguilmartin is on a distinguished programming path ahead
Default

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-13-2009, 9:24 AM
JohnH's Avatar
VB.NET Forum Moderator
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Dec 2005
Location: Norway
Age: 37
Posts: 10,322
Reputation: 1315
JohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond reputeJohnH has a reputation beyond repute
Default

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:
Code:
Dim Countries As RefDataFunctionsBean.country() = MyService.getCountries(New RefDataFunctionsBean.getCountries)
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-13-2009, 9:38 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jul 2009
Posts: 4
Reputation: 0
kguilmartin is on a distinguished programming path ahead
Default

That worked. Thanks much!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
web service


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 2:31 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.