File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes SOA and ESB and the fly likes How to call OSB Proxy from Java and C# Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » SOA and ESB
Bookmark "How to call OSB Proxy from Java and C#" Watch "How to call OSB Proxy from Java and C#" New topic
Author

How to call OSB Proxy from Java and C#

Deme Carva
Greenhorn

Joined: Nov 01, 2012
Posts: 3
I need examples for both situation: how invoke OSB Proxy from Java Client and how invoke from C# Client. I am looking for simple examples and advanced best practices as well.
Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

Deme Carva wrote:I need examples for both situation: how invoke OSB Proxy from Java Client and how invoke from C# Client. I am looking for simple examples and advanced best practices as well.


You write your Web Service client just as you would for any other application. You define your proxy thusly :

http://docs.oracle.com/cd/E21764_01/doc.1111/e15867/configuringandusingservices.htm#i1148910

36.5.1.4 Examples of Proxy Services Based on a Port and on a Binding

Example 36-12 shows fragments of port and binding definitions in a WSDL resource.

Example 36-12 WSDL resource

<portType name="StockQuotePortType">
...
</portType>
<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
...
</binding>
<service name="StockQuoteService">
<port name="StockQuotePort" binding="tns:StockQuoteSoapBinding">
<soap:address location="http://example.com:9999/stockquote"/>
</port>
<port name="StockQuotePortUK" binding="tns:StockQuoteSoapBinding">
<soap:address location="http://example.uk:9999/stockquote"/>
</port>
</service>
36.5.1.4.1 Basing the Service on a Port
If you create a proxy service based on the StockQuotePort port in Example 36-12, the effective WSDL will look something like the fragment in Example 36-13.

Example 36-13 Effective WSDL for a Proxy Service Based on a Port

<binding name="StockQuoteSoapBinding" type="ns:StockQuotePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
...
</binding>
<service name="StockQuoteService">
<port name="StockQuotePort" binding="ns:StockQuoteSoapBinding">
<soap:address location="http://host:port/project/proxyname"/>
</port>
</service>
Notice the following about the above example:

The service name, StockQuoteService, is the same in both the template and the effective WSDL.

The binding is the same in both the template and the effective WSDL. In this example, it specifies that the service will use the HTTP transport protocol for SOAP document style messages. (The binding also specifies the same binding operation in both the template and the effective WSDL, but that is not shown in this example.)

The second port defined in the WSDL resource, StockQuotePortUK, is not defined in the effective WSDL.

The transport address (URI) defined in the WSDL resource's port, http://example.com:9999/stockquote, is different from the address generated in the effective WSDL's port, http://host:port/project_path/proxy_service_name. The effective WSDL uses the address specified for the transport configuration in the Oracle Service Bus Administration Console or Eclipse with Oracle Service Bus plug-ins.

36.5.1.4.2 Basing the Service on a Binding
If you create a proxy service based on the StockQuoteBinding binding in Example 36-12, the effective WSDL will look something like the fragment in Example 36-14.

Example 36-14 Effective WSDL for a Proxy Service Based on a Binding

<binding name="StockQuoteSoapBinding" type="ns:StockQuotePortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
...
</binding>
<wsdl:service name="StockQuoteSoapBindingQSService"
<wsdl:port name="StockQuoteSoapBindingQSPort"
binding="ns:StockQuoteSoapBinding">
<soap:address location="http:/host:port/project/proxyname"/>
</wsdl:port>
</wsdl:service>
Notice the following about the above example:

The service and the port in the WSDL resource are different from the service and the port generated in the effective WSDL.

The service name in the WSDL resource and the effective WSDL are different: StockQuoteService in the template and StockQuoteSoapBindingQSService in the effective WSDL.

The binding is the same in both the WSDL resource and effective WSDL. In this example, it specifies that the service will use the HTTP transport protocol for SOAP document style messages.

The binding also specifies the same binding operation in both the template and the effective WSDL, but that is not shown in this example.

The transport address (URI) defined in the WSDL resource's port, http://example.com:9999/stockquote, is different from the address generated in the effective WSDL's port, http://host:port/project/stockquote.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call OSB Proxy from Java and C#