Hello
Jboss: 4.0.5 GA
You can skip following info and look directly on description and code.
I'm rather new to WS. I decided to create my WebService using Stateless Session Bean,
but i was getting errors. Thats why i decided to deply an example, and then modify it.
Example is attached to book: JBoss 4.0 the Official Guide.
The example service is quite simple. The operation accepts one argument: String, and
returns String. I decided to change operation in order to make it accept Object. But I
have failed, look at that:
description and code
Exception stack trace:
anonymous wrote : 12:46:56,093 ERROR [MainDeployer] Could not create deployment:
file:/C:/Tutorial/jboss-4.0.5.GA/serer/default/deploy/hello-ejb.jar
| org.jboss.ws.WSException: Cannot obtain method parameter mapping for message part
'inputttttt' in wdl operation: hello at
org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataRpc(JSR109MetaDataBulder.java:229)
| at
org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuil
| er.java:196)
| at ...
My session bean operation:
public String hello(Input input)
| {
| return "Witaj " + input.getName() + "!";
| }
Input object looks like that:
package org.jboss.chap12.hello;
|
| public class Input {
|
| String name;
|
| public String getName() {
| return name;
| }
|
| public void setName(String name) {
| this.name = name;
| }
|
| }
Wsdl file:
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name="HelloService"
|
targetNamespace="http://hello.chap12.jboss.org/"
|
xmlns:tns="http://hello.chap12.jboss.org/"
|
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
| <types>
| <xsd:schema
targetNamespace="http://hello.chap12.jboss.org/">
|
| <xsd:element name="input" type="tns:Input"/>
|
| <xsd:complexType name="Input">
| <xsd:sequence>
| <xsd:element name="name" type="xsd:string"/>
| </xsd:sequence>
| </xsd:complexType> </xsd:schema>
| </types>
| <message name="Hello_hello">
| <part name="inputttttt" type="tns:Input"/>
| </message> <message name="Hello_helloResponse">
| <part name="result" type="xsd:string"/>
| </message>
| <portType name="Hello">
| <operation name="hello" parameterOrder="inputttttt"
>
| <input message="tns:Hello_hello"/>
| <output message="tns:Hello_helloResponse"/>
| </operation>
| </portType> <binding name="HelloBinding"
type="tns:Hello">
| <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>
| <operation name="hello">
| <soap:operation soapAction=""/>
| <input>
| <soap:body use="literal"
namespace="http://hello.chap12.jboss.org/"/>
| </input>
| <output>
| <soap:body use="literal"
namespace="http://hello.chap12.jboss.org/"/>
| </output>
| </operation>
| </binding>
| <service name="HelloService">
| <port name="HelloPort" binding="tns:HelloBinding" >
| <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
| </port>
| </service>
| </definitions>
|
Mapping file:
<?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">
|
|
| <java-xml-type-mapping>
| <java-type>org.jboss.chap12.hello.Input</java-type>
| <root-type-qname
xmlns:typeNS='http://hello.chap12.jboss.org/'>typeNS:Input<...
| <qname-scope>complexType</qname-scope>
| <variable-mapping>
| <java-variable-name>name</java-variable-name>
| <xml-element-name>name</xml-element-name>
| </variable-mapping>
| </java-xml-type-mapping>
| <package-mapping>
| <package-type>org.jboss.chap12.hello</package-type>
| <
namespaceURI>http://hello.chap12.jboss.org/types</namespaceURI>
| </package-mapping>
| <package-mapping>
| <package-type>org.jboss.chap12.hello</package-type>
| <
namespaceURI>http://hello.chap12.jboss.org/</namespaceURI>
| </package-mapping>
| <service-interface-mapping>
|
<service-interface>org.jboss.chap12.hello.HelloService</service-interface>
| <wsdl-service-name
xmlns:serviceNS="http://hello.chap12.jboss.org/">serviceNS:H...
| <port-mapping>
| <port-name>HelloPort</port-name>
| <java-port-name>HelloPort</java-port-name>
| </port-mapping>
| </service-interface-mapping>
| <service-endpoint-interface-mapping>
|
<service-endpoint-interface>org.jboss.chap12.hello.Hello</service-endpoint-interface>
| <wsdl-port-type
xmlns:portTypeNS="http://hello.chap12.jboss.org/">portTypeNS...
| <wsdl-binding
xmlns:bindingNS="http://hello.chap12.jboss.org/">bindingNS:H...
| <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>org.jboss.chap12.hello.Input</param-type>
| <wsdl-message-mapping>
| <wsdl-message
xmlns:wsdlMsgNS="http://hello.chap12.jboss.org/">wsdlMsgNS:H...
|
<wsdl-message-part-name>inputttttt</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://hello.chap12.jboss.org/">wsdlMsgNS:H...
| <wsdl-message-part-name>result</wsdl-message-part-name>
| </wsdl-return-value-mapping>
| </service-endpoint-method-mapping>
| </service-endpoint-interface-mapping>
| </java-wsdl-mapping>
|
For me looks like everything is fine, but it is not. The question is: why?
Could you help me?
Thank you in advance.
vitor_b
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029280#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...