WsdlUI发布到复杂类型

时间:2014-02-24 19:28:26

标签: c# soap wsdl

我已下载WsdlUI,这是一个开源C#SOAP客户端,无需添加引用即可使用和处理WCF消息。我可以发布到一个简单类型的方法(如字符串和整数)。当WCF方法具有复杂类型时,XML包络不正确。我有点像WCF的菜鸟,并且有点迷失所有的代码...有人请帮助;如何让XML返回正确的XML?

我在我的服务器上启用了跟踪,这是来自添加了服务引用的控制台应用程序的有效xml信封:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://host.com/BG.WCF/Service.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/MobileInterface/CreateQueuedMsg</Action>
</s:Header>
<s:Body>
<CreateQueuedMsg xmlns="http://tempuri.org/">
    <Token>add568d9-45e0-0000-98a5-762b84989797</Token>
    <BGSMSMessage xmlns:a="http://schemas.datacontract.org/2004/07/BG.Bus.Mobile.Classes" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:BusinessID>Test</a:BusinessID>
        <a:CommsGUID>eca403e7-1116-4bc3-a476-31e91c4ca33f</a:CommsGUID>
        <a:DestinationAddress>+27000000000</a:DestinationAddress>
        <a:Msg>test msg</a:Msg>
        <a:MsgEncodingType>Default</a:MsgEncodingType>
        <a:SendDT>2014-02-24T07:21:45.3187492+02:00</a:SendDT>
        <a:SystemID>Test</a:SystemID>
        <a:ValidityDT>2014-02-27T07:21:45.3187492+02:00</a:ValidityDT>
    </BGSMSMessage>
    <smsRoute xmlns:a="http://schemas.datacontract.org/2004/07/BG.Bus.Mobile.Classes" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:SMSRoute>BGWASP</a:SMSRoute>
    </smsRoute>
</CreateQueuedMsg>
</s:Body>

这是WsdlUi返回的信封:

<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/">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://bgvm08mbl01.businessgenetics.co.za/BG.Bus/BG.Bus.Mobile.WCF/MobileService.svc</To>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/MobileInterface/CreateQueuedMsg</Action>
</s:Header>
<soap:Body>
    <CreateQueuedMsg xmlns="http://tempuri.org/">
        <Token>ADD568D9-45E0-498E-98A5-762B84989797</Token>
        <BGSMSMessage>
            <BusinessID>Test</BusinessID>
            <CommsGUID>559eb322-7b01-438d-93f1-74b1aafccc4f</CommsGUID>
            <DestinationAddress>0000000000</DestinationAddress>
            <Msg>Testers2014-02-24 07:37:53</Msg>
            <MsgEncodingType>Default</MsgEncodingType>
            <SendDT>2014-02-24 07:37:53</SendDT>
            <SystemID>Test</SystemID>
            <ValidityDT>2014-02-27 07:37:53</ValidityDT>
        </BGSMSMessage>
        <smsRoute>
            <SMSRoute>BGWASP</SMSRoute>
            <SMSRoute>GV</SMSRoute>
        </smsRoute>
    </CreateQueuedMsg>
</soap:Body>

1 个答案:

答案 0 :(得分:1)

我是WsdlUI的开发者,所以感谢您使用它。

由于您所指的错误,应用程序当前不适用于复杂类型。

我应该在6月中旬发布一个可以解决这个问题的版本。

感谢您在帖子中详细说明问题。

相关问题