将类作为参数从ASP 3.0传递到WebService .NET [英] Pass a Class as Parameter from ASP 3.0 to WebService .NET
问题描述
嗨大家好
我需要从Vbscript通过WS .net发送课程
我的意思是:我需要消耗一个使用ASP classic在.Net 2010中开发的webService。
但是这个WebService需要使用UserName和密码来支持一个类
我在Dreamweaver中用VBScript制作课程:
<%
Class IdCard
私有 m_usuario ' 字符串
私有 m_password ' As Integer
私有 m_IsBeta ' 作为布尔
公开 属性 获取 Usuario()
Usuario = m_Usuario
结束 物业
公开 属性 让 Usuario(p_Data)
m_Usuario = p_Data
结束 物业
公开 属性 获取密码()
密码= m_Password
结束 物业
公共 属性 让密码(p_Data)
m_Password = p_Data
结束 属性
公共 属性 获取 IsBeta()
IsBeta = m_IsBeta
结束 属性
公开 属性 让 IsBeta(p_Data)
m_IsBeta = p_Data
结束 属性
结束 类
%>
这就是我实例化Class page.asp:
SET Seguridad = new idCard
Seguridad.usuario = CgUlDSJZvIc =
Seguridad.password = / px5j + mfNBc =
SendClassToAnotherPage(Seguridad)
然后我在Web方法page2.asp发送这个类:
function SendClassToAnotherPage(Seguridad)
设置结果= oSoapClient.WsAuto(seguridad)
但是......执行上面显示的行后......这个抛出错误:
ERROR5 \SoapMapper \SoapMapper:保存SoapMapper idUser失败HRESULT = 0x80004002:Interfaz不兼容 - 客户端:未指定客户端错误。 HRESULT = 0x80004002:Interfaz不兼容
但如果我更改数据:
设置Result = oSoapClient.WsAuto(某些字符串数据而不是类)
答案很好。我的意思是......我自己的自定义错误。
< wsAutoResult >
< < span class =code-leadattribute> Folio > 0 < / Folio >
< < span class =code-leadattribute>状态 > Usuario Invalido < /状态 >
< hasErrors > true < / hasErrors >
< / wsAutoResult >
< / wsAutoResponse >
谢谢大家。
不行:S。
i试试这个方式..
1.-整理所有请求XML:
< soap:envelope xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexmlns:xsd =http://www.w3.org/2001/XMLSchemaxmlns:soap =http://schemas.xmlsoap。组织/肥皂/信封/>
< 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存储变量中的所有XML结构和放入Ws方法中这个。
Ws.WsAuto(Xmlstructure)
IdCard,Poliza和Hash
但是WS方法需要树参数,所以我分成了树变量和我传递给Ws方法像这样
Ws.WsAuto(xmlIdCard,XmlPoliza,Hash)
但仍然抛出错误
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:
<%
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:
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.
<wsAutoResult>
<Folio>0</Folio>
<Status>Usuario Invalido</Status>
<hasErrors>true</hasErrors>
</wsAutoResult>
</wsAutoResponse>
Thanks people.
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.
这篇关于将类作为参数从ASP 3.0传递到WebService .NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!