From: Jong K. <jk...@no...> - 2010-03-16 17:55:43
|
The specific web service operation you're using - binder_uploadFile and/or folder_uploadFile - requires you to attach the content of the file to the SOAP payload as a MIME attachment. The web services operation will not do that for you automatically. If you haven't done that, I think that explains the error you're getting. An easier alternative might be for you to use instead binder_uploadFileAsByteArray or folder_uploadFileAsByteArray operation. With this operation, your program still has to read the content of the file into a byte array and send it as a parameter to the operation. Although it is still a work you have to code up, it might be easier to deal with than working with MIME attachment. It is up to you. /Jong >>> On 3/16/2010 at 12:42 PM, in message <4B9...@ma...>, "Leo Eraly" <le...@nw...> wrote: Hi, I'm writing a small application (in PHP) to upload files to a workspace/folder. Code: $client = new SoapClient("http://teaming.host:8080/ssr/secure/ws/TeamingServiceV1?wsdl", array( 'login' => "admin",'password' => "securepass")); $client->binder_uploadFile(null , 99 , 'picture' , 'picture.jpg'); I'm pretty sure the bindID is correct, whatever id I specify I always get the ArrayIndexOutOfBoundsException. According to the docs/wsdl one should be able to use either the binder_uploadFile or folder_uploadFile function however when I try this I always get a PHP Fatal error: Uncaught SoapFault exception: [soapenv:Server.userException] java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0 in /home/leo/devel/soap.php:29 Stack trace: #0 [internal function]: SoapClient->__call('binder_uploadFi...', Array) #1 /home/leo/devel/soap.php(29): SoapClient->binder_uploadFile(NULL, 99, 'picture', 'picture.jpg') #2 {main} thrown in /home/leo/devel/soap.php on line 29 On the server I see: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0 at org.kablink.teaming.remoting.ws.util.attachments.AttachmentsHelper.getFileAttachment(AttachmentsHelper.java:163) at org.kablink.teaming.remoting.ws.service.binder.attachments.BinderServiceImpl.binder_uploadFile(BinderServiceImpl.java:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.kablink.teaming.remoting.ws.interceptor.LoginInfoInterceptor.invoke(LoginInfoInterceptor.java:74) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.kablink.teaming.remoting.ws.interceptor.LogContextInfoUponExceptionInterceptor.invoke(LogContextInfoUponExceptionInterceptor.java:48) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.kablink.teaming.util.aopalliance.ResolveRequestContextInterceptor.invoke(ResolveRequestContextInterceptor.java:49) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.kablink.teaming.util.aopalliance.OpenSessionInViewInterceptor.invoke(OpenSessionInViewInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.kablink.teaming.remoting.ws.interceptor.AccessTokenValidationInterceptor.invoke(AccessTokenValidationInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.kablink.teaming.util.aopalliance.LoggingInterceptor.invoke(LoggingInterceptor.java:46) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy33.binder_uploadFile(Unknown Source) at org.kablink.teaming.remoting.ws.TeamingServiceEndpoint.binder_uploadFile(TeamingServiceEndpoint.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at org.kablink.teaming.remoting.ws.servlet.SecurityPropagatingAxisServlet.service(SecurityPropagatingAxisServlet.java:132) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.kablink.teaming.asmodule.servlet.SSFClassLoaderServlet.service(SSFClassLoaderServlet.java:72) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378) at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:52) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.kablink.teaming.tomcat.valve.ZoneContextValve.invoke(ZoneContextValve.java:67) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:811) Any input is appreciated. Kind regards, ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ kablink-teaming-dev mailing list kab...@li... https://lists.sourceforge.net/lists/listinfo/kablink-teaming-dev |