亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Oracle App Client use Mtom

系統(tǒng) 2203 0

MTOM interoperability between Oracle App Server and Sun WSIT

A few months ago I wrote a couple of articles ( WCF-ORA , ORA-WCF ) about Message Transmission Optimization Mechanism (MTOM) interoperability between Oracle Application Server and Microsoft Windows Communication Foundation (WCF).? Most of the feedback I got from those posts was related with MTOM interoperability scenarios using other Web Service technologies toolkits. Based on that, I decided to post a few more demos that reflect MTOM interoperability scenarios for different vendors. Specifically, this paper shows how to achieve MTOM interoperability between Oracle App Server and Sun Web Service Interoperability Technology (WSIT - Project Tango).? Believe it or not, I am sorry .NET developers; there is no .NET code in this paper.

This post does not intend to provide a formal introduction to MTOM. Suffice to say that after a few years and three predecessors' specifications, MTOM has become the preferred Standard for SOAP-encoded binary messaging optimization. MTOM relies on the XML Optimized Processing (XOP) Standard as the serialization mechanism to represent binary data as a MIME/Multipart Related package. If you are interested in the importance of MTOM interoperability you might want to read my previous paper or this post by John Evdemon .

Sun WSIT and MTOM

WSIT is part of Project Metro which is the Web Services stack from Sun Microsystems. Specifically, WSIT is the component of Project Metro that implements some of the most important WS-* protocols emphasizing in interoperability with Microsoft WCF. Needless to say, that WSIT also interoperates really well with other Web Services technologies including Oracle App Server. At the moment WSIT implements some of the most important WS-* protocols for areas such as Security, Reliability, Transactions and messaging optimization (a.k.a MTOM). The typical scenarios for applying MTOM are Web Services that handles binary data like byte[] as part of their contract. The following code illustrates a WSIT Service that can be highly optimized with the use of MTOM.

@WebService()
public class FileWS {

@WebMethod(action="PrintFileContents")
public int PrintFileContents(byte[] buffer)
{
for(int i=0; i<= buffer.length - 1; i++)
System.out.println(buffer[i]);
return buffer.length;
}
}

?Now we need to configure the service policy in order to optimize the message exchange using MTOM.? The trick here, in order to achieve interoperability with Oracle App Server, is to remove the default WSIT WS-Addressing settings. This is due to the fact that Oracle App Server and Sun WSIT implement different versions of WS-Addressing. The change is not required if the client side supports MTOM with WS-Addressing 1.0 like WCF does. Also, If you are using a development IDE such as NetBeans there is no need to manually configure the policy except for removing the use of WS-Addressing; instead you can the Web Service configuration editor which provides a nice interface for configuring the different WS-* protocols for a particular service.

<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="FileWSService" targetNamespace="http://mtomws/" xmlns:tns="http://mtomws/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsaws="http://www.w3.org/2005/08/addressing" xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"
>
WSDL components....
<wsp:Policy wsu:Id="FileWSPortBindingPolicy">
<wsp:ExactlyOne>
<wsp:All>
<!-- <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl"/>-->
<wsoma:OptimizedMimeSerialization/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</definitions>

Now we are ready to deploy the service, for the purposes of this demo we used Sun Glassfish.

Oracle App Server and MTOM

Now it's time to implement an Oracle client for the WSIT service created on the previous section. The first natural step is to generate the proxy using the Web Service Proxy Wizard included in JDeveloper or the corresponding command-line tool. In order to interface with WCF using MTOM, the client code should set the MTOM_SUPPORT property to "True" either programmatically or using the configuration file. The following code shows a sample client that interacts with the WCF service created in the previous section

public static void Test()
{
try
{
FileTransmitter transmitter= new FileTransmitter();
byte[] buffer= transmitter.GetImg("c:\\temp\\images\\p1.jpg");
FileWSPortClient binding= new FileWSPortClient();
FileWS proxy= binding.getPort();
((OracleStub)proxy)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, service url);
((OracleStub)proxy)._setProperty(ClientConstants.MTOM_SUPPORT, true);
int result= proxy.printFileContents(buffer);
System.out.println(result);
}
catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}

? Messages Messages

After hosting the WSIT service in Sun Glassfish and running the Oracle client the following message sequence is produced

POST /MtomServices/FileWSService HTTP/1.1
Host: localhost:8082
Connection: Keep-Alive, TE
TE: trailers, deflate, gzip, compress
User-Agent: Oracle HTTPClient Version 10h
SOAPAction: "PrintFileContents"
Accept-Encoding: gzip, x-gzip, compress, x-compress
Content-type: multipart/related;type="application/xop+xml";boundary="----=_Part_0_13050435.1185038715262";start="<97b2fe36f9184df3a6fa8792abd9a00c>";start-info="text/xml;charset=UTF-8"
Content-length: 12849


------=_Part_0_13050435.1185038715262
Content-Type: application/xop+xml;charset=UTF-8;type="text/xml;charset=UTF-8"
Content-Transfer-Encoding: 8bit
Content-ID: <97b2fe36f9184df3a6fa8792abd9a00c>

<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="http://mtomws/"><env:Body><ns0:PrintFileContents><arg0> <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:b9abc481c3664db8b0b7f842d0886c30"/> </arg0></ns0:PrintFileContents></env:Body></env:Envelope>
------=_Part_0_13050435.1185038715262
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Id: <b9abc481c3664db8b0b7f842d0886c30>

? SOAP request produced by the Oracle client

Content-Id: <rootpart*74f72fe4-510e-48de-a29a-38896f03901d@example.jaxws.sun.com>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary


<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:PrintFileContentsResponse xmlns:ns2="http://mtomws/"><return>12000</return></ns2:PrintFileContentsResponse></S:Body></S:Envelope>

SOAP response produced by the Sun WSIT service

You can notice that the byte[] in the request message its been optimized using MTOM and XOP.

In the next weeks I will be posting more demos about WS-* protocols interoperability between some of the top Web Services technologies in the market.

Published Friday, July 27, 2007 9:55 AM by gsusx

Oracle App Client use Mtom


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产一区二区三区欧美 | 亚洲综合五月天 | 黄视频网站免费看 | 亚洲精品久久玖玖玖玖 | 国产日韩高清一区二区三区 | 国产精品成人一区二区1 | 777奇米影视久久激情日韩欧美 | 亚洲精品综合一二三区在线 | 国产真实自拍 | 狠狠躁天天躁夜夜躁婷婷 | 欧美性猛交99久久久久99 | 呦女亚洲一区精品 | 国内精品久久久久影院亚洲 | 亚洲综合图片区 | 99久久日本一区二区波多野结衣 | 亚洲在线中文 | 免费福利视频在线观看 | 亚洲人成绝费网站色ww | 国产首页精品 | 国产成人亚洲综合欧美一部 | 亚洲国产欧洲综合997久久 | 久久亚洲精品中文字幕二区 | 国产亚洲精品久久久久久小说 | 最新国产精品好看的国产精品 | 日本xxx高清免费视频 | 欧美成人久久一级c片免费 欧美成人剧情中文字幕 | 97影院理论在线观看 | 亚洲国产香蕉视频欧美 | 亚洲国产欧美自拍 | 天天操夜夜 | 99精品免费 | 国产美女激情 | 91久久亚洲国产成人精品性色 | 毛片免费看 | 国产精品女仆装在线播放 | 欧美一级毛片免费高清的 | 久久免费播放 | 久久天天操 | 色综合久久九月婷婷色综合 | 神马影院888不卡院 神马影院不卡不卡在线观看 | 特级毛片www欧美 |