Foxtable(狐表)用户栏目专家坐堂 → webservice调用报错


  共有2655人关注过本帖树形打印复制链接

主题:webservice调用报错

帅哥哟,离线,有人找我吗?
s111321
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:44 积分:534 威望:0 精华:0 注册:2020/6/27 10:03:00
webservice调用报错  发帖心情 Post By:2020/11/27 17:10:00 [只看该作者]

1、vsWEB引用
图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20201127170515.png
图片点击可在新窗口打开查看

2、Public Class Class1
    Public Function execute(ByVal routeIdField As String, ByVal signDataField As String, ByVal callerIdField As String, ByVal userIdField As String, ByVal transIdField As String, ByVal referenceIdField As String,
                     ByVal referenceTimeField As String, ByVal signTypeField As String, ByVal reserveField As String, ByVal returnCodeField As String, ByVal errorCodeField As String, ByVal errorMsgField As String,
                     ByVal recordField As String, ByVal typeField As String, ByVal recordsField As String()) As String
        Dim obj As New WebReference.TargetService
        Dim str2 As New WebReference.recordsType
        str2.type = typeField
        str2.record = recordsField
        Dim strheader As New WebReference.headerType
        strheader.callerId = callerIdField
        strheader.userId = userIdField
        strheader.transId = transIdField
        strheader.referenceId = referenceIdField
        strheader.referenceTime = referenceTimeField
        strheader.signType = signTypeField
        strheader.reserve = reserveField
        strheader.returnCode = returnCodeField
        strheader.errorCode = errorCodeField
        strheader.errorMsg = errorMsgField
        Dim strbody As New WebReference.bodyType
        strbody.record = recordField
        strbody.records = {str2}
        Dim Str As New WebReference.executeMsgType
        Str.routeId = routeIdField
        Str.header = strheader
        Str.body = strbody
        Str.signData = signDataField
        Return obj.execute(Str).routeId
    End Function
End Class

3、Dim dl As new ClassLibrary14.Class1()
Dim str5 As String = dl.execute("ZG10JH0201","","ZG00000002","8348","","","","","","","","","{""MessageHeader"":{""MessageType"":""5002"",""IsZip"":""0"",""HospitalId"":""8348"",""HospitalRegion"":""330799"",""IPAddress"":""192.192.106.139"",""MacAddress"":""8C-16-45-96-0B-A1"",""BmiNo"":""A33492489"",""BmiNoIden"":""A33492489330799D15600000529418E405EFC597B"",""AdmissionNo"":""10592"",""InsuredPersonRegion"":""330799"",""TransactionDate"":""2020-11-11 09:30:55"",""HospitalVerifyCode"":""eN3bzL9UF/LV+qk6fMF80Q==""}}","",{})
e.Form.Controls("TextBox3").text = str5

4、报错
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2020.5.29.8
错误所在事件:窗口,窗口1,Button3,Click
详细错误信息:
XML 文档(2, 2)中有错误。
未识别指定的类型: name='executeResponse',namespace='http://www.jhlss.gov.cn/esb/TargetService',位于 <executeResponse xmlns='http://www.jhlss.gov.cn/esb/TargetService'>。

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110648 积分:563148 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/11/27 17:21:00 [只看该作者]

这种按照之前添加服务引用的方式试试,不要使用添加web引用的方式

 回到顶部
帅哥哟,离线,有人找我吗?
s111321
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:44 积分:534 威望:0 精华:0 注册:2020/6/27 10:03:00
  发帖心情 Post By:2020/11/27 17:28:00 [只看该作者]

引用时,显示找到的服务是RouteService,但引用后,我找不到这个服务,跟这个有关系吗?

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110648 积分:563148 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/11/27 17:31:00 [只看该作者]

把服务地址发上来试试

 回到顶部
帅哥哟,离线,有人找我吗?
s111321
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:44 积分:534 威望:0 精华:0 注册:2020/6/27 10:03:00
  发帖心情 Post By:2020/11/27 18:14:00 [只看该作者]


[此贴子已经被作者于2020/11/27 18:15:53编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
s111321
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:44 积分:534 威望:0 精华:0 注册:2020/6/27 10:03:00
  发帖心情 Post By:2020/11/27 18:23:00 [只看该作者]

图片点击可在新窗口打开查看地址外网无法访问
[此贴子已经被作者于2020/11/27 18:33:23编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
s111321
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:44 积分:534 威望:0 精华:0 注册:2020/6/27 10:03:00
  发帖心情 Post By:2020/11/27 18:26:00 [只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:微信图片_20201127182443.png
图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110648 积分:563148 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/11/28 9:03:00 [只看该作者]

这些东西我也看不懂。2种服务如果都试过不行,找接口方咨询一下

 回到顶部
帅哥哟,离线,有人找我吗?
s111321
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:44 积分:534 威望:0 精华:0 注册:2020/6/27 10:03:00
  发帖心情 Post By:2020/11/28 9:32:00 [只看该作者]

请问下,我看了上传数据是已经成功了,就是返回信息解析好像有问题,我想将返回的routeId的值显示出来,但是报错:   未将对象引用设置到对象的实例。,能帮忙看下VS中写的哪里有问题吗?
Public Class Class1
    Public Function ServiceReference1_TargetServiceInterface_execute(ByVal routeIdField As String, ByVal signDataField As String, ByVal callerIdField As String,
                                                                     ByVal userIdField As String, ByVal transIdField As String, ByVal referenceIdField As String,
                     ByVal referenceTimeField As String, ByVal signTypeField As String, ByVal reserveField As String, ByVal returnCodeField As String,
                                                                     ByVal errorCodeField As String, ByVal errorMsgField As String,
                     ByVal recordField As String, ByVal typeField As String, ByVal recordsField As String()) As String
        Dim str2 As New ServiceReference1.recordsType
        str2.type = typeField
        str2.record = recordsField
        Dim strheader As New ServiceReference1.headerType
        strheader.callerId = callerIdField
        strheader.userId = userIdField
        strheader.transId = transIdField
        strheader.referenceId = referenceIdField
        strheader.referenceTime = referenceTimeField
        strheader.signType = signTypeField
        strheader.reserve = reserveField
        strheader.returnCode = returnCodeField
        strheader.errorCode = errorCodeField
        strheader.errorMsg = errorMsgField
        Dim strbody As New ServiceReference1.bodyType
        strbody.record = recordField
        strbody.records = {str2}
        Dim Str As New ServiceReference1.executeMsgType
        Str.routeId = routeIdField
        Str.header = strheader
        Str.body = strbody
        Str.signData = signDataField
        Dim str3 As New ServiceReference1.executeRequest
        str3.execute = Str
        'obj.execute(str3)
        Dim obj As New ServiceReference1.TargetServiceInterfaceClient
        Dim st10 As ServiceReference1.executeResponse = obj.ServiceReference1_TargetServiceInterface_execute(str3)
        Dim st11 As String = st10.executeResponse1.routeId
        Return st11
    End Function
End Class

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110648 积分:563148 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/11/28 9:37:00 [只看该作者]

到vs里调试看那一句代码出错

 回到顶部