Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys

I need to send a class through a WS .net from Vbscript
I mean: I need to consume a webService that is develop in .Net 2010 with ASP classic.
But this WebService, needs to back a Class with UserName and password

I made the class in VBScript in dreamweaver:
VB
<%
Class IdCard
        Private m_usuario 'As String
        Private m_password ' As Integer
        Private m_IsBeta 'As boolean



        Public Property Get Usuario()
              Usuario = m_Usuario
        End Property

        Public Property Let Usuario(p_Data)
              m_Usuario = p_Data
        End Property

        Public Property Get Password()
              Password = m_Password
        End Property

        Public Property Let Password(p_Data)
              m_Password = p_Data
        End Property

        Public Property Get IsBeta()
              IsBeta = m_IsBeta
        End Property

        Public Property Let IsBeta(p_Data)
              m_IsBeta = p_Data
        End Property

End Class
%>




And this is how I instantiate the Class page.asp:
VB
SET Seguridad = new idCard
Seguridad.usuario = "CgUlDSJZvIc="
Seguridad.password = "/px5j+mfNBc="
SendClassToAnotherPage(Seguridad)




Then I send this class in the web method page2.asp:
function SendClassToAnotherPage(Seguridad)

Set Result = oSoapClient.WsAuto(seguridad)	 


but.. after execute the line shown above...this throws an Error:
"ERROR5 \SoapMapper\SoapMapper:Saving SoapMapper idUser failed HRESULT=0x80004002: Interfaz no compatible - Client:Unspecified client error. HRESULT=0x80004002: Interfaz no compatible "



but if I change the data:
Set Result = oSoapClient.WsAuto("some string data and not a class")


The response is fine. I mean ...with my own customize errors.
XML
<wsAutoResult>
<Folio>0</Folio>
<Status>Usuario Invalido</Status>
<hasErrors>true</hasErrors>
</wsAutoResult>
</wsAutoResponse>


Thanks people.
Posted
Updated 23-Jan-13 11:33am
v2
Comments
BC @ CV 23-Jan-13 17:41pm    
Perhaps the service is expecting an XML serialized object. What if instead of sending the class you sent its XML representation. Such as:
"<idcard><usuario>CgUlDSJZvIc=</usuario><Password>/px5j+mfNBc=</Password></idcard>"
Rene Bustos 24-Jan-13 10:16am    
that sound good.. let me try that and i'll post the results. thanks
BC @ CV 24-Jan-13 13:47pm    
Is your XML formated properly?
SOAP
Rene Bustos 24-Jan-13 13:56pm    
i think yes.. i check the Specifications of SOAP and it appear is all fine.
but still throwme the error.
BC @ CV 24-Jan-13 14:48pm    
Well, I can only guess from your error message, "...Interfaz no compatible...", that your XML (serialized object) doesn't match the interface of the object that's expected by the WS.

1 solution

Doesn't work :S.
i have try this ways..
1.- Seding all the request XML:

<soap:envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:body>
    <wsauto xmlns="http://www.nationalunity.com/wss/wsRemotePolicyWT/">
      <iduser>
        <username>string</username>
        <password>string</password>
        <isbeta>boolean</isbeta>
      </iduser>
      <poliza>
        <prefijo>string</prefijo>
        <folio>int</folio>
        <tipoendoso>string</tipoendoso>
        <estadoentrada>string</estadoentrada>
        <motivovisita>string</motivovisita>
        <fecharegistro>dateTime</fecharegistro>
        <iniciovigencia>dateTime</iniciovigencia>
        <finvigencia>dateTime</finvigencia>
        <FormaPago>string</FormaPago>
        <moneda>string</moneda>
        <nombreasegurado>string</nombreasegurado>
        <mxcallenumero>string</mxcallenumero>
        <mxcolonia>string</mxcolonia>
        <mxcodigopostal>string</mxcodigopostal>
        <email>string</email>
        <producto>string</producto>
        <mxmunicipio>string</mxmunicipio>
        <mxestadonom>string</mxestadonom>
        <mxlada>string</mxlada>
        <mxtelefonono>string</mxtelefonono>
        <anio>string</anio>
        <serie>string</serie>
        <placas>string</placas>
        <marca>string</marca>
        <modelo>string</modelo>
        <descripcionuso>string</descripcionuso>
        <paisplacas>string</paisplacas>
        <estadoplacas>string</estadoplacas>
        <remolque>string</remolque>
        <descripcionremolque>string</descripcionremolque>
        <puertoentrada>string</puertoentrada>
        <prima>string</prima>
        <derecho>string</derecho>
        <asistencia>string</asistencia>
        <miscelaneo>string</miscelaneo>
        <descuento>string</descuento>
        <extraprima>string</extraprima>
        <concepto_extraprima>string</concepto_extraprima>
        <prefijo_anterior>string</prefijo_anterior>
        <folio_anterior>string</folio_anterior>
        <observaciones>string</observaciones>
        <financiamiento>string</financiamiento>
        <enganche>string</enganche>
        <meses_financiamiento>string</meses_financiamiento>
        <numero_vehiculos>string</numero_vehiculos>
        <foliocertificado>string</foliocertificado>
        <estatus>string</estatus>
        <referenciapago>string</referenciapago>
        <filler1>string</filler1>
        <filler2>string</filler2>
        <nombreconductor>string</nombreconductor>
        <nolicencia>string</nolicencia>
        <fechanacimiento>string</fechanacimiento>
        <ocupacion>string</ocupacion>
      </poliza>
      <hash>string</hash>
    </wsauto>
  </soap:body>
</soap:envelope>


i store all the XML structure in a variable an i Put in the Ws Method like this.
Ws.WsAuto(Xmlstructure)
IdCard, Poliza and Hash
But the WS Method needs tree arguments,, so i split in tree variables and i passed to the Ws Method Like this
Ws.WsAuto(xmlIdCard,XmlPoliza,Hash)

But Still throw an error.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900