Hello,
1) i want to access the KM on our Portal (NW 7.0) from my EJBs (NW 7.1 CE). Does KM only expose Web-Services to achieve this or are there also Java-Beans with Remote-Interfaces available so that i can use KM more directly.
2) I'm testing the KM-WS (Repository-Manager). I successfully downloaded files from a repository using that Web-Service. Now i want to use the service to create a document. But that Method expects parameters, which are not bound to Java-Objects directly. Instead the parameters are objects and that objects have getter and setter-Methods which only support JAXBElements. I now don't know how to handle that parameters.
So my method looks like this:
FObject is my own independent Definition of a document.
public FObject putFileData (FObject nFObject, String username, String password) { System.err.println("Start putFileData"); FObject tFObject = nFObject; try { URL wsdlLocation = new URL("http://myportalhost:50000/RepositoryFrameworkWS/Config1?wsdl"); RepositoryFrameworkWS rf = new RepositoryFrameworkWS(wsdlLocation, new QName("urn:RepositoryFrameworkWSWsd","RepositoryFrameworkWS")); // RepositoryFrameworkWS rf = new RepositoryFrameworkWS(); RepositoryFrameworkWSViDocument vi = rf.getConfig1Port_Document(); ((BindingProvider)vi).getRequestContext().put(BindingProvider.USERNAME_PROPERTY , username); ((BindingProvider)vi).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY , password); Content nContent = new Content(); JAXBElement<byte[]> md = new JAXBElement<byte[]>(new QName("urn:com.sap.netweaver.bc.rf.ws.content"),byte[].class,nFObject.getFContent()); nContent.setContent(md); ContentMetadata nContentMetadata = new ContentMetadata(); nContentMetadata.setLength(nFObject.getFContent().length); JAXBElement<ContentMetadata> cmd = new JAXBElement<ContentMetadata> (new QName("urn:com.sap.netweaver.bc.rf.ws.content"),ContentMetadata.class, nContentMetadata); nContent.setMetadata(cmd); // JAXBElement<byte[]> be = nContent.getContent(); Resource nkmdoc = vi.createDocument(tFObject.getFPid(), tFObject.getFName(), new OrderPosition(), true, new LockDescriptor(), new ArrayOfProperty(), nContent, new FetchGroup()); if (nkmdoc != null) { tFObject.setFFlag(FObject.OK); System.err.println("Return OK"); } else { tFObject.setFFlag(FObject.UNKNOWN); System.err.println("nkmdoc = Null"); } } catch (Exception ex) { ex.printStackTrace(); } return tFObject; }
Any ideas whats wrong here because running that code causes following exception:
javax.xml.ws.soap.SOAPFaultException: Deserializing fails. Nested message: XML Deserialization Error. XML Parser has thrown exception while parsing input. See nested exception..
Any ideas would be greatly welcome,
thanx in advance
regards
Matthias
Edited by: Matthias Hayk on Dec 3, 2008 11:52 AM