Webservices with raw post data

ASP.NET

    Next

  • 1. Prob using a custom type in asp.net webservice
    I have the following sample asp.net webservice: ... namespace x { [WebService(Namespace="mynamespace")] public class WS : System.Web.Services.WebService { ... public class Class1 { public string s; } public class Class2 { public string s; } public class Class3 { public string s; public Class1 c1; public Class2 c2; } public string Test(Class3 c3) { } } } When I use XmlSerializer to deserialize the webreference proxy for Class3, it includes namespace attributes for Class3.s, Class3.c1, and Class3.c2. If I set the namespace attribute of the webservice to "" and update the webreference, the webreference proxy no longer works. How can I tell the webservice to ignore the namespace attribute for all public types in Class3?
  • 2. Initializing item in a web service
    I am trying to do encryption inside my web service and therefore need to initialze some variables one time such as encyptin blocksize and padding type etc. Inside a client application, I do this sort of thing inside the form load or the sub main but I am lost about how this is done in a web service. Thanks, Fred Herring
  • 3. can you pass user created class back and forth with web services?
    My web service and client are trying to send objects of a user defind class. There are 3 projects in my solution: 1)BusinessObject -->contains a LoginRequest class 2)MyWebService -->contains a web service class LoginManager public bool Login( LoginRequest userlogin) 3)MainClient -->calls the web service. (web service name is localhost) public static bool Login(LoginRequest userlogin) { localhost.LoginManager ws=new localhost.LoginManager() ws.Login(userlogin) } I got the compile error : value of BusinessObject.LoginRequest can not be convert to localhost.LoginRequest... Could someone help? Thanks
  • 4. Difference between remoting and web services?
    I always understood that web services was the means to the end which is remoting. Is there a difference between remoting and XML web services, in the context of the .NET Framework? If someone told me that he was going to use the .NET Framework to do web services, but he wasn't going to be messing with remoting, is there such a thing as working with .NET web services without doing remoting? Or is there indeed a significant difference that I completely forgot about or overlooked? Thanks, Jon

Webservices with raw post data

Postby Carlo Razzeto » Fri, 02 Dec 2005 04:38:22 GMT

Hello,

I'm working on migrating a webservice my company currently has written in 
PHP over to a .Net webservice. Our service works like this:

Applications makes a HTTP POST request to the webservice with the raw post 
data consisting of XML.
The XML service creates the request processing object, passing the raw XML
Once the service is done, it returns the response XML on the same 
connection.

This webservice does not use SOAP at all, it uses a custom request and 
response schema deffined by us. My question is, how do I get access to the 
raw post data in an 'offical' XML web service? Or can I even? As far as I 
can see right now it seems that SOAP was basically made a requirement for 
webservices in ASP.Net, and I can't find any documentation telling me how to 
get access to raw post data in an XML web service. Can this be done? Or do I 
need to create an ASP.Net website which consits of a single webpage wich 
happend to accept only raw posted XML and happens to return only the XML 
response? Any help would be appriciated. Thanks,

Carlo Razzeto 



Re: Webservices with raw post data

Postby DC » Fri, 02 Dec 2005 12:01:14 GMT

What you describe is not "web services" as implemented in .NET (and most 
other software app platforms).  It is more like REST or just XML doc 
exchange.  So it is what you say - create an ASPX that accepts and generates 
XML.   This is possible in .NET but not with [WebMethod] and all the other 
webservice goodies.

Check this working example:
 http://www.**--****.com/ 

-D

-- 
-Dino
D i n o . C h i e s a  AT  M i c r o s o f t . c o m











Similar Threads:

1.How to retrieve raw HTTP Post Data

I have a page posting a raw jpg to me via HTTP POST.  All reference
I've found is centered around retrieving POST data as name/value pairs
which will not work in this situation.
What I need to do is retrieve the raw POST data and save it as a
jpg.

Here is some php code that does the same thing for reference:
           $jfh = fopen($jpeg_file, 'w') or die("can't open file");
           fwrite($jfh, $GLOBALS['HTTP_RAW_POST_DATA']);
           fclose($jfh);

I assume there is some way to access POST data as a stream and then
write that stream to a file, but it's not clear to me how. Perhaps I
need to use Request.Form.GetObjectData, but I'm not sure how to setup
SerializationInfo and StreamingContext appropriately.

Any thoughts or suggestions would be much appreciated.
Thanks in advance!

Dan

2.question about webservices and "post"ing data

Ok, I am hoping someone will be able to answer this very quickly. 
I have been writing a bunch of webservices in c#, the one thing I notice is 
this. 

On about half of them, when I call the .asmx page, and click on a function, 
it gives me fields to "post" the input into to actually try the function. 

On the other half, it just gives me the syntax to do a SOAP call. I can't 
figure it out. 

How do I get all webservices I write to allow me to "post" data like that. 

Thanks, 

3.How to manupulate raw data then display the data on the datagrid

In our database table, there are some fileds are not suitable to display on 
the grid
directly. For instance, 12:30 saved as 720 in the table.
and we want to show customer name in one column rather than show firstname,
surname, title in three columns.
So I think I need query this table and then runtime manipulate these fields
and assign these to a dataset which link to a data grid. But I don't know
how to do this, or maybe there are some better ways to achieve the same
result.

I will appreciate very much if anyone can help me with this question.



4.Question About Consuming Webservice - raw XML or objects?

I am writing an app that will consume a web service from an outside
source.  I have a question about what is actually returned from the
webservice.  I have the URL for the .ASMX file.  And I can
successfully run the web service method call.  And in Visual Studio I
was able to add a reference to the webservice.  Then Visual Studio
created the proxy classes so that I can easily run the method from
within my project.

But my question is this.  Visual Studio shows that the return from the
method call is of type XmlNode.  Is there any way that you can get
Visual Studio to sort of automatically figure out the structure of the
XML document that is returned and have it return back a more
intelligent set of objects?  In other words it would be great if
Visual Studio could figure out that the XML doc is made up of a
collection of Widget objects and that each Widget object has a
collection of Foo objects, etc.  Or do I have to write the code that
traverses the XML doc because Visual Studio/.NET will have no idea
what type these things should be?

I hope this question makes sense.  I am sort of new to web services
and also not very experienced with reading XML docs.

Thanks in advance to anyone that can help me understand or point me in
the right direction.

Corey

5.Access raw XML in webservice method?

6. ADO .NET right for raw data processing?

7. Putting Raw formatted Data in proper datatype and displaying

8. Appending raw data to placeholders



Return to ASP.NET

 

Who is online

Users browsing this forum: No registered users and 84 guest