Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2006

Tip: Looking for answers? Try searching our database.

Help consuming third part web services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken Crismon - 19 Sep 2006 18:58 GMT
Hello,

I am currently working on an embedded systems project where by I have
written a small web server that is being hosted on our internet appliance
(running on an Atmega128 chip and doing lots of col RFID and Mesh network
stuff).

In this example I am trying to get the AuthenticateUser web service to work.

I am using the following WSDL:
http://www.kcrismon.com/phaseivengr/xTango/wsdl/xTangoWebService.wsdl

My SOAP request via a .Net application having consumed the above WSDL is the
following
http://www.kcrismon.com/phaseivengr/xTango/requestSamples/authenticateuser_1.xml

The XML SOAP response that my embedded web server generates is
http://www.kcrismon.com/phaseivengr/xTango/requestSamples/authenticateuser_2.xml

When I call the webserrvice method using the following code.

        org.xtango.xTangoServices x = new org.xtango.xTangoServices();
       
        string xResp = x.AuthenticateUser("kcrismon", "cccc");
       
        if ( xResp == null )
        {
           Response.Write("Web Request returned NULL");
        }
        else
        {
           Response.Write(string.Format("WebRequest returned {0}", xResp );
        }

The method always returns a NULL.  I have no idea what is going wrong.  Are
there any tips regarding the format of my response oor the format of the WSDL
that will help me.

Signature

Sincerely,

Ken Crismon
PhaseIVEngr

Sundar Narasimman - 21 Sep 2006 13:54 GMT
Hi Ken Crismon,

I don't find any problem with the  serialization/deserialization. I think
the problem is at the following WebMethod - AuthenticateUser("kcrismon",
"cccc");

Try debugging this Web Method and make sure that it returns a proper value.

Could you post me the copy of proxy object at the client-end. This will help
me investigate further
Signature

Thanks & Regards,
Sundar Narasimman
Technology Specialist
Microsoft .NET

> Hello,
>
[quoted text clipped - 33 lines]
> there any tips regarding the format of my response oor the format of the WSDL
> that will help me.
Ken Crismon - 21 Sep 2006 19:40 GMT
Mr. Narasimman,

Hello...  Thanks for the response.  I am not positive I understand what you
mean by the "proxy".  I am not using a client proxy that would be created by
something like wsdl.exe.  I simply have a client application that has added a
web reference using the Add Reference features of DevStudion 2005.  It is
this processes that has imported into my application the namespace org.xTango.

The sample code below is what I use behind a simple Button Event.        

// A simple test method to see if my Internet Appliance can authenticate.  
// This method abstracts the details from the UI.
public string HandleAuthEvent( string userID, string password )
{
  // Create an instance of the web service.  
  // The web.config defines the target URL for the web service.
  // Currently that is
  // http://xTango.org:8008/xTangoWebServices/xTangoWebServices.asmx
  // Don't let the extension of ASMX confuse you the reader.  We use the
  // MS standard URL extension to make this architecture more familuar to
  // OEM vendors/partners.  The Web Service is implemented on an Embedded
  // system running Tiny OS and a ported version of the GoAhead embedded
  // web server for an AtMega RISC based system.
  org.xtango.xTangoServices x = new org.xtango.xTangoServices();

  // Execute the web service on the appliance
  string xResp = x.AuthenticateUser(userID, password);
 
  // If NULL something failed that was not associated with a network error.
     
  if ( xResp == null )
  {
     xResp = "Web Service response was NULL.  Bad news!!";      
  }
  else
  {
     // Cool.  We got something back, report the response to the caller.
     // In the real working world this response would be something usfull,
     // at this point it is simply a string with the value of True or False.
     xResp = string.Format("WebRequest returned {0}", xResp );
  }
  return xResp;
}

To provide the XML that I linked in the original message I used the Trace
Utility that is part of the Soap Toolkit, a very nice tool by the way.

So...  The Web Method AuthenticateUser is indeed returning a response and
the response is encapsulated within the SOAP Envelope as follows:

http://www.kcrismon.com/phaseivengr/xTango/requestSamples/authenticateuser_2.xml

So...  I don't think I have a Client Proxy such as is created with WSDL.EXE
but if that is what I need I most certainly will create one and use that
within my application.

Is that what you would suggest?

BTW: I imlemented a simple brain dead version of this web service using the
DevStudio 2005 C# Web Service project and my application will indeed see real
data but using the Trace Utility as above my response XML from my Embedded
Web Appliance application is returning what appears to be the same exact XML
as what the brain dead Web Service is returning.  Some of the HTTP headers
are different but as I understand it the Content-Type: text/xml;
charset=utf-8 is the only header that really can make a difference.  I may of
course be wrong and please tell me what HTTP headers are important as part of
the response.  My embedded web server can certainly handle what ever headers
are required.

I am at a loss and will appreciate any help you may be able to provide.

If you want more details than this forum can provide please contact me at
krc4531@hotmail.com

Hope all is well with you and hope to hear from you soon.

Signature

Sincerely,

Ken Crismon
PhaseIVEngr

> Hi Ken Crismon,
>
[quoted text clipped - 44 lines]
> > there any tips regarding the format of my response oor the format of the WSDL
> > that will help me.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.