1

WSO2 esb で外部 wsdl 用に 1 つの wsdl プロキシを構成しました。プロキシが正常に作成されました。プロキシの作成中に、[同じサービス コントラクトを発行する] チェック ボックスを選択していません。外部 Web サービスを使用している場合、チェックは必須ですか? [試してみる] をクリックすると、wsdl で使用できる操作が表示されません。

上記の問題がすべて解決された場合は、Java プロジェクトからプロキシにアクセスする必要があります。Java プログラムで WSO2 ESB プロキシにアクセスするにはどうすればよいですか?

前もって感謝します。

ありがとう、ラグー

4

2 に答える 2

0

このようにしてみてください:

    CentralUuidService service = new CentralUuidService(new URL("http://wls02.tigeritbd.com:8280/services/CentralUuidService?wsdl"),new QName("http://bean.service.uuid.gov.bd/", "CentralUuidService"));

    GetBirthPlaceServiceResponse response = service.getCentralUuidServiceHttpSoap11Endpoint().getBirthPlace(request);        
    if(response != null) {
        System.out.println("Operation status is:"+response.isOperationStatus());
    }
}
于 2015-09-16T10:38:39.433 に答える
0

はい、同じ WSDL を公開する場合は、[同じサービス コントラクトを公開する] をオンにする必要があります。

Java コードでは、以下に示すような単純な axis2 クライアントを作成できます。プロキシの enxpoint へ。

   public OMElement sendReceive(OMElement payload, String endPointReference, String operation)
            throws AxisFault {
        ServiceClient sender;
        Options options;
        OMElement response = null;

        try {
            sender = new ServiceClient();
            options = new Options();
            options.setTo(new EndpointReference(endPointReference));
            options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
            options.setTimeOutInMilliSeconds(45000);
            options.setAction("urn:" + operation);
            sender.setOptions(options);

            response = sender.sendReceive(payload);

        } catch (AxisFault axisFault) {
            throw new AxisFault("AxisFault while getting response :" + axisFault.getMessage(), axisFault);
        }
        Assert.assertNotNull(response);
        return response;
    }

SOAP UI のようなツールを結び付けることで、サンプル ペイロードを取得できます。

ありがとう、ダルシャナ。

于 2013-03-18T10:05:27.367 に答える