Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为此soap信封xml创建xsd模式?_Xml_Soap_Xsd - Fatal编程技术网

如何为此soap信封xml创建xsd模式?

如何为此soap信封xml创建xsd模式?,xml,soap,xsd,Xml,Soap,Xsd,如何为这个xml文档创建xsd shema? 我尝试了很多解决方案,但都没有结果 <?xml version="1.0" encoding="utf-8"?> <e:Envelope xmlns:e="http://www.w3.org/2003/05/soap-envelope"> <e:Header> <RequestInfo Type="SetConfig" Id="AB1y0WzRv42Nz4G8V

如何为这个xml文档创建xsd shema? 我尝试了很多解决方案,但都没有结果

<?xml version="1.0" encoding="utf-8"?>
    <e:Envelope xmlns:e="http://www.w3.org/2003/05/soap-envelope">
        <e:Header>
            <RequestInfo Type="SetConfig" Id="AB1y0WzRv42Nz4G8V+UW">
                <ReturnAddresses>
                    <Address>
                        mars@contact
                    </Address>
                </ReturnAddresses>
            </RequestInfo>
        </e:Header>
        <e:Body>
            <RequestData>
                MIIBhzCCAYOgAwIBADCCAXowfDB6M
            </RequestData>
        </e:Body>
    </e:Envelope>

mars@contact
MIIBhzCCAYOgAwIBADCCAXowfDB6M

以防您正在寻找wsdl(自我编写wsdl以来已经很多年了,但我相信这对您来说是一个很好的起点)


注意SOAP绑定中头和体是如何映射的

如果您只查找XSD,只需提取该部分即可

<xs:schema targetNamespace="urn:sample/types" elementFormDefault="qualified"
           xmlns:tns="urn:sample/types">
    <xs:simpleType name="TSimpleEmail">
        <xs:restriction base="xs:token">
            <xs:pattern value="[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="TRequestInfo">
        <xs:sequence>
            <xs:element name="ReturnAddresses">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="Address" type="tns:TSimpleEmail"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>

        </xs:sequence>
        <xs:attribute name="Type" type="xs:token"/>
        <xs:attribute name="Id" type="xs:token"/>
    </xs:complexType>
    <xs:element name="RequestInfo" type="tns:TRequestInfo"/>
    <xs:element name="RequestData" type="xs:token"/>
</xs:schema>

使用soapUI生成的示例请求

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="urn:sample/types">
    <soapenv:Header>
        <typ:RequestInfo Type="?" Id="?">
            <typ:ReturnAddresses>
                <typ:Address>?</typ:Address>
            </typ:ReturnAddresses>
        </typ:RequestInfo>
    </soapenv:Header>
    <soapenv:Body>
        <typ:RequestData>?</typ:RequestData>
    </soapenv:Body>
</soapenv:Envelope>

?
?

到目前为止,您尝试了什么,您在做什么?通常,当绑定到soap时,您必须创建wsdl并将输入消息的部分映射到报头。部分引用xsd元素定义(jn文档样式)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="urn:sample/types">
    <soapenv:Header>
        <typ:RequestInfo Type="?" Id="?">
            <typ:ReturnAddresses>
                <typ:Address>?</typ:Address>
            </typ:ReturnAddresses>
        </typ:RequestInfo>
    </soapenv:Header>
    <soapenv:Body>
        <typ:RequestData>?</typ:RequestData>
    </soapenv:Body>
</soapenv:Envelope>