×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to define type of respone for my webservice

How to define type of respone for my webservice

How to define type of respone for my webservice

(OP)
I am new in VB.NET webservices. I have created this WS:

CODE --> VB.NET

<%@ WebService Language="vb" Class="Service" %>
Imports System.Web.Services
Imports System.Net
Imports System.IO
Imports System.Xml
<WebService(Namespace:="http://nnn.nnn.nnn.nnn/ws/WSName")>
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
Inherits System.Web.Services.WebService 
<WebMethod()>
Public Function FunctionToCall(ByVal usuario As String, ByVal clave As String) As XmlDocument
    <my code here>
    Dim inicioXML As string = "<RespuestaDelServicio xmlns=""http://nnn.nnn.nnn.nnn/ws/WSName"">"
    Dim finXML As string = "</RespuestaDelServicio>"
    Dim xmlResponse As String = "<data>....</data>"
    Dim cuerpoXML As String = inicioXML & xmlResponse & finXML
    Dim XMLdoc2 As New XmlDocument
    XMLdoc2.LoadXml(cuerpoXML)
    Dim xmldecl As XmlDeclaration
    xmldecl = XMLdoc2.CreateXmlDeclaration("1.0", Nothing, Nothing)
    xmldecl.Encoding = "UTF-8"  
    xmldecl.Standalone = "yes"
    Dim root As XmlElement = XMLdoc2.DocumentElement 
    XMLdoc2.InsertBefore(xmldecl, root)
    Return XMLdoc2
End Function 

When I try it in SoapUI, the result seems to be Ok, but If I validate it using ALT+V I receive the error: "line 5: Element not allowed (strict wildcard, and no definition found)". It seems that I have to define processContents to 'lax' so SoapUI does not try to validate my response against a XSD file.

Link

But I donĀ“t know how to define it on my code. Thanks a lot!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close