473,395 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Consuming (SOAP)webservice in vb.net

Hi all,,

I'm trying to make a program, that calls a webservice, and then does
somthing about the data, that i recive..

But i don't know what to do with this data??.. i tried to load into an
xmldocument, but i recives an error??

If i load it ito an object by:

Dim myProxy As New Proxy_WebService.function1()
Dim obj As Object

obj = myProxy.functionGetData("1", "2004-11-27")

Then the obj contains an system.array wich have 2 System.Xml.XmlAttribute
and 1 System.Xml.XmlElement

How does i get that "readable"?? do i have to make an XmlFormatter or??
Another question: is it nesscery to any thing else to the wsdl-deffiniton??
I have only add'ed the .vb-file to my project. And then started using it.. og
do i have to convert it into an .dll-file??
Nov 23 '05 #1
4 7660
Henrik wrote:
Then the obj contains an system.array wich have 2
System.Xml.XmlAttribute and 1 System.Xml.XmlElement

How does i get that "readable"?? do i have to make an XmlFormatter
or??

Another question: is it nesscery to any thing else to the
wsdl-deffiniton?? I have only add'ed the .vb-file to my project. And
then started using it.. og do i have to convert it into an .dll-file??


I'd like to help, but I can't quite figure out what might be going on here.
Can you post the signature that was generated for the proxy? And, if possible,
the WSDL you generated the proxy from?

Thanks,
Drew

Nov 23 '05 #2
"Drew Marsh" wrote:
Henrik wrote:
Then the obj contains an system.array wich have 2
System.Xml.XmlAttribute and 1 System.Xml.XmlElement

How does i get that "readable"?? do i have to make an XmlFormatter
or??

Another question: is it nesscery to any thing else to the
wsdl-deffiniton?? I have only add'ed the .vb-file to my project. And
then started using it.. og do i have to convert it into an .dll-file??


I'd like to help, but I can't quite figure out what might be going on here.
Can you post the signature that was generated for the proxy? And, if possible,
the WSDL you generated the proxy from?

Thanks,
Drew


Hi Drew, and thanks :o)

I don't have any signature generated?? Whats that? .. The only thing i've
done, is generated the WSDL from at site: eg.

wsdl /language:VB /out:C:\myProxyClass.vb
http://xxx.xx/Webservices/Registration?wsdl

and then loaded the "myProxyClass.vb"-file into my vb.net project, and begin
using it..
**************Output of the WSDL*************************

'------------------------------------------------------------------------------
' <autogenerated>
' This code was generated by a tool.
' Runtime Version: 1.0.3705.288
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </autogenerated
'------------------------------------------------------------------------------

Option Strict Off
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Xml.Serialization

'
'This source code was auto-generated by wsdl, Version=1.0.3705.288.
'

'<remarks/>
<System.Diagnostics.DebuggerStepThroughAttribute() , _
System.ComponentModel.DesignerCategoryAttribute("c ode"), _

System.Web.Services.WebServiceBindingAttribute(Nam e:="RegistrationsPortSoapBinding", [Namespace]:="http://xxx.xx/Webservices/Registration")> _
Public Class Registrations
Inherits System.Web.Services.Protocols.SoapHttpClientProtoc ol

'<remarks/>
Public Sub New()
MyBase.New
Me.Url = "http://xxx.xx/Webservices/Registration"
End Sub

'<remarks/>
<System.Web.Services.Protocols.SoapRpcMethodAttrib ute("",
RequestNamespace:="http://xxx.xx/Webservices/Registration",
ResponseNamespace:="http://xxx.xx/Webservices/Registration")> _
Public Function GetRegistrations(ByVal UserID As String,
<System.Xml.Serialization.SoapElementAttribute(Dat aType:="date")> ByVal
DateTime As Date) As <System.Xml.Serialization.SoapElementAttribute("da ta")>
Object
Dim results() As Object = Me.Invoke("GetRegistrations", New Object()
{UserID, DateTime})
Return CType(results(0),Object)
End Function

'<remarks/>
Public Function BeginGetRegistrations(ByVal UserID As String, ByVal
DateTime As Date, ByVal callback As System.AsyncCallback, ByVal asyncState As
Object) As System.IAsyncResult
Return Me.BeginInvoke("GetRegistrations", New Object() {UserID,
DateTime}, callback, asyncState)
End Function

'<remarks/>
Public Function EndGetRegistrations(ByVal asyncResult As
System.IAsyncResult) As Object
Dim results() As Object = Me.EndInvoke(asyncResult)
Return CType(results(0),Object)
End Function

End Class

**********************WSDL END*************************

I also don't quite known
how to call to 2 functions BeginGetRegistrations and
EndGetRegistrations??
In the meantime if found out that i throug a WebRequest's -
response.GetResponseStream(), get's a valid xml-document, to view in
Explorer.. but then i don't use the WSDL.. And i don't know how to
deserielize it in my vb code??

