2014-09-05 38 views
0

我試圖使用複製Web服務客戶端來檢索Linux服務器上的肥皂對象。但是我一直低於收到此錯誤跟蹤:WrapperBeanGenerator中的錯誤:未創建ASM類型的類型

java.lang.IllegalArgumentException: Not creating ASM Type for type = byte[] 
at     com.sun.xml.internal.ws.model.WrapperBeanGenerator.getASMType(WrapperBeanGenerator.java:434) 
at com.sun.xml.internal.ws.model.WrapperBeanGenerator.collectRequestWrapperMembers(WrapperBeanGenerator.java:297) 
at com.sun.xml.internal.ws.model.WrapperBeanGenerator.createRequestWrapperBean(WrapperBeanGenerator.java:239) 
at com.sun.xml.internal.ws.model.RuntimeModeler.getRequestWrapperClass(RuntimeModeler.java:279) 
at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:673) 
at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:611) 
at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:400) 
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:239) 
at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:710) 
at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:698) 
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330) 
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:313) 
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295) 
at javax.xml.ws.Service.getPort(Service.java:112) 
at actuals.com.microsoft.sharepoint.webservices.Copy.getCopySoap(Copy.java:56) 

並在下面的代碼正在運行:

public CopySoap getCopySoap() throws Exception { 
    System.out.println("Creating a CopySoap instance..."); 
    Copy service = new Copy(new URL("https://ts.kompany.com/sites/Global/_vti_bin/Copy.asmx?wsdl"), 
      new QName("http://schemas.microsoft.com/sharepoint/soap/", "Copy")); 
    CopySoap copySoap = service.getCopySoap(); 
    BindingProvider bp = (BindingProvider) copySoap; 
    bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, userName); 
    bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password); 
    bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://ts.kompany.com/sites/Global/_vti_bin/Copy.asmx"); 
    System.out.println(BindingProvider.USERNAME_PROPERTY.getBytes()+""+ BindingProvider.PASSWORD_PROPERTY.getBytes()); 
    return copySoap; 
} 

它未能就行了:

CopySoap copySoap = service.getCopySoap(); 

的CopySoap類如下:

package actuals.com.microsoft.sharepoint.webservices; 

import javax.jws.WebMethod; 
import javax.jws.WebParam; 
import javax.jws.WebService; 
import javax.xml.bind.annotation.XmlSeeAlso; 
import javax.xml.ws.Holder; 
import javax.xml.ws.RequestWrapper; 
import javax.xml.ws.ResponseWrapper; 


/** 
* This class was generated by the JAX-WS RI. 
* JAX-WS RI 2.1.6 in JDK 6 
* Generated source version: 2.1 
* 
*/ 
@WebService(name = "CopySoap", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
@XmlSeeAlso({ 
    ObjectFactory.class 
}) 
public interface CopySoap { 


    /** 
    * 
    * @param results 
    * @param copyIntoItemsLocalResult 
    * @param sourceUrl 
    * @param destinationUrls 
    */ 
    @WebMethod(operationName = "CopyIntoItemsLocal", action = "http://schemas.microsoft.com/sharepoint/soap/CopyIntoItemsLocal") 
    @RequestWrapper(localName = "CopyIntoItemsLocal", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", className = "com.microsoft.sharepoint.webservices.CopyIntoItemsLocal") 
    @ResponseWrapper(localName = "CopyIntoItemsLocalResponse", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", className = "com.microsoft.sharepoint.webservices.CopyIntoItemsLocalResponse") 
    public void copyIntoItemsLocal(
     @WebParam(name = "SourceUrl", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
     String sourceUrl, 
     @WebParam(name = "DestinationUrls", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
     DestinationUrlCollection destinationUrls, 
     @WebParam(name = "CopyIntoItemsLocalResult", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", mode = WebParam.Mode.OUT) 
     Holder<Long> copyIntoItemsLocalResult, 
     @WebParam(name = "Results", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", mode = WebParam.Mode.OUT) 
     Holder<CopyResultCollection> results); 

    /** 
    * 
    * @param stream 
    * @param results 
    * @param copyIntoItemsResult 
    * @param sourceUrl 
    * @param destinationUrls 
    * @param fields 
    */ 
    @WebMethod(operationName = "CopyIntoItems", action = "http://schemas.microsoft.com/sharepoint/soap/CopyIntoItems") 
    @RequestWrapper(localName = "CopyIntoItems", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", className = "com.microsoft.sharepoint.webservices.CopyIntoItems") 
    @ResponseWrapper(localName = "CopyIntoItemsResponse", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", className = "com.microsoft.sharepoint.webservices.CopyIntoItemsResponse") 
    public void copyIntoItems(
     @WebParam(name = "SourceUrl", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
     String sourceUrl, 
     @WebParam(name = "DestinationUrls", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
     DestinationUrlCollection destinationUrls, 
     @WebParam(name = "Fields", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
     FieldInformationCollection fields, 
     @WebParam(name = "Stream", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
     byte[] stream, 
     @WebParam(name = "CopyIntoItemsResult", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", mode = WebParam.Mode.OUT) 
     Holder<Long> copyIntoItemsResult, 
     @WebParam(name = "Results", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", mode = WebParam.Mode.OUT) 
     Holder<CopyResultCollection> results); 

    /** 
    * 
    * @param getItemResult 
    * @param stream 
    * @param url 
    * @param fields 
    */ 
    @WebMethod(operationName = "GetItem", action = "http://schemas.microsoft.com/sharepoint/soap/GetItem") 
    @RequestWrapper(localName = "GetItem", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", className = "com.microsoft.sharepoint.webservices.GetItem") 
    @ResponseWrapper(localName = "GetItemResponse", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", className = "com.microsoft.sharepoint.webservices.GetItemResponse") 
    public void getItem(
     @WebParam(name = "Url", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/") 
     String url, 
     @WebParam(name = "GetItemResult", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", mode = WebParam.Mode.OUT) 
     Holder<Long> getItemResult, 
     @WebParam(name = "Fields", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", mode = WebParam.Mode.OUT) 
     Holder<FieldInformationCollection> fields, 
     @WebParam(name = "Stream", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", mode = WebParam.Mode.OUT) 
     Holder<byte[]> stream); 

} 

我的代碼工作如果我在Windows 7的Eclipse中本地運行它,但在Linux服務器上運行它時,它會給我這個錯誤。有誰知道這意味着什麼,或者我該如何解決這個錯誤?

+0

你可以發佈WSDL和/或CopySoap類嗎? – 2014-09-05 15:34:54

+0

已將CopySoap類添加到原始帖子。 – MisterIbbs 2014-09-05 15:44:33

+0

我可以在copyIntoItems中看到帶有byte數組(byte []「Stream」)的參數,它不應該是持有者嗎?如果將它聲明爲xs:base64Binary還是什麼,您可以檢查WSDL嗎? – 2014-09-05 15:56:24

回答

0

的解決方案應該是切換到不同的Java版本的Linux機器上:

我有完全相同的問題(在Windows發民在Linux上,同樣的錯誤堆棧跟蹤7 /執行)。

在我的Linux服務器上,我使用的是「JDK 1.6.0_22-b04」,我發現似乎存在標準java庫「rt.jar」內部的錯誤。切換到「JDK 1.7.0_51-b03」後,它工作。