开发者社区> 问答> 正文

java 调用SAP PI Webservice?报错

各位大神有知道,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"); 

展开
收起
爱吃鱼的程序员 2020-06-14 14:46:40 1036 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    错误信息如下:Exceptioninthread"main"com.sun.xml.internal.ws.client.ClientTransportException:TheserversentHTTPstatuscode405:MethodNotAllowed
       atcom.sun.xml.internal.ws.transport.http.client.HttpClientTransport.checkResponseCode(UnknownSource)
       atcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(UnknownSource)
       atcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(UnknownSource)
       atcom.sun.xml.internal.ws.api.pipe.Fiber.__doRun(UnknownSource)
       atcom.sun.xml.internal.ws.api.pipe.Fiber._doRun(UnknownSource)
       atcom.sun.xml.internal.ws.api.pipe.Fiber.doRun(UnknownSource)
       atcom.sun.xml.internal.ws.api.pipe.Fiber.runSync(UnknownSource)
       atcom.sun.xml.internal.ws.client.Stub.process(UnknownSource)
       atcom.sun.xml.internal.ws.client.sei.SEIStub.doProcess(UnknownSource)
       atcom.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(UnknownSource)
       atcom.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(UnknownSource)
       atcom.sun.xml.internal.ws.client.sei.SEIStub.invoke(UnknownSource)
       at$Proxy27.osMemberTransactionUpdateThirdParty(UnknownSource)
       atcom.winnermedical.pi.esb_i_crm.update.Demo_Client.main(Demo_Client.java:57)

    朋友,后来这个问题解决了吗

    2020-06-14 14:46:56
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载