Nov 23 '05 #3
Henrik wrote:
I don't have any signature generated?? Whats that? .. The only thing
i've done, is generated the WSDL from at site: eg.

wsdl /language:VB /out:C:\myProxyClass.vb
http://xxx.xx/Webservices/Registration?wsdl

and then loaded the "myProxyClass.vb"-file into my vb.net project, and
begin using it..
What I meant by signature was the signature of the method on your proxy class
that represents the web method. I just wanted to see what was generated for
you so I had a better idea what types you were working with. The output you
pasted me is exactly what I was looking for. :)
<System.Web.Services.Protocols.SoapRpcMethodAttrib ute("",
RequestNamespace:="http://xxx.xx/Webservices/Registration",
ResponseNamespace:="http://xxx.xx/Webservices/Registration")> _
Public Function GetRegistrations(ByVal UserID As String,
<System.Xml.Serialization.SoapElementAttribute(Dat aType:="date")>
ByVal
DateTime As Date) As
<System.Xml.Serialization.SoapElementAttribute("da ta")>
Object
Dim results() As Object = Me.Invoke("GetRegistrations", New
Object()
{UserID, DateTime})
Return CType(results(0),Object)
End Function
'<remarks/>
Ok, the problem here is that for some reason, your proxy is only being generated
to return data of type Object. That means that the signature of the web method
that you're trying to call must not be too strongly typed. You said in your
initial post that it ends up being an array of two XmlAttributes and one
XmlElement is that right? This is very strange. Is there any way you can
post the WSDL or a link to it? WSDL.exe normally generates much richer .NET
method signatures than this and the fact that you're ending up with two XmlAttributes
and an XmlElement is, once again, very strange. My guess is that the schema
of the web method is structured such that WSDL.exe cannot make a clean translation.
I also don't quite known
how to call to 2 functions BeginGetRegistrations and
EndGetRegistrations??
You don't need to use those unless you want to make asynchronus calls to
the web method. If you're interested in doing that, just let me know, and
after we figure the main problem out I'll gladly show you how to call it.
In the meantime if found out that i throug a WebRequest's -
response.GetResponseStream(), get's a valid xml-document, to view in
Explorer.. but then i don't use the WSDL.. And i don't know how to
deserielize it in my vb code??


No need to go that extreme. Worst case scenario you have the two XmlAttribtes
and the XmlElement that represent the response message from your proxy class.
Even it it is a little perplexing as to why it's being translated that way,
you can still use these to access the XML data of the message.

Cheers,
Dre

Nov 23 '05 #4
Hi Drew,,

Yes, if I call the "GetRegistratins"-function, it returns a object
containing an array of two XmlAttributes and one XmlElement ?

Unfortunly this is for my work, so I just can't supply you, with all
information eg. the url to the servece,, until a have talked to my boss. :o(
...

But anyhow, below is the "WSDL-definition"
, in a littel changes format :o)

The things i've changes:
Is the
url's to my service to "http://xxx.xx/Webservices/Registration"
And som of the names,,
But else it's idendical...
Is this enough,, or do you whant the url to the WSDL??
And ofcouse im interested in learning asynchronus calls to
the web method, afterwards :o),,, You never get to old to learn something
new :o)....
Thanks
Henrik
************************WSDL Definitions****************************

<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://xxx.xx/Webservices/Registration"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://xxx.xx/Webservices/Registration"
xmlns:intf="http://xxx.xx/Webservices/Registration"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:message name="GetRegistrations2Request">
<wsdl:part name="UserId" type="xsd:string" />
<wsdl:part name="PassWord" type="xsd:string" />
<wsdl:part name="DateTime" type="xsd:date" />
<wsdl:part name="version" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="GetRegistrations2Response">
<wsdl:part name="data" type="xsd:anyType" />
</wsdl:message>
- <wsdl:message name="GetRegistrationsResponse">
<wsdl:part name="data" type="xsd:anyType" />
</wsdl:message>
- <wsdl:message name="GetRegistrationsRequest">
<wsdl:part name="UserId" type="xsd:string" />
<wsdl:part name="PassWord" type="xsd:string" />
<wsdl:part name="DateTime" type="xsd:date" />
</wsdl:message>
- <wsdl:portType name="RegistrationsPortType">
- <wsdl:operation name="GetRegistrations" parameterOrder="UserId PassWord
DateTime">
<wsdl:input message="impl:GetRegistrationsRequest"
name="GetRegistrationsRequest" />
<wsdl:output message="impl:GetRegistrationsResponse"
name="GetRegistrationsResponse" />
</wsdl:operation>
- <wsdl:operation name="GetRegistrations2" parameterOrder="UserId PassWord
DateTime version">
<wsdl:input message="impl:GetRegistrations2Request"
name="GetRegistrations2Request" />
<wsdl:output message="impl:GetRegistrations2Response"
name="GetRegistrations2Response" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="RegistrationsPortSoapBinding"
type="impl:RegistrationsPortType">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="GetRegistrations">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="GetRegistrationsRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xxx.xx/Webservices/Registration" use="encoded" />
</wsdl:input>
- <wsdl:output name="GetRegistrationsResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xxx.xx/Webservices/Registration" use="encoded" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="GetRegistrations2">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="GetRegistrations2Request">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xxx.xx/Webservices/Registration" use="encoded" />
</wsdl:input>
- <wsdl:output name="GetRegistrations2Response">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://xxx.xx/Webservices/Registration" use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="Registrations">
- <wsdl:port binding="impl:RegistrationsPortSoapBinding"
name="RegistrationsPort">
<wsdlsoap:address location="http://xxx.xx/Webservices/Registration" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

************************WSDL Definitions END**************************
"Drew Marsh" wrote:
Henrik wrote:
I don't have any signature generated?? Whats that? .. The only thing
i've done, is generated the WSDL from at site: eg.

wsdl /language:VB /out:C:\myProxyClass.vb
http://xxx.xx/Webservices/Registration?wsdl

and then loaded the "myProxyClass.vb"-file into my vb.net project, and
begin using it..


What I meant by signature was the signature of the method on your proxy class
that represents the web method. I just wanted to see what was generated for
you so I had a better idea what types you were working with. The output you
pasted me is exactly what I was looking for. :)
<System.Web.Services.Protocols.SoapRpcMethodAttrib ute("",
RequestNamespace:="http://xxx.xx/Webservices/Registration",
ResponseNamespace:="http://xxx.xx/Webservices/Registration")> _
Public Function GetRegistrations(ByVal UserID As String,
<System.Xml.Serialization.SoapElementAttribute(Dat aType:="date")>
ByVal
DateTime As Date) As
<System.Xml.Serialization.SoapElementAttribute("da ta")>
Object
Dim results() As Object = Me.Invoke("GetRegistrations", New
Object()
{UserID, DateTime})
Return CType(results(0),Object)
End Function
'<remarks/>


Ok, the problem here is that for some reason, your proxy is only being generated
to return data of type Object. That means that the signature of the web method
that you're trying to call must not be too strongly typed. You said in your
initial post that it ends up being an array of two XmlAttributes and one
XmlElement is that right? This is very strange. Is there any way you can
post the WSDL or a link to it? WSDL.exe normally generates much richer .NET
method signatures than this and the fact that you're ending up with two XmlAttributes
and an XmlElement is, once again, very strange. My guess is that the schema
of the web method is structured such that WSDL.exe cannot make a clean translation.
I also don't quite known
how to call to 2 functions BeginGetRegistrations and
EndGetRegistrations??


You don't need to use those unless you want to make asynchronus calls to
the web method. If you're interested in doing that, just let me know, and
after we figure the main problem out I'll gladly show you how to call it.
In the meantime if found out that i throug a WebRequest's -
response.GetResponseStream(), get's a valid xml-document, to view in
Explorer.. but then i don't use the WSDL.. And i don't know how to
deserielize it in my vb code??


No need to go that extreme. Worst case scenario you have the two XmlAttribtes
and the XmlElement that represent the response message from your proxy class.
Even it it is a little perplexing as to why it's being translated that way,
you can still use these to access the XML data of the message.

Cheers,
Drew

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Arne Holderbeke | last post by:
I'm doing my final project in PHP with a Soap webservice In the client script (PHP) 3 files are read into a string these strings and the name of the 3 files need to be passed to the webservice (...
0
by: olafmol | last post by:
Hello, i have a problem using a .NET WSDL Webservice from PHP. Using both the NuSOAP lib for PHP4, and the build-in SOAP lib for PHP5 it seems that the SOAP client cannot pass a variable amount...
1
by: mzam | last post by:
Hi everyone, I have a vbscript which is consuming WebMethods from a WebService. Whenever the WebMethod returns a string or integer then no problem but when the WebMethod returns a DataSet then...
0
by: Jessard | last post by:
Hi all, I am trying to consuming a .NET web service from a standard (classic) ASP page. I have come across a few articles which describe that it can be done as follows (after installing the...
4
by: Kaush | last post by:
Hi all, I am creating a webservice to accept SOAP messages, parse the message and send a SOAP response back to the client accessing my web service using WSE-2 in ASP.NET. I am creating a class...
0
by: David Haynes | last post by:
I am having an issue with using the Membership class in a SOAP WebService running in IIS. I have: 1. set <authentication mode=\"Windows\"/in web.config 2. verified that I can log onto the...
4
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy =...
1
by: Florian Grousset | last post by:
Hi, I'm trying to code a simple C# SOAP client wich query an Axis2 Java SOAP Server. Server side code has been generated from a WSDL file. SOAP requests and responses must both contain a simple...
3
by: =?Utf-8?B?UmFqaXY=?= | last post by:
Hi, I have a webservice developed using asp.net(c#), which is beign consumed by oracle PL/SQL client. I have tested my webservice code using a asp.net test client page and everything seems to be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.