8 Replies Latest reply on Apr 25, 2007 1:04 PM by Mauricio Chui

    String[] with SOAP... Please help me!

    Mauricio Chui Newbie

      Hello there! I'm trying to develop a HelloWorld with JBossWS1.0.4, JBossAS4.0.5 and EJB3, but instead of returning a string "Hello World", I'd like to receive a String[]...

      If I don't create a wsdl, JBossAS autocreate a default file, where the String[] is mapped as a NMTOKENS type. I don't want that because my array [Hello World, Hello World] becomes [Hello, World, Hello, World]... So I used WStools for creating a wsdl. That's my wstools-config.xml:

      <configuration xmlns="http://www.jboss.org/jbossws-tools" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
      - <java-wsdl>
      <service name="HelloService" style="rpc" endpoint="interfaces.HelloSEI" />
      <namespaces target-namespace="http://interfaces/jaws" type-namespace="http://org.jboss.ws/samples/rpcstyle/types" />
      <mapping file="jaxrpc-mapping.xml" />
      <webservices servlet-link="HelloService" />
      </java-wsdl>
      </configuration>


      I found something similar on the userguide and I used interfaces/jaws because JBoss complained if I didn't. WStools generated the wsdl and the mapping xml. Here is the wsdl: http://www.linux.ime.usp.br/~chui/HelloService.wsdl

      However, isn't accepted when deploying the EJB, so I have to change that to HelloServicePort. And I don't know what I should write as <soap:address location> =/ Yeah, I'm newbie.

      This is the generated jaxrpc-mapping.xml:

      <?xml version="1.0" encoding="UTF-8" ?>
      - <java-wsdl-mapping version="1.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
      - <package-mapping>
      <package-type>interfaces</package-type>
      <namespaceURI>http://org.jboss.ws/samples/rpcstyle/types</namespaceURI>
      </package-mapping>
      - <service-interface-mapping>
      <service-interface>interfaces.HelloService</service-interface>
      <wsdl-service-name xmlns:serviceNS="http://interfaces/jaws">serviceNS:HelloService</wsdl-service-name>
      - <port-mapping>
      <port-name>HelloSEIPort</port-name>
      <java-port-name>HelloSEIPort</java-port-name>
      </port-mapping>
      </service-interface-mapping>
      - <service-endpoint-interface-mapping>
      <service-endpoint-interface>interfaces.HelloSEI</service-endpoint-interface>
      <wsdl-port-type xmlns:portTypeNS="http://interfaces/jaws">portTypeNS:HelloSEI</wsdl-port-type>
      <wsdl-binding xmlns:bindingNS="http://interfaces/jaws">bindingNS:HelloSEIBinding</wsdl-binding>
      - <service-endpoint-method-mapping>
      <java-method-name>hello</java-method-name>
      <wsdl-operation>hello</wsdl-operation>
      - <method-param-parts-mapping>
      <param-position>0</param-position>
      <param-type>java.lang.String</param-type>
      - <wsdl-message-mapping>
      <wsdl-message xmlns:wsdlMsgNS="http://interfaces/jaws">wsdlMsgNS:HelloSEI_hello</wsdl-message>
      <wsdl-message-part-name>String_1</wsdl-message-part-name>
      <parameter-mode>IN</parameter-mode>
      </wsdl-message-mapping>
      </method-param-parts-mapping>
      - <wsdl-return-value-mapping>
      <method-return-value>java.lang.String[]</method-return-value>
      <wsdl-message xmlns:wsdlMsgNS="http://interfaces/jaws">wsdlMsgNS:HelloSEI_helloResponse</wsdl-message>
      <wsdl-message-part-name>result</wsdl-message-part-name>
      </wsdl-return-value-mapping>
      </service-endpoint-method-mapping>
      </service-endpoint-interface-mapping>
      </java-wsdl-mapping>


      Finally I could deploy the bean. But, when I call it using a client application, I receive this error:

      java.rmi.RemoteException: Call invocation failed; nested exception is:
      org.jboss.ws.WSException: org.jboss.ws.binding.BindingException: org.jboss.ws.jbossxb.UnmarshalException: Failed to parse source: Not supported xsdType: anyType, hashCode=-842881210


      As you can see, I never used anyType. So I tried to find where's this term... And I found it here: http://www.w3.org/2001/XMLSchema.xsd

      Now I ask you:
      1-) Why do I need to use http://interfaces/jaws ??
      2-) How can I receive the String[]??? The bean is being called, but the client can't receive the result =(

      Please help me! I REALLY NEED this to function so I can apply it to my real (and also EJB3+WS) project...

      Thanks in advance.