[jbossws-users] [JBossWS] - Web Service and Arrays

HowardU do-not-reply at jboss.com
Fri Oct 20 17:40:40 EDT 2006


I am having a problem with arrays of objects in my web service interface.  
Is there a way to get arrays of objects to work with the wstools?

I am getting the following stack trace when I try to call my web service. 

[java] org.jboss.ws.WSException: Cannot load java type: com.dynaccsys.soa.wsdl.InvoiceType.Array
[java]     at org.jboss.ws.metadata.ParameterMetaData.getJavaType(ParameterMetaData.java:141)
[java]     at org.jboss.ws.metadata.ParameterMetaData.eagerInitialize(ParameterMetaData.java:291)
[java]     at org.jboss.ws.metadata.OperationMetaData.eagerInitialize(OperationMetaData.java:476)
[java]     at org.jboss.ws.metadata.EndpointMetaData.eagerInitialize(EndpointMetaData.java:351)
[java]     at org.jboss.ws.metadata.ServiceMetaData.eagerInitialize(ServiceMetaData.java:397)
[java]     at org.jboss.ws.metadata.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:147)
[java]     at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:129)
[java]     at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
[java]     at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
[java]     at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
[java]     at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:142)
[java]     at com.dynaccsys.soa.WebServiceClient.setUp(WebServiceClient.java:37)
[java]     at com.dynaccsys.soa.WebServiceClient.main(WebServiceClient.java:46)

Here's my web service client:

public class WebServiceClient
{
   public final String TARGET_ENDPOINT_ADDRESS = "http://localhost:8080/soaDemo/Finaince_LoBService";

   private static ContractorInvoice_ContractorInvoice port;

   protected void setUp() throws Exception
   {
            ServiceFactoryImpl factory = new ServiceFactoryImpl();
            URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
            URL mappingURL = new File("gen/jaxrpc-mapping.xml").toURL();
            QName qname = new QName("http://gov.osera.bpel", "Finaince_LoBService");
            Service service = factory.createService(wsdlURL, qname, mappingURL);
            port = (ContractorInvoice_ContractorInvoice)service.getPort(ContractorInvoice_ContractorInvoice.class);
   }

   public static void main(String[] args)
   {
	   try
	   {
		  WebServiceClient webServiceClient = new WebServiceClient();
		  webServiceClient.setUp();
		  InvoiceType[] invoices = new InvoiceType[1];
		  String correlationId = "0";
		  port.invoices(invoices,correlationId);
   	   }
   catch (Exception ex)
	   {
		   ex.printStackTrace();
	   }
	}

I have a wsdl file that is being used to generate all of my java classes using wstools wsdl-java

The wsdl includes the following complex type:  
  <xsd:complexType name="InvoicesType">
    <xsd:sequence>
      <xsd:element minOccurs="0" maxOccurs="unbounded" name="invoice" type="invoice:InvoiceType"/>
    </xsd:sequence>
  </xsd:complexType>

This type is being used in the service parameters to generate the following method:
public interface  ContractorInvoice_ContractorInvoice extends java.rmi.Remote
{

  public void   invoices(com.dynaccsys.soa.wsdl.InvoiceType[] invoices,java.lang.String correlationId) throws  java.rmi.RemoteException;
}


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979744#3979744

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979744



More information about the jbossws-users mailing list