Node-soap: How to create a complex message with specific attributes?

后端 未结 1 673
名媛妹妹
名媛妹妹 2021-01-15 07:40

This is the message I need to send to wsdl:




        
相关标签:
1条回答
  • 2021-01-15 08:36

    Assuming that enqueue is a SOAP method defined in the WSDL and you're calling it from the node-soap-created client, I would go with something like:

    args: {
        attributes: {
            'xmlns:xsd':'http://www.w3.org/2001/XMLSchema',
            'xmlns:xsi':'http://www.w3.org/2001/XMLSchema-instance',
            'xmlns:SOAP-ENC':'http://schemas.xmlsoap.org/soap/encoding/'
        },
        $value: {
            'domain': {
                attributes: {'xsi:type':'xsd:string'},
                $value: 'STH'
            },
            'messageBodies': {
                attributes: {
                    'SOAP-ENC:arrayType':'xsd:string[1]',
                    'xsi:type':'SOAP-ENC:Array'
                },
                $value: {
                    'item': {
                        attributes: {'xsi:type':'xsd:string'},
                        $value: [
                            'STHE'
                        ]
                    }
                }
            },
            'recipientNumbers': {
                attributes: {
                    'SOAP-ENC:arrayType':'xsd:string[2]',
                    'xsi:type':'SOAP-ENC:Array'
                },
                $value: {
                    'item': {
                        attributes: {'xsi:type':'xsd:string'},
                        $value: [
                            '09xxxxxxxx',
                            '09xxxxxxxx'
                        ]
                    }
                }
            },
            'senderNumbers': {
                attributes: {
                    'SOAP-ENC:arrayType':'xsd:string[1]',
                    'xsi:type':'SOAP-ENC:Array'
                },
                $value: {
                    'item': {
                        attributes: {'xsi:type':'xsd:string'},
                        $value: [
                            '3000xxxxx'
                        ]
                    }
    
                }
            },
            'encodings': {
                attributes: {
                    'xsi:nil':'true',
                    'xsi:type':'SOAP-ENC:Array'
                }
            },
            'udhs': {
                attributes: {
                    'xsi:nil':'true',
                    'xsi:type':'SOAP-ENC:Array'
                }
            },
            'messageClasses': {
                attributes: {
                    'xsi:nil':'true',
                    'xsi:type':'SOAP-ENC:Array'
                }
            },
            'priorities': {
                attributes: {
                    'xsi:type':'SOAP-ENC:Array'
                }
            },
            'checkingMessageIds': {
                attributes: {
                    'SOAP-ENC:arrayType':'xsd:long[2]',
                    'xsi:type':'SOAP-ENC:Array'
                },
                $value: {
                    'item': {
                        attributes: {'xsi:type':'xsd:long'},
                        $value: [
                            '100',
                            '101'
                        ]
                    }
                }
            }
        }    
    }
    
    0 讨论(0)
提交回复
热议问题