win7下访问webservice的一个问题,如何解决?
在xp下运行正常,代码好下
m.swUrl="...." &&一个webservice的wdsl网址
mSoap = Createobject("MSSOAP.soapclient30")
mSoap.MSSoapInit(m.swUrl) &&winxp正常,win7出错
win7就出错,信息如下:
ole iDispath 异常代码 0 出自 WSDLReader:
WSDLReader: Loading of the WSDL file failed
HRESUlT=0X80040154:没有注册类
- Client:An unanticipated error occurred during the processingof the request. HRESULT=0X8004054:没有注册类..
[解决办法]
恭喜楼主了。
[解决办法]
你的问题应该与下面问题是一类的。
为什么已经注册了的ActiveX控件,通过代码方式建立此对象时,却提示“类别未授权使用”。*----------------------------------------------------某些ActiveX控件存在此种问题,以下以mswinsck.ocx为例:创建此对象的代码:LOCAL owinsock &&winsock对象owinsock = CREATEOBJECT("mswinsock.winsock")IF TYPE("owinsock") # "O" MESSAGEBOX("WINSOCK对象初始化错误,请注册WINSOCK对象!",16,"系统提示") RETURNENDIFIF owinsock.localip == "127.0.0.1" OR EMPTY(owinsock.localip) RELEASE owinsock IF MESSAGEBOX("网络连接错误,该机器没有连接网线,是否继续?" + CHR(13) + "正常情况下您应该选择“否”来退出,然后联系相关技术人员!",4+16+256,"提示") <> 6 RETURN ENDIFENDIF以上代码没有问题,在开发的机器上(安装了VFP)运行正常,而在没安装VFP的机子运行却提示“类别未授权使用”因为开发的机子安装VFP时,取得了OCX授权,而在未安装VFP的机器上没有取得OCX授权使用纯代码建立winsock对象,对于开发的那台机器没问题,别的机器都用不了。所以这不是ocx的注册问题,而是ocx的授权问题。解决方法:对于mswinsck.ocx来说,如果想不报错,请不要用纯代码来建立winsock对象,改用可视化,即把这个ocx拖到表单上。因为可视化建立的winsock连编成EXE时会自动带上授权密钥.或MS 很多控件都有这种设计/运行时授权的限制,要动态创建这些对象,运行的机器上必须有授权许可,而拖入表单中的控件已携带了授权许可,所以不需要。把下列内容保存到一个 vbctrls.reg 文件中,然后双击它导入注册表,即可拥有动态创建时的授权许可:Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Licenses] @="Licensing: Copying the keys may be a violation of established copyrights." [HKEY_CLASSES_ROOT\Licenses\12B142A4-BD51-11d1-8C08-0000F8754DA1] @="aadhgafabafajhchnbchehfambfbbachmfmb" [HKEY_CLASSES_ROOT\Licenses\190B7910-992A-11cf-8AFA-00AA00C00905] @="gclclcejjcmjdcccoikjlcecoioijjcjnhng" [HKEY_CLASSES_ROOT\Licenses\1F3D5522-3F42-11d1-B2FA-00A0C908FB55] @="gcfjdjecpchcncdjpdejijgcrdoijjfcieod" [HKEY_CLASSES_ROOT\Licenses\2c49f800-c2dd-11cf-9ad6-0080c7e7b78d] @="mlrljgrlhltlngjlthrligklpkrhllglqlrk" [HKEY_CLASSES_ROOT\Licenses\4250E830-6AC2-11cf-8ADB-00AA00C00905] @="kjljvjjjoquqmjjjvpqqkqmqykypoqjquoun" [HKEY_CLASSES_ROOT\Licenses\4D553650-6ABE-11cf-8ADB-00AA00C00905] @="gfjmrfkfifkmkfffrlmmgmhmnlulkmfmqkqj" [HKEY_CLASSES_ROOT\Licenses\4F86BADF-9F77-11d1-B1B7-0000F8753F5D] @="iplpwpnippopupiivjrioppisjsjlpiiokuj" [HKEY_CLASSES_ROOT\Licenses\57CBF9E0-6AA7-11cf-8ADB-00AA00C00905] @="aahakhchghkhfhaamghhbhbhkbpgfhahlfle" [HKEY_CLASSES_ROOT\Licenses\6FB38640-6AC7-11cf-8ADB-00AA00C00905] @="gdjkokgdldikhdddpjkkekgknesjikdkoioh" [HKEY_CLASSES_ROOT\Licenses\72E67120-5959-11cf-91F6-C2863C385E30] @="ibcbbbebqbdbciebmcobmbhifcmciibblgmf" [HKEY_CLASSES_ROOT\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9] [HKEY_CLASSES_ROOT\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9\11.0] [HKEY_CLASSES_ROOT\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9\11.0\Retail] @="sbbcdcprktpjtapmmfdacmupasbhscddncgp" [HKEY_CLASSES_ROOT\Licenses\78E1BDD1-9941-11cf-9756-00AA00C00908] @="yjrjvqkjlqqjnqkjvprqsjnjvkuknjpjtoun" [HKEY_CLASSES_ROOT\Licenses\7C35CA30-D112-11cf-8E72-00A0C90F26F8] @="whmhmhohmhiorhkouimhihihwiwinhlosmsl" [HKEY_CLASSES_ROOT\Licenses\80E80EF0-DBBE-11D0-BCE2-00A0C90DCA10] @="qijimitpmpnpxplpvjnikpkpqoxjmpkpoivj" [HKEY_CLASSES_ROOT\Licenses\899B3E80-6AC6-11cf-8ADB-00AA00C00905] @="wjsjjjlqmjpjrjjjvpqqkqmqukypoqjquoun" [HKEY_CLASSES_ROOT\Licenses\9E799BF1-8817-11cf-958F-0020AFC28C3B] @="uqpqnqkjujkjjjjqwktjrjkjtkupsjnjtoun" [HKEY_CLASSES_ROOT\Licenses\B1EFCCF0-6AC1-11cf-8ADB-00AA00C00905] @="qqkjvqpqmqjjpqjjvpqqkqmqvkypoqjquoun" [HKEY_CLASSES_ROOT\Licenses\BC96F860-9928-11cf-8AFA-00AA00C00905] @="mmimfflflmqmlfffrlnmofhfkgrlmmfmqkqj" [HKEY_CLASSES_ROOT\Licenses\BEA2ED97-562A-4510-974C-C4F20AE429AD] "1"=hex:d2,00,57,01,18,01,7e,01,de,00,77,01,a5,00,9a,00,e1,00,16,01,9d,00,f1,\ 00,4e,01,73,00,30,01,5c,00,23,01,c5,00 [HKEY_CLASSES_ROOT\Licenses\CDE57A55-8B86-11D0-b3C6-00A0C90AEA82] @="ekpkhddkjkekpdjkqemkfkldoeoefkfdjfqe" [HKEY_CLASSES_ROOT\Licenses\CEDD4F80-B43C-11cf-837C-00AA00573EDE] @="gxwaezucfyqpwjgqbcmtsncuhwsnyhiohwxz" [HKEY_CLASSES_ROOT\Licenses\DC4D7920-6AC8-11cf-8ADB-00AA00C00905] @="iokouhloohrojhhhtnooiokomiwnmohosmsl" [HKEY_CLASSES_ROOT\Licenses\E32E2733-1BC5-11d0-B8C3-00A0C90DCA10] @="kmhfimlflmmfpffmsgfmhmimngtghmoflhsg" [HKEY_CLASSES_ROOT\Licenses\ED4B87C4-9F76-11d1-8BF7-0000F8754DA1] @="knlggnmntgggrninthpgmnngrhqhnnjnslsh