WebService accepts XML requests

I need to desing a web service that accepts an XML from another client.  Can some one please tell me how to start this in vb .NET 2.0.
Thanks
indikadAsked:
Who is Participating?
 
indikadAuthor Commented:
' this method will get the XML posted to us
        Dim bytes As Byte() = New Byte(HttpContext.Current.Request.InputStream.Length - 1) {}
        HttpContext.Current.Request.InputStream.Read(bytes, 0, bytes.Length)
        Dim enc As System.Text.Encoding = New System.Text.ASCIIEncoding()
        Dim strTest As String = enc.GetString(bytes)
0
 
Bob LearnedCommented:
This is a very broad question.  Do you know how to create a web service?

Bob
0
 
indikadAuthor Commented:
Yes I have created few webservices to connect to other sites.  This is the first time I have to accept someone's request.  They are sending an XML and I tried few diff ways but no luck so far
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Bob LearnedCommented:
Did you try a web method that accepts XML text as a string argument?

<WebMethod> _
Public Sub ReceiveXml(ByVal xmlText As String)
End Sub

Are you going to return something to the caller?

Bob
0
 
indikadAuthor Commented:
Yes... just few seconds ago i tried this and it works.  Is this the best way to do?  Looks like clients has to do some changes to the XML before they send to us.  eg: change any >/< within text to something?
Do you know the limitaiton of this xmlText ?
0
 
Bob LearnedCommented:
The limitations are whatever SOAP and IIS can handle, because the limitation for string is like 2 GB of text.  If you are sending XML text that reaches those limits, then I would reevaluate the process, because XML can add a significant amount of overhead to the process.

Bob
0
 
indikadAuthor Commented:
Is this the only way to accept an XML withing a WebService (as a string)?  
0
 
Bob LearnedCommented:
You could accept it as anything SOAP serializable.

Bob
0
 
indikadAuthor Commented:
I am sorry I need some examples.  I need to accept XML requests and read them.  I also need to generate XMLs and send back to the client.  
0
 
Bob LearnedCommented:
Examples of what?  Web methods that take strings?  Web methods that return strings?

Bob
0
 
indikadAuthor Commented:
Please close this question.  No one has posted a soultion.
0
 
Bob LearnedCommented:
Did you answer any of my questions?

Bob
0
 
indikadAuthor Commented:
I didn't have to answer any of your questions. I have found the solution in some other site.  
0
 
Bob LearnedCommented:
What was the solution?

Bob
0
 
indikadAuthor Commented:
Please close this question and retun points
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.