• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to apply security paramters in a main program to interact with webservice with weblogic10.3

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I have written a build.xml using clientGen task taking input as WSDL , to consume subscribepresence webservice , when i run the build.xml, I got all the presence webservice related stubs ,Implmentation classes and interfaces .
Now i have written a main program, and by utilizing generated stubs and implmentation classes, i am trying to call a webservice

==========================
Below is my main program

import java.net.URI;

import org.csapi.schema.parlayx.common.v2_1.PolicyException;
import org.csapi.schema.parlayx.common.v2_1.SimpleReference;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresence;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresenceResponse;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumer;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumerService_Impl;

import java.net.URI;

import org.csapi.schema.parlayx.common.v2_1.PolicyException;
import org.csapi.schema.parlayx.common.v2_1.SimpleReference;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresence;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresenceResponse;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumer;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumerService_Impl;

public class Main {

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

try{
PresenceConsumerService_Impl pcs_impl = new PresenceConsumerService_Impl("http://localhost:8002/parlayx21/presence/PresenceConsumer?WSDL");
PresenceConsumer pc = (PresenceConsumer) pcs_impl.getPresenceConsumer();
SimpleReference rf = new SimpleReference();
rf.setCorrelator("correlatorid");
rf.setEndpoint(URI.create("http://localhost:8002/PresenceConsumerService/services/PresenceConsumer"));
rf.setInterfaceName("PresenceConsumer");
SubscribePresence sb = new SubscribePresence();
sb.setApplication("sdp");
sb.setPresentity(URI.create("tel:1234"));
sb.setReference(rf);
System.out.println(" Before calling subscribe presence ");
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(" Exception Cause =="+e.getCause());
}

}

}

============

When i run above main program, I am getting below exception


Before calling subscribe presence
Exception Cause ==weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Unable to add security token for identity


Please tell me where I am going wrong, where to add security parameters, I checked in stubs and classes for security related parameters, but i could not find them
From google, I found that there is presenceconsumerclient class from oracle.sdp.paralyx....PresenceConsumerClient class, where we has username and password varaibles which can be set , but i am using pte.jar which does not contain that package.
Please let me know what more classes or jars required to add security parameters
Is there any way of adding security credentials to interact with webservice .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic