![]() |
Click here to advertise with us
|
|
|||||||
| Web Services Anything about web service development with VB.NET |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 Last edited by kguilmartin; 07-10-2009 at 11:33 AM. Reason: attaching WSDL file. |
|
||||
|
This is the service description shown in browser for this wsdl:
Quote:
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
|
|||
|
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:
Code:
Dim Countries As RefDataFunctionsBean.country() = MyService.getCountries(New RefDataFunctionsBean.getCountries)
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
![]() |
| Bookmarks |
| Tags |
| web service |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|