2
回答
java 调用SAP PI Webservice
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

各位大神有知道,java怎么调用SAP PI Webservice的吗?

浏览器访问的时候,要输入用户名跟密码。 我先通过url读取wsdl文件,然后获取webservice接口对象,最后调用其方法。但是报错。也不知道是否是这样调用的。在线求答。

       String patch  = Thread.currentThread().getContextClassLoader().getResource("").getPath() ;
       URL url = new URL("file:"+patch+"/os_MemberTransaction_Update_Third_partyService.wsdl");

       BindingProvider bp = (BindingProvider) port;  
        bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY,"pisuper");  
        bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "wenjian2015");  
        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
               "http://172.16.0.95:50000/dir/wsdl?p=ic/6e425b75a9923363b39afab7d2f86d7c"); 

举报
ldguo
发帖于2年前 2回/2K+阅
错误信息如下:Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 405: Method Not Allowed
    at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.checkResponseCode(Unknown Source)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
    at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
    at $Proxy27.osMemberTransactionUpdateThirdParty(Unknown Source)
    at com.winnermedical.pi.esb_i_crm.update.Demo_Client.main(Demo_Client.java:57)
顶部