Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

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
0
indikad
Asked:
indikad
  • 8
  • 7
1 Solution
 
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
 
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
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 
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:
' 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
 
indikadAuthor Commented:
Please close this question and retun points
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now