我有肥皂專案,這適用于 xsd 檔案。但我不知道如何使用肥皂。我如何像物件一樣使用 xsd 檔案?我需要的是,從資料庫中獲取一些資料,將值設定為物件,映射到 xsd 檔案并使用 xsd 檔案正文 XSD 發送到請求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xro="http://x-road.eu/xsd/xroad.xsd"
xmlns:iden="http://xroad.eu/xsd/identifiers"
xmlns:erec="http://testrecord_service.x-road.ee/testrecord">
<soapenv:Header>
<xro:protocolVersion>4.0</xro:protocolVersion>
<xro:issue>123</xro:issue>
<xro:id>123</xro:id>
<xro:userId>123</xro:userId>
<xro:service iden:objectType="SERVICE">
<iden:xRoadInstance>central-server</iden:xRoadInstance>
<iden:memberClass>test</iden:memberClass>
<iden:memberCode>test coed</iden:memberCode>
<!--Optional:-->
<iden:subsystemCode>test-service</iden:subsystemCode>
<iden:serviceCode>testrecord</iden:serviceCode>
<!--Optional:-->
<iden:serviceVersion>v1</iden:serviceVersion>
</xro:service>
<xro:client iden:objectType="SUBSYSTEM">
<iden:xRoadInstance>test-server</iden:xRoadInstance>
<iden:memberClass>test</iden:memberClass>
<iden:memberCode>testcode</iden:memberCode>
<!--Optional:-->
<iden:subsystemCode>test-service</iden:subsystemCode>
</xro:client>
</soapenv:Header>
<soapenv:Body>
<erec:Authentication>
<erec:companyIdentifier>cc93a8c3-465d-4813-a442-
69539692e0a1</erec:companyIdentifier>
<erec:pin>12345</erec:pin>
</erec:Authentication>
</soapenv:Body>
</soapenv:Envelope>
uj5u.com熱心網友回復:
哦..我看到xroad :)。使用 maven-jaxb2-plugin 從 xsd 生成 pojo 模型。從資料庫中抓取資料,將其映射到之前生成的 pojo 并傳遞給 ws 客戶端
請注意,xroad 的某些 xsd 模式是不夠的。
您最好從您的問題中隱藏身份驗證詳細資訊。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/476302.html
上一篇:使用xml.dom.minidom獲取標簽的屬性串列?
下一篇:如何洗掉多余的標簽?