久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <small id='PEivO'></small><noframes id='PEivO'>

    1. <i id='PEivO'><tr id='PEivO'><dt id='PEivO'><q id='PEivO'><span id='PEivO'><b id='PEivO'><form id='PEivO'><ins id='PEivO'></ins><ul id='PEivO'></ul><sub id='PEivO'></sub></form><legend id='PEivO'></legend><bdo id='PEivO'><pre id='PEivO'><center id='PEivO'></center></pre></bdo></b><th id='PEivO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PEivO'><tfoot id='PEivO'></tfoot><dl id='PEivO'><fieldset id='PEivO'></fieldset></dl></div>
      <tfoot id='PEivO'></tfoot>

      1. <legend id='PEivO'><style id='PEivO'><dir id='PEivO'><q id='PEivO'></q></dir></style></legend>
        • <bdo id='PEivO'></bdo><ul id='PEivO'></ul>

        使用名稱空間和前綴解組 JAXB

        JAXB unmarshall with namespaces and prefix(使用名稱空間和前綴解組 JAXB)
              <tbody id='1DPa8'></tbody>
          • <i id='1DPa8'><tr id='1DPa8'><dt id='1DPa8'><q id='1DPa8'><span id='1DPa8'><b id='1DPa8'><form id='1DPa8'><ins id='1DPa8'></ins><ul id='1DPa8'></ul><sub id='1DPa8'></sub></form><legend id='1DPa8'></legend><bdo id='1DPa8'><pre id='1DPa8'><center id='1DPa8'></center></pre></bdo></b><th id='1DPa8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1DPa8'><tfoot id='1DPa8'></tfoot><dl id='1DPa8'><fieldset id='1DPa8'></fieldset></dl></div>

            • <bdo id='1DPa8'></bdo><ul id='1DPa8'></ul>

                <small id='1DPa8'></small><noframes id='1DPa8'>

                • <tfoot id='1DPa8'></tfoot>
                  <legend id='1DPa8'><style id='1DPa8'><dir id='1DPa8'><q id='1DPa8'></q></dir></style></legend>
                  本文介紹了使用名稱空間和前綴解組 JAXB的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 JAXB 從 SOAP 響應中解析 xml 元素.我已經為 xml 元素定義了 POJO 類.我已經測試了沒有命名空間的 pojo 類,并且前綴它的工作正常.雖然當我嘗試使用命名空間和前綴解析時遇到以下異常.要求是解析來自 SOAPMessage 對象的輸入

                  I am using JAXB to parse xml elements from the SOAP response. I have defined POJO classes for the xml elements. I have tested pojo classes without namespace and prefix its working fine .Though when i am trying to parse with namespaces and prefix facing the following exception.Requirement is to parse the input from SOAPMessage Object

                  javax.xml.bind.UnmarshalException:意外元素(uri:http://schemas.xmlsoap.org/soap/envelope/",本地:信封").預期的元素是 <{}Envelope>

                  嘗試通過為 package-info.java 中的包創建 @XMLSchema 并將此文件定位在包文件夾中來修復.有人可以指導我繼續前進嗎?

                  Tried to fix by creating @XMLSchema for the package in package-info.java and located this file in package folder.Can any one guide me to move forward?

                  推薦這篇文章但對我沒有幫助.

                  Referred this posts but didn help me .

                  已XMLSchema

                  @javax.xml.bind.annotation.XmlSchema (
                      xmlns = {  @javax.xml.bind.annotation.XmlNs(prefix = "env", 
                                   namespaceURI="http://schemas.xmlsoap.org/soap/envelope/"),
                        @javax.xml.bind.annotation.XmlNs(prefix="ns3", namespaceURI="http://www.xxxx.com/ncp/oomr/dto/")
                      }
                    )
                  package com.one.two;
                  

                  提前致謝

                  推薦答案

                  這可以在不使用標準 SOAPMessage 類修改生成的 JAXB 代碼的情況下完成.我寫了關于這個 here 和 這里

                  This can be done without modifying the generated JAXB code using standard SOAPMessage class. I wrote about this here and here

                  這有點繁瑣,但可以正常工作.

                  It's a little fiddly but works correctly.

                  Farm farm = new Farm();
                  farm.getHorse().add(new Horse());
                  farm.getHorse().get(0).setName("glue factory");
                  farm.getHorse().get(0).setHeight(BigInteger.valueOf(123));
                  
                  Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
                  Marshaller marshaller = JAXBContext.newInstance(Farm.class).createMarshaller();
                  marshaller.marshal(farm, document);
                  SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
                  soapMessage.getSOAPBody().addDocument(document);
                  ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                  soapMessage.writeTo(outputStream);
                  String output = new String(outputStream.toByteArray());
                  

                  解組

                  String example =
                          "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header /><soapenv:Body><ns2:farm xmlns:ns2="http://adamish.com/example/farm"><horse height="123" name="glue factory"/></ns2:farm></soapenv:Body></soapenv:Envelope>";
                  SOAPMessage message = MessageFactory.newInstance().createMessage(null,
                          new ByteArrayInputStream(example.getBytes()));
                  Unmarshaller unmarshaller = JAXBContext.newInstance(Farm.class).createUnmarshaller();
                  Farm farm = (Farm)unmarshaller.unmarshal(message.getSOAPBody().extractContentAsDocument());
                  

                  這篇關于使用名稱空間和前綴解組 JAXB的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數轉換為整數?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)
                  <tfoot id='uerky'></tfoot>

                        <bdo id='uerky'></bdo><ul id='uerky'></ul>
                          <tbody id='uerky'></tbody>
                      • <small id='uerky'></small><noframes id='uerky'>

                            <i id='uerky'><tr id='uerky'><dt id='uerky'><q id='uerky'><span id='uerky'><b id='uerky'><form id='uerky'><ins id='uerky'></ins><ul id='uerky'></ul><sub id='uerky'></sub></form><legend id='uerky'></legend><bdo id='uerky'><pre id='uerky'><center id='uerky'></center></pre></bdo></b><th id='uerky'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uerky'><tfoot id='uerky'></tfoot><dl id='uerky'><fieldset id='uerky'></fieldset></dl></div>
                          • <legend id='uerky'><style id='uerky'><dir id='uerky'><q id='uerky'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 国产精品激情在线 | 91精品在线播放 | 亚洲高清av在线 | 国产高清一区二区三区 | 污污的网站在线观看 | 密桃av| 日韩国产欧美一区 | 国产黄色网 | 亚洲不卡一 | 亚洲精品在线播放 | 在线免费观看视频你懂的 | 色婷婷综合久久久中字幕精品久久 | 亚洲精品久久久久久久久久久久久 | 亚洲精品1区 | 久久久久国产一区二区三区四区 | 日韩成年人视频在线 | 一区二区三区中文字幕 | 亚洲精品一区二区三区蜜桃久 | 午夜看看| 成人不卡| 欧美黑人体内she精在线观看 | 国产日本精品视频 | 一区在线视频 | 91玖玖 | 亚洲精品久久久久久久久久久 | 污视频免费在线观看 | 久久久久久91 | 欧美色综合 | 一区二区在线不卡 | 一区二区在线不卡 | 91精品久久 | 成人欧美一区二区三区黑人孕妇 | 欧美精品一区二区在线观看 | 日韩精品福利 | 久久久精品网站 | 超碰最新在线 | 日韩在线欧美 | 男女污污网站 | 国产日日操 | 国产精品精品视频一区二区三区 | 可以在线看的黄色网址 |