Click here to Skip to main content
15,920,438 members
Home / Discussions / C#
   

C#

 
QuestionCrystal Report Question Pin
Harvey Saayman5-Mar-08 21:01
Harvey Saayman5-Mar-08 21:01 
GeneralRe: Crystal Report Question Pin
V.5-Mar-08 22:35
professionalV.5-Mar-08 22:35 
GeneralRe: Crystal Report Question Pin
Harvey Saayman6-Mar-08 1:09
Harvey Saayman6-Mar-08 1:09 
GeneralRe: Crystal Report Question Pin
V.6-Mar-08 1:26
professionalV.6-Mar-08 1:26 
GeneralRe: Crystal Report Question Pin
Harvey Saayman6-Mar-08 1:27
Harvey Saayman6-Mar-08 1:27 
GeneralProblem with Print and print preview Pin
D i x y5-Mar-08 19:04
D i x y5-Mar-08 19:04 
GeneralRe: Problem with Print and print preview Pin
Christian Graus5-Mar-08 22:32
protectorChristian Graus5-Mar-08 22:32 
Questiondynamic web proxy using c#? Pin
gunganesh19825-Mar-08 18:57
gunganesh19825-Mar-08 18:57 
To invoke a webservice, we usually generate web referece based on wsdl generated code and use it.

Instead, if i have to dynamically invoke a web service method, given that i know the following

- URL with ip
- Service name
- port
- namespace

This is available in java, sample code given below. I need to implement the same in c#. Any pointers will be a BIG BIG HELP for me Smile | :)

//URL wsdl = new URL(url);
String tempServiceName = getServiceName(serviceName);
QName serviceQName = new QName(targetNameSpace, tempServiceName);
QName port = new QName(targetNameSpace, portName);
QName operation;
operation= new QName(targetNameSpace, reqInfo.getRequestMethod());

org.apache.axis.client.ServiceFactory factory = new ServiceFactory();
//org.apache.axis.client.Service service = (Service) factory.createService(new URL(url), serviceQName);
org.apache.axis.client.Service service = (Service) factory.createService(serviceQName);
org.apache.axis.client.Call call = (org.apache.axis.client.Call) service.createCall(port, operation);
call.setReturnType(XMLType.XSD_STRING);
call.addParameter("string", XMLType.XSD_STRING, ParameterMode.IN);

//-------------settign the header
org.apache.axis.message.PrefixedQName svcName = new org.apache.axis.message.PrefixedQName("http://schemas.xmlsoap.org/ws/2002/07/secext", "Security", "wsse");
org.apache.axis.message.SOAPHeaderElement sh = new org.apache.axis.message.SOAPHeaderElement(svcName);
javax.xml.soap.SOAPElement sub = sh.addChildElement("UsernameToken");
javax.xml.soap.SOAPElement element = sub.addChildElement("Username");
element.addTextNode(userName);
element = sub.addChildElement("Password");
element.addTextNode(password);
call.addHeader(sh);
//------------

// int iIndexWsdl = url.indexOf("?");
// String strEndPointAddress = url.substring(0, iIndexWsdl);
call.setTargetEndpointAddress(url);
// String requestXML= CommonHelper.getInstance().loadFile(reqInfo.getRequestXML().trim()).toString();
logger.info("request XML:"+reqInfo.getRequestXML());
//long startTime=logger.perf("calling webservice");
long startTime= System.currentTimeMillis();
String response = (String) call.invoke(new Object[]{reqInfo.getRequestXML().trim()});
// long endTime=logger.perf("timeTaken for webserviceCall:",startTime);
long endTime=System.currentTimeMillis();

GHanesh

GeneralGraphical XML designer [modified] Pin
Maddie from Dartford5-Mar-08 18:39
Maddie from Dartford5-Mar-08 18:39 
GeneralRe: Graphical XML designer Pin
Christian Graus5-Mar-08 21:38
protectorChristian Graus5-Mar-08 21:38 
GeneralRe: Graphical XML designer Pin
Maddie from Dartford5-Mar-08 23:42
Maddie from Dartford5-Mar-08 23:42 
Generalproblem with System.Threading.Timer Pin
saikiran5-Mar-08 17:57
saikiran5-Mar-08 17:57 
GeneralRe: problem with System.Threading.Timer Pin
Guffa5-Mar-08 20:32
Guffa5-Mar-08 20:32 
GeneralRe: problem with System.Threading.Timer Pin
PIEBALDconsult6-Mar-08 7:17
mvePIEBALDconsult6-Mar-08 7:17 
GeneralInserting blank line into a spreadsheet file with code Pin
BraveKnightFSJ5-Mar-08 17:20
BraveKnightFSJ5-Mar-08 17:20 
GeneralConsole.WriteLine in color Pin
Imtiaz Murtaza5-Mar-08 14:59
Imtiaz Murtaza5-Mar-08 14:59 
GeneralRe: Console.WriteLine in color Pin
darkelv5-Mar-08 16:36
darkelv5-Mar-08 16:36 
GeneralRe: Console.WriteLine in color Pin
Anthony Mushrow5-Mar-08 21:24
professionalAnthony Mushrow5-Mar-08 21:24 
Questionplz tell me how i can develope backup server using C# and MS Sql Pin
saiftanoli5-Mar-08 14:50
saiftanoli5-Mar-08 14:50 
GeneralRe: plz tell me how i can develope backup server using C# and MS Sql Pin
Christian Graus5-Mar-08 14:55
protectorChristian Graus5-Mar-08 14:55 
GeneralRe: plz tell me how i can develope backup server using C# and MS Sql Pin
Pete O'Hanlon5-Mar-08 22:03
mvePete O'Hanlon5-Mar-08 22:03 
GeneralRichtextbox questions/problems.. Pin
Jacob Dixon5-Mar-08 13:31
Jacob Dixon5-Mar-08 13:31 
GeneralRe: Richtextbox questions/problems.. Pin
Jacob Dixon5-Mar-08 15:23
Jacob Dixon5-Mar-08 15:23 
GeneralRe: Richtextbox questions/problems.. Pin
W Balboos, GHB6-Mar-08 9:46
W Balboos, GHB6-Mar-08 9:46 
GeneralRe: Richtextbox questions/problems.. Pin
Jacob Dixon6-Mar-08 12:29
Jacob Dixon6-Mar-08 12:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.