.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 12th, 2004, 09:59 AM
patel_o patel_o is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 patel_o User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Asp.net Webservice simple question

Hi,

I am new to webservices. I am trying to invoke a webservice in Asp.net. The information about the webservice can be found at http://hurricane.terrapin.com/soap_access.html.en

I have added http://weather.terrapin.com/soap/HurricaneService.wsdl to my webreferences successfully. In my code I try to invoke getCurrentStorms method and it gives me error. My code reads like:
************************************************** ************************************************** ************************************************** *************

Private Sub btnGetStormNames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetStormNames.Click

Dim aw1 As com.terrapin.weather.HurricaneServiceService = New com.terrapin.weather.HurricaneServiceService

Dim ws1 As com.terrapin.weather.StormResult() = aw1.getCurrentStorms

Dim stormRes As New com.terrapin.weather.StormResult

With lbStormNames.Items

For Each stormRes In ws1

.Add(stormRes.stormCode)

Next

End With

End Sub

************************************************** ************************************************** ************************************************** *************

When my code reaches the
"Dim ws1 As com.terrapin.weather.StormResult() = aw1.getCurrentStorms"
line, it fails with the following message:

************************************************** ************************************************** ************************************************** *************

The specified type was not recognized: name='StormResult', namespace='urn:HurricaneService', at <return xmlns=''>.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The specified type was not recognized: name='StormResult', namespace='urn:HurricaneService', at <return xmlns=''>.

Source Error:

Line 42: <System.Web.Services.Protocols.SoapRpcMethodAttribu te("", RequestNamespace:="urn:HurricaneService", ResponseNamespace:="urn:HurricaneService")> _
Line 43: Public Function getCurrentStorms() As <System.Xml.Serialization.SoapElementAttribute("getCurrentStormsReturn")> StormResult()
Line 44: Dim results() As Object = Me.Invoke("getCurrentStorms", New Object(-1) {})
Line 45: Return CType(results(0),StormResult())
Line 46: End Function



Source File: c:\inetpub\wwwroot\HurricaneTracker\Web References\com.terrapin.weather\Reference.vb Line: 44

Stack Trace:


[InvalidOperationException: The specified type was not recognized: name='StormResult', namespace='urn:HurricaneService', at <return xmlns=''>.]
System.Xml.Serialization.XmlSerializationReader.Ge tPrimitiveType(XmlQualifiedName typeName, Boolean throwOnUnknown)
System.Xml.Serialization.XmlSerializationReader.Re adArray(String typeName, String typeNs)
System.Xml.Serialization.XmlSerializationReader.Re adReferencingElement(String name, String ns, Boolean elementCanBeType, String& fixupReference)
System.Xml.Serialization.XmlSerializationReader.Re adReferencingElement(String name, String ns, String& fixupReference)
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Read6_getCurrentStormsResponse ()

[InvalidOperationException: There is an error in XML document (5, 2).]
System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader, String encodingStyle)
System.Xml.Serialization.XmlSerializer.Deserialize (XmlReader xmlReader)
System.Web.Services.Protocols.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[] parameters)
HurricaneTracker.com.terrapin.weather.HurricaneSer viceService.getCurrentStorms() in c:\inetpub\wwwroot\HurricaneTracker\Web References\com.terrapin.weather\Reference.vb:44
HurricaneTracker.WebForm1.btnGetStormNames_Click(O bject sender, EventArgs e) in c:\inetpub\wwwroot\HurricaneTracker\WebForm1.aspx. vb:30
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()

************************************************** ************************************************** ************************************************** *************

I would be really helpful to me if someone can point out what is wrong in my code.

Thanks
Jignesh

Reply With Quote
  #2  
Old August 28th, 2008, 04:34 PM
jrhyne2584 jrhyne2584 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 1 jrhyne2584 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 26 sec
Reputation Power: 0
Any progress?

Did you find a resolution? I have the same problem.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > Asp.net Webservice simple question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT