Hi ,
I have a task to invoke & connect to a axis webservice in a dotnet web app.
The weservice, first requires authentication of username & password , which should be sent in header , only after authenication , we can call any of its method.
Now , i actually i dont know , how to actually pass the credentials & invoke the webservice.
I have the java code , which shows how to access the webservice , but i dont know how to do the same in dotnet .
I suppose i have to use WSE 3.0.
Here is the java Code :
Service webService = new Service();
Call calling = (Call) webService.createCall();
calling.setProperty (Call.USERNAME_PROPERTY, "victor");
calling.setProperty (Call.PASSWORD_PROPERTY, "victor_s");
String userid="userid";
String password="password";
String endpoint= "SERVICEURL";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName(endpoint,methodName));
call.setProperty (Call.USERNAME_PROPERTY, "victor");
call.setProperty (Call.PASSWORD_PROPERTY, "victor_s");
String ItineraryDetailsInputXML="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ItineraryDetailsInput lccp_srcstn=\"NDLS\" lccp_dstnstn=\"MAS\" lccp_trnnum=\"2616\" lccp_cls=\"SL\" lccp_resupto=\"MAS\" lccp_brdpt=\"NDLS\" lccp_day=\"27\" lccp_month=\"11\" lccp_year=\"2008\" lccp_qta=\"GN\" lccp_psgnname1=\"SANJEEV KUMAR \" lccp_psgnsex1=\"m\" lccp_psgnage1=\"60\" lccp_psgnberthpref1=\"Side_Upper\" lccp_psgnfoodpref1=\"Veg\" lccp_psgnconc1=\"SRCTZN\" lccp_psgnname2=\"Prasad\" lccp_psgnsex2=\"f\" lccp_psgnage2=\"60\" lccp_psgnberthpref2=\"Side_Lower\" lccp_psgnfoodpref2=\"\" lccp_psgnconc2=\"SRCTNW\" lccp_psgnname3=\"saa\" lccp_psgnsex3=\"m\" lccp_psgnage3=\"05\" lccp_psgnberthpref3=\"\" lccp_psgnfoodpref3=\"\" lccp_psgnconc3=\"\" lccp_psgnname4=\"ssss\" lccp_psgnsex4=\"m\" lccp_psgnage4=\"45\" lccp_psgnberthpref4=\"\" lccp_psgnfoodpref4=\"\" lccp_psgnconc4=\"\" lccp_psgnname5=\"\" lccp_psgnsex5=\"\" lccp_psgnage5=\"\" lccp_psgnberthpref5=\"\" lccp_psgnfoodpref5=\"\" lccp_psgnconc5=\"\" lccp_psgnname6=\"\" lccp_psgnsex6=\"\" lccp_psgnage6=\"\" lccp_psgnberthpref6=\"\" lccp_psgnfoodpref6=\"\" lccp_psgnconc6=\"\" userid=\""+userid+"\" password=\""+password+"\"/>";
StringBuffer buffer = new StringBuffer ();
String requestXml=ItineraryDetailsInputXML;
I dont know , how to do all this passing of credentials using dotet. Hence , i request you to please guide me , on how should i tackle this. Also , if u can please give me some sample code in dontet , where the above scenario can be done.
Regards Victor