You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by ERaj <il...@yahoo.com> on 2008/10/21 05:37:02 UTC

Custom WSDL file issue

Hi guys,
  
I have the following service, bean, descriptor
package au.com;
public class InfoService{
    private Person person;
    public Person getPerson(String firstName, String lastname){
    	person = new Person();
    	person.setId(101);
    	person.setName("Mr. " + firstName +" " + lastname);
    	return person;
    }
}

package au.com;

public class Person {
	private int id;
	private String name;
	public int getId() {	return id;	}
	public void setId(int id) {this.id = id;	}
	public String getName() {	return name;	}
	public void setName(String name) {	this.name = name;	}
}

service.xml
&lt;service name="InfoService" scope="application"&gt;
    &lt;description&gt;
        Info POJO Service
    &lt;/description&gt;
    &lt;messageReceivers&gt;
        &lt;messageReceiver 
            mep="http://www.w3.org/2004/08/wsdl/in-only"
    class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/&gt;
        &lt;messageReceiver
            mep="http://www.w3.org/2004/08/wsdl/in-out"
    class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/&gt;
    &lt;/messageReceivers&gt;
    &lt;parameter name="ServiceClass"&gt;
        au.com.InfoService
    &lt;/parameter&gt;
	&lt;parameter name="useOrignalWSDL"&gt;true&lt;/parameter&gt;
	&lt;parameter name="modifyUserWSDLPortAddress"&gt;false&lt;/parameter&gt;
&lt;/service&gt;

----------------------
using the above stuff I prepared a service archive (InfoService.aar) and
deployed to tomcat and execute the following client
import au.com.infoservice.client.InfoServiceStub.GetPerson;
import au.com.infoservice.client.InfoServiceStub.GetPersonResponse;
import au.com.infoservice.client.InfoServiceStub.Person;

public class InfoServiceClient {	public static void main(String[] args)
throws Exception{
		// TODO Auto-generated method stub
		InfoServiceStub stub = new InfoServiceStub();
		GetPerson person = new GetPerson();
		person.setParam0("Raj");
		person.setParam1("Dav");
		GetPersonResponse resp = stub.getPerson(person);
		Person realperson = resp.get_return();
		System.out.println(realperson.getId());
	}
}

It worked well.
 Later I have copied the default wsdl (axis2 autogenerated one) in to the
META-INF folder and create the service archive and deployed to the same
tomcat.
now the above client gives the following error :
Exception in thread "main" org.apache.axis2.AxisFault:
org.apache.axis2.databinding.ADBException: Unexpected subelement id
	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
	at
au.com.infoservice.client.InfoServiceStub.fromOM(InfoServiceStub.java:3632)
	at
au.com.infoservice.client.InfoServiceStub.getPerson(InfoServiceStub.java:473)
	at
au.com.infoservice.client.InfoServiceClient.main(InfoServiceClient.java:19)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException:
Unexpected subelement id
	at
au.com.infoservice.client.InfoServiceStub$Person$Factory.parse(InfoServiceStub.java:3475)
	at
au.com.infoservice.client.InfoServiceStub$GetPersonResponse$Factory.parse(InfoServiceStub.java:1159)
	at
au.com.infoservice.client.InfoServiceStub.fromOM(InfoServiceStub.java:3626)
	... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement
id
	at
au.com.infoservice.client.InfoServiceStub$Person$Factory.parse(InfoServiceStub.java:3469)
	... 4 more

------------------------------
if I remove the wsdl file from the .aar and restart then the client works
fine. What is this problem?
I have tried a couple of similar application - result is same. How to
overcome this problem?

Cheers,
Raj
-- 
View this message in context: http://www.nabble.com/Custom-WSDL-file-issue-tp20082908p20082908.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Custom WSDL file issue

Posted by ERaj <il...@yahoo.com>.
Keith your solution is superb - I fixed my issue . Many thanks,
Eraj


-- 
View this message in context: http://www.nabble.com/Custom-WSDL-file-issue-tp20082908p20104887.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Custom WSDL file issue

Posted by keith chapman <ke...@gmail.com>.
I've answered this same question on a WSO2
forum<http://wso2.org/forum/thread/4263#comment-7062>here [1]

Thanks,
Keith.

[1] http://wso2.org/forum/thread/4263#comment-7062

On Tue, Oct 21, 2008 at 9:20 AM, ERaj <il...@yahoo.com> wrote:

>
> I have added this too still the same issue - can anybody help here?
> import java.io.Serializable;
> public class Person implements Serializable{
> .............
>
> --
> View this message in context:
> http://www.nabble.com/Custom-WSDL-file-issue-tp20082908p20083001.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Re: Custom WSDL file issue

Posted by ERaj <il...@yahoo.com>.
I have added this too still the same issue - can anybody help here?
import java.io.Serializable;
public class Person implements Serializable{
.............

-- 
View this message in context: http://www.nabble.com/Custom-WSDL-file-issue-tp20082908p20083001.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org