sergiobotta
Programmer
I am new in VB.NET webservices. I have created this WS:
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.
Image
But I don´t know how to define it on my code. Thanks a lot!
Code:
<%@ WebService Language="vb" Class="Service" %>
Imports System.Web.Services
Imports System.Net
Imports System.IO
Imports System.Xml
<WebService(Namespace:="[URL unfurl="true"]http://nnn.nnn.nnn.nnn/ws/WSName")>[/URL]
<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=""[URL unfurl="true"]http://nnn.nnn.nnn.nnn/ws/WSName"">"[/URL]
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.
Image
But I don´t know how to define it on my code. Thanks a lot!