Foro de elhacker.net

Programación => Desarrollo Web => Mensaje iniciado por: NoelAdan en 21 Diciembre 2018, 17:09 pm



Título: WEB SERVICE
Publicado por: NoelAdan en 21 Diciembre 2018, 17:09 pm
Tengo una duda con respecto a la lectura de XML, ya que intento leer un nodo, pero no logro leer ambos... De hecho sólo puedo leer el primer nodo a partir de <cus:updateCustomerRequest>

------------------- Éste es el XML -------------------
<soapenv:Envelope xmlns:cli="http://www.accurate.com/acec/Customer" xmlns:cus="http://www.accurate.com/acec/CustomerServices"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<cus:updateCustomerRequest>
<cli:customer>
<cli:documentNumber>82053356000158</cli:documentNumber>
</cli:customer>
<cus:status>APV</cus:status>
</cus:updateCustomerRequest>
</soapenv:Body>
</soapenv:Envelope>
------------------- MI CÓDIGO -------------------
<WebService(Namespace:="http://schemas.xmlsoap.org/soap/envelope/")>
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)>
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Public Class WSDurakeloCustomer
    Inherits System.Web.Services.WebService

    Public Sub New()
        MyBase.New()
    End Sub   
    <WebMethod>
    <SoapDocumentMethod("notifyCustomerCreation",
        ResponseNamespace:="http://www.accurate.com/acec/CustomerServices",       
                        ParameterStyle:=SoapParameterStyle.Bare)>
    Public Function notifyCustomerCreation(<XmlElement("updateCustomerRequest", Namespace:="http://www.accurate.com/acec/CustomerServices")> ByVal variable As XmlElement) As <XmlElement("notifyCustomerCreationResponse")> RespuestaXML
Dim datos = variable.outerXML
Return New RespuestaXML("OK")
    End Function


Título: Re: WEB SERVICE
Publicado por: NoelAdan en 21 Diciembre 2018, 17:52 pm
Usa en <XmlAnyElement("updateCustomerRequest", Namespace:="http://www.accurate.com/acec/CustomerServices")> ByVal variable As XmlElement
en el parámetro de la función