BizTalk-请求中未发送0参数Web消息 [英] BizTalk - 0 parameter web message not being sent in Request

查看:78
本文介绍了BizTalk-请求中未发送0参数Web消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在连接到不接受任何参数的SOAP 1.1 Web服务,并返回一个简单的字符串响应.

I am connecting to a SOAP 1.1 web service with accepts no parameters and returns a simple string response.

我已经使用旧的.NET 2.0 添加Web参考为复杂类型生成了xsd文件,该文件还在Reference.odx中生成了端口和多部分消息类型

I have generated my xsd files for the complex types using the old .NET 2.0 Add Web Reference which has also generated the port and multi-part message types in Reference.odx

在业务流程中,我使用 Web消息类型下的正确的多部分消息作为我的请求和响应消息的类型,并使用空的 Construct Message 形状作为在发送操作之前请求消息.

In my Orchestration I use the correct multi-part message under Web Message Types as the type of my request and response message and use an empty Construct Message shape for the request message prior to the Send action.

尽管显式构造了不带任何参数的请求消息,但我可以看到(在Fiddler中)对服务的请求是正确构建的,但是该请求没有任何主体.我期待着

Despite explicitly constructing the request message with no parameters I can see (in Fiddler) that the request to the service is built correctly but there is no body for the request. I am expecting

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
                   xmlns:myns="http:myns">
        <soap:Body>
            <myns:ServiceName/>
        </soap:Body>
    </soap:Envelope>

端口和适配器设置正确,因为我可以手动插入带有名为节点的自关闭请求的预期请求主体,然后重播失败的请求,然后成功.

The port and adapter is set up correctly as I can manually insert the expected request body with self-closing request named node and replay the failed request which then succeeds.

我可以想到2个可能出错的地方:

I can think of 2 places where I may be going wrong:

  1. 在业务流程中构造消息
  2. 我的端口适配器可能会忽略空消息,并且在请求正文中不包括SOAP信封

即使主体为空,如何强制SOAP信封存在?

How can I force the SOAP envelope to be present even if the body is empty?

推荐答案

我的问题是由在业务流程中直接使用自动生成的网络消息引起的.我通过以下方式解决"了我的问题:

My issue was caused by using the auto-generated web-messages in my orchestration directly. I 'solved' my issue by:

  1. 使用.NET 2.0添加Web参考来保存wsdl为服务生成xsd
  2. 使用添加生成的项目".>使用wsdl和xsd选项并选择1中生成的文件来使用WCF服务.
  3. 手动更改生成的文件以删除一些重复的复杂类型和无效的导入
  4. 更改odx,将消息类型上的修饰符更改为public(从内部)
  5. 从我的BizTalk项目中排除Web参考,以避免重复

然后,我可以在业务流程中使用生成的多部分消息.至关重要的是,不带参数的服务消息是用消息部分定义的,我可以使用消息分配形状对没有内容的消息部分进行硬编码.

I can then use the generated multi-part messages in my orchestration. Critically, the message for the service taking no parameters was defined with a message part that I can use the message assignment shape to hard-code the message part with no content.

我还获得了一些其他好处,例如异常类型.

I also get some other side benefits such as Exception types.

这篇关于BizTalk-请求中未发送0参数Web消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