Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
24.3. Getting a Proxy for an Endpoint
Overview 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
A service proxy is an object that provides all of the methods exposed by a remote service and handles all of the details required to make the remote invocations. The
Service
object provides service proxies for all of the endpoints it is aware of through the getPort()
method. Once you have a service proxy, you can invoke its methods. The proxy forwards the invocation to the remote service endpoint using the connection details specified in the service's contract.
The getPort() method 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
The
getPort()
method, shown in Example 24.5, “The getPort()
Method”, returns a service proxy for the specified endpoint. The returned proxy is of the same class as the SEI.
Example 24.5. The getPort()
Method
public <T> T getPort(QName portName,
Class<T> serviceEndpointInterface)
throws WebServiceException;
The value of the
portName
parameter is a QName that identifies the wsdl:port
element that defines the endpoint for which the proxy is created. The value of the serviceEndpointInterface
parameter is the fully qualified name of the SEI.
Tip
When you are working without a WSDL contract the value of the
portName
parameter is typically the same as the value used for the portName
parameter when calling addPort()
.
Example 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
Example 24.6, “Getting a Service Proxy” shows code for getting a service proxy for the endpoint added in Example 24.4, “Adding a Port to a
Service
Object”.
Example 24.6. Getting a Service Proxy