aspose file tools*
The moose likes BEA/Weblogic and the fly likes Please help me out in solving the problem using presence webservice + clientgen + eclipse+ weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Please help me out in solving the problem using presence webservice + clientgen + eclipse+ weblogic " Watch "Please help me out in solving the problem using presence webservice + clientgen + eclipse+ weblogic " New topic
Author

Please help me out in solving the problem using presence webservice + clientgen + eclipse+ weblogic

rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
I have written build.xml that uses clientGen for generating webservices related stuff.

I am using weblogic 10.3 and presence webservice

I have kept the required jars in classpath and build.xml is running fine and stubs and classes are generated

please find my main program for calling webservices using stubs

import org.csapi.schema.parlayx.common.v2_1.SimpleReference;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresence;
import java.net.URI;
import java.net.URL;
import org.csapi.schema.parlayx.common.v2_1.*;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresenceResponse;
import com.bea.wlcp.wlng.schema.ews.common.ServiceException;
import com.bea.wlcp.wlng.ws.*;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumer;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumerService_Impl;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumer_Stub;


import javax.xml.rpc.*;



public class Main {

/**
* @param args
*/
public static void main(String[] args) throws javax.xml.rpc.ServiceException,PolicyException{

// TODO Auto-generated method stub
try{
System.out.println(" Hi There here 111");
PresenceConsumerService_Impl pcs_impl = new PresenceConsumerService_Impl("http://localhost:8002/parlayx21/presence/PresenceConsumer?WSDL");
PresenceConsumer pc = pcs_impl.getPresenceConsumer();
System.out.println(" Hi There here 222");
SimpleReference rf = new SimpleReference();
System.out.println(" Hi There here 555555");
rf.setCorrelator("correlatorid");
System.out.println(" Hi There here 888888");
rf.setEndpoint(URI.create("http://localhost:8002/PresenceConsumerService/services/PresenceConsumer"));
System.out.println(" Hi There here 9777");
rf.setInterfaceName("PresenceConsumer");
SubscribePresence sb = new SubscribePresence();
sb.setApplication("sdp");
sb.setPresentity(URI.create("tel:1234"));
sb.setReference(rf);

System.out.println(" Hi There here 76989979");
SubscribePresenceResponse spr = pc.subscribePresence(sb);

System.out.println(" Hi There here 2226678565");
System.out.println(" Hi There here 333");
}
catch(PolicyException e)
{
System.out.println(" Hi There here 444");
}
catch(Exception e)
{
e.getCause();
System.out.println(" Hi There here 555"+e.getCause());
}

}

}


please find the my problem

1) from the attachment all stubs and related java files and class files are generated by clientgen under /build/output folder . thats fine and schema and wsdl folders as shown in attachment are in same path , but in my main program , to use

PresenceConsumerService_Impl and PresenceConsumer class and all other generated classes I am not importing from the path where folders are generated from attachment shown as geenrated by clientgen and i am doing like importing
com.bea.wlcp.wlng.ws.presence.PresenceConsumerService_Impl and com.bea.wlcp.wlng.ws.presence.PresenceConsumer and so on. do i need to take the path from folders generated from attachment shown as geenrated by clientgen or wht i did is correct.

2) If i use as above shown in my main program , importing with com.bea...., then wht is the use of generating stubs and classes when we dont import use them in our main program for calling webservices .

3) My third issues , I ket aside and forget abt all the files and stubs generated

I tried to run main programs directly

but i am gettign exception like below
weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Unable to add security token for identity

Please tell me tio whcih class i need to add username,password parameters
I found PresenceConsumerClient from one forum, But it is in somewhere ....V2_0/.. , but in pte.jar , it is not there
so please guide me to which class I need to add secuirty parameters













rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
Adding to the above information

1) All files are generated under 2 folders

a) build\output\clientclass\org\csapi\schema
b)build\output\clientclass\org\csapi\wsdl

As far as schema folder is OK, but to use presenceconsumer and presenceconsumer_impl class i need to use
org\csapi\wsdl\parlayx\presence\consumer\v2_3\service\PresenceConsumer.java

which is in b) category and I mentioned in previous post I could not able to import the files in my main program , generated by clientgen.
and apart from that , I didnt found the above files in that path in any of jar files i added to classpath , as I menioned in my previous post it is there in com.bea.wlcp.wlng.ws.presence path as I refereed from pte.jar , but it is mysterious for me why the clientgen is generating in build\output\clientclass\org\csapi\wsdl folder, Any one helps or suggestions greatly appreciated
I tried and tried , but helpless .
rajabhayya Sekharbhayya
Greenhorn

Joined: Oct 23, 2008
Posts: 14
Issues Resolved
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6657
    
    5

rajabhayya Sekharbhayya wrote:Issues Resolved


I reached this thread late and its good to know the problem was resolved. But please tell us how you resolved it. It will help developers save time


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please help me out in solving the problem using presence webservice + clientgen + eclipse+ weblogic
 
Similar Threads
How to apply security paramters in a main program to interact with webservice with weblogic10.3
Getting Exception :Problem: failed to create task or type arg in build.xml while creating webservice
Please tell how to authenticate user for calling webservice using JAX-WS
Ant build - With weblogic 10
Trying to generate webservice using clientgen in build.xml