|
you could do that. invalidate using four rect, and these each rect invalidate onle one edge of rect. Its a cake to implement.
let me know if you have any other issue.
Shail Srivastav
shailsrivastav@hotmail.com
|
|
|
|
|
Hello,
I'm a kindof newbie to SOAP, so please help me with this problem. It could be a very basic one, but I'm trying to figure out what's wrong in this, since a couple of days now! The webservice runs fine when invoked from IE, but from my app, it doesn't receive the parameter.
Here's my setup information & code segments to help you help me:
* Server End:
Windows Server 2003 Enterprise Edition, IIS 6.0, VS.NET 2003
* Web Service:
The C# web service is just supposed to receive a string and return a string.
Code Segment:
[WebMethod (CacheDuration = 30)]
public string GreetMe(string sName)
{
return ("Hello " + sName + "!");
}
* At the Client End:
VC++ (MFC) - Using MS-SOAP Toolkit 3.0
I am not using a WSDL file, and I am directly trying to invoke the
Web Service.
Code:
void CSOAPClientDlg::OnBtnGetString() {
try
{
ISoapConnectorPtr psmConnector = NULL;
ISoapSerializerPtr psmSerializer = NULL;
ISoapReaderPtr psmReader = NULL;
CString csName;
psmConnector.CreateInstance(__uuidof(HttpConnector30));
psmConnector->Property["EndPointURL" = "http://172.16.1.95/WebServices/ws1/Service1.asmx";
psmConnector->Connect();
psmConnector->Property["SoapAction"] = "http://172.16.1.95/WebServices/ws1/GreetMe";
psmConnector->BeginMessage();
psmSerializer.CreateInstance(__uuidof(SoapSerializer30));
psmSerializer->Init(_variant_t((IUnknown *) psmConnector->InputStream));
psmSerializer->StartEnvelope("", "STANDARD", "");
psmSerializer->StartBody("STANDARD");
psmSerializer->StartElement("GreetMe", "http://172.16.1.95/WebServices/ws1/", "", "");
psmSerializer->StartElemen("sName", "", "STANDARD", "");
GetDlgItem(IDC_TXT_GREET)->GetWindowText(csName);
psmSerializer->WriteString(csName.AllocSysString());
psmSerializer->EndElement();
psmSerializer->EndElement();
psmSerializer->EndBody();
psmSerializer->EndEnvelope();
psmConnector->EndMessage();
psmReader.CreateInstance(__uuidof(SoapReader30));
psmReader->Load(_variant_t((IUnknown *) psmConnector->OutputStream), "");
GetDlgItem(IDC_TXT_XML)->SetWindowText((const char *)psmReader->RpcResult->xml);
GetDlgItem(IDC_TXT_GREET)->SetWindowText((const char *) psmReader->RpcResult->text);
psmConnector.Release();
psmSerializer.Release();
psmReader.Release();
psmSerializer = NULL;
psmReader = NULL;
psmConnector = NULL;
}
catch(...)
{
AfxMessageBox("Something Wrong! - 1");
}
}
* Problem:
When I provide the "String" in the dialog, the function above sends it in a SOAP request to my server (172.16.1.95). But the response from the server is just "Hello !" - Without the string that was sent to the server.
* On capturing the packet being sent, I have the following SOAP Request being sent to the server (172.16.1.95) on
my local network:
-----------
POST /WebServices/ws1/Service1.asmx HTTP/1.1
SOAPAction: "http://172.16.1.95/WebServices/ws1/GreetMe"
Content-Type: text/xml; charset="UTF-8"
User-Agent: SOAP Toolkit 3.0
Host: 172.16.1.95
Content-Length: 776
Connection: Keep-Alive
Cache-Control: no-cache
Pragma: no-cache
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-
ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAPSDK4:GreetMe
xmlns:SOAPSDK4="http://172.16.1.95/WebServices/ws1/" SOAP-
ENV:encodingStyle="">
<SOAPSDK5:sName
xmlns:SOAPSDK5="http://172.16.1.95/WebServices/ws1/GreetMe" SOAP-
ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">Nirav</S
OAPSDK5:sName>
</SOAPSDK4:GreetMe>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
-----------
The "sName" parameter being sent in the message is not being received at the webservice end at all. Hence the reply message is without the "sName" value.
Thanks, in advance!
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Server side seems OK. You'd get better reply in VC forum. Have you tried to find any sample in internet which consume web service from VC6 with Soap Toolkit? I've used it in VB6 and it doesn't bother at all.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Mazy,
Thanks for your reply!
I was not able to find any sample on the net which consumed web services from VC++ 6.0, hence I had to post my query - Hoping someone would've worked on it!
I am still looking harder for such samples.
Everything in the code seems right... But the parameter is not being received at the server end!
Thanks anyway,
Rgds,
Nirav Doshi
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Hello,
I got the solution to the problem I was facing.
It was expecting a NAMESPACE parameter which I was not providing it. So by changing the following:
psmSerializer->StartElement("GreetMe", "http://172.16.1.95/WebServices/ws1/", "STANDARD", "mns");
psmSerializer->StartElement("nFirstNo", "", "STANDARD", "mns");
After I gave the last parameter "mns" for the namespace, the code worked as expected!
Posting this, just in case anyone had (or may have) a similar problem.
Righto!
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
There are two types of channels that .NET framework provide 1)TCP and 2)HTTP and there are custom channels that u can create using any stream oriented transfer technology like Sockets, Named Pipes and MSMQ.
My question is which channel is suitable in which situation. Can anybody tell me when should i use named pipes channel and when MSMQ.
Need urgent response ....
@!$h@
|
|
|
|
|
If you use the TCP channel, then you have your own server code which is handling the reciept of the requests and issuing the responses.
The HTTP channel places your remoting objects in IIS and it handles all of the server functions with only your remoting objects needed. This lets you focus only on the functions the remote objects perform and not the server functions you need to expose.
Channels are the first part of it. Then there are formatters.
There are binary formatters and SOAP formatters. Generally, SOAP is horrendously slow. So you should stick to binary even over HTTP. (IIS establishes the binary formatter by default at the server side.)
______________________________
The Tao gave birth to machine language. Machine language gave birth to the assembler.
The assembler gave birth to the compiler. Now there are ten thousand languages.
Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.
But do not program in COBOL if you can avoid it.
|
|
|
|
|
what about other (custom) channels like MSMQ, Pipes, Sockets?
@!$h@
|
|
|
|
|
Dear @!$h@,
With any custom channel it is not as simple as just defining a channel...and anyone who even thinks of deploying remoting over Named Pipes should be taken outside and shot. Named Pipes is really an ancient technology that deserves a quiet death.
You may need to provide your own sink providers, incorporate sink formatters and sink serializers/deserializers. Most writings on remoting only discuss TCP or HTTP with no other form considered.
______________________________
The Tao gave birth to machine language. Machine language gave birth to the assembler.
The assembler gave birth to the compiler. Now there are ten thousand languages.
Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.
But do not program in COBOL if you can avoid it.
|
|
|
|
|
IIRC, someone did define a custom channel using MSMQ here on CodeProject. You could try a search to learn more (perhaps "MSMQ channel" for keywords). I believe it was by Roman Kiss.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
yes i referred to that but Roman Kiss only mentioned how to make MSMQ based Channel and not the advantages/disadvantages of using MSMQ channel over the other channels.
@!$h@
|
|
|
|
|
The advantages and disadvantages are whatever advantages and disadvantages of using MSMQ for anything, really. I don't have a lot of experience with MSMQ (just never had a good enough reason or opportunity as of yet). One advantage I can think of is a distributed system were you could have multiple remoting objects handling requests. I don't know if this would really be necessary, but it may be one way to do load balancing with massive clients connected if you devised a way that whichever remoting object answered first would cause the others not to handle the request. This can be achieved - and probably better - by implementing your own RealProxy derivative, for which the book, "Microsoft .NET Remoting" from MS Press[^], has an example.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Actually, I thought using the HttpChannel defaults to SOAP? In any case, though, the BinaryFormatter is much faster (even just for serialization, not to mention over the transport channel).
The one thing that does stink is that even using the BinaryFormatter, DataSets (which are application uses a lot) are still serialized to XML. This will be changed in .NET 2.0 if you set a property on the DataSet before serializing it. This was recently shown on MSDN TV and there is, obviously, a significant reduction in size (about 400%)!
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
The one thing that does stink is that even using the BinaryFormatter, DataSets (which are application uses a lot) are still serialized to XML. This will be changed in .NET 2.0 if you set a property on the DataSet before serializing it. This was recently shown on MSDN TV and there is, obviously, a significant reduction in size (about 400%)!
nice piece of information. But this is about formatters and not channels. what i have conceived as yet is that there are only two available formatters SOAP and Binary and about Channels TCP and HTTP. You can write ur custom channels but the formatter you will associate with ur channel could be either SOAP or Binary. My question is about channels and not formatters.
@!$h@
|
|
|
|
|
Yes, I know. I was posting this in reference to what theRealCondor said - call it an aside. It was not intended to be a direct response to your question.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi, I've got a dll that performs some operation on file, I would like to know how to implement a progress bar, and if it's possible, not having access to osuce code dll, I can set minumum and maximum and step properties but odn't know how to set it for doing the step, since I don't have access to source.......thanks
Ciko2000
|
|
|
|
|
If I understand it correctly, you've got a black box that you want to change. Without the source, this really isn't possible. What you're asking to do is get notification of the progress of the operation that the DLL performs on the file. Unless that DLL exposes some events or a callback, you're sunk.
If it exposes a progress callback or events, then you can simply initialize your ProgressBar with the information and with every notification of another unit of progress, just use ProgressBar.PerformStep() (which increments the Value by the Step amount).
The problem you'll run into, though, is threading. You should - if possible - invoke that DLL function/method in a separate thread and be sure to use ProgressBar.InvokeRequired and ProgressBar.Invoke (both inherited from the Control class). If you try to change the control from a separate thread other than the one on which the control was created, you'll run into "undefined" problems (i.e., the control not displaying, methods not doing anything, and other oddities).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Oh, if that other DLL to which you don't have the source is a .NET assembly, you could always disassemble it, insert the IL necessary for such callbacks or events, then reassemble it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can i load values into a listview from a event that is on another form than the listview. The listview is on a control on my main form, but I open a new form to change some values and when i click on save it should change the listview on the Main form.
It will also be fine to load the values when the child form closes, but i can't get that to work either.
I tried to run a function from the child form but nothing happens.
thnxs.
|
|
|
|
|
Probably not the best way to do this, but you could always make your parent listview "public static", and directly assign the values from your child. A major problem with this is, your main form would probably need to be static as well.
You could also store all the data in a class object, and return the object back to the main form, and extract all the data from the object.
Just a few suggestions.
I might be totally wrong.
|
|
|
|
|
A better way than making it static (you'll run into all kinds of problems with this approach, especially if you want to use the designer after making those suggested changes) is to either pass a reference to the ListView to the form you open, or make a public property that gets the ListView on the first form and pass a reference to the first form into the second form (probably better if you ever want to do similar things in the future), or - finally - provide a way to get the data from the second form inside the first form and then have your first form add the data to your ListView .
The latter method is probably best. This allows you to use that form in different places and different ways. Once ShowDialog returns, you can grab that data (in a collection, list, array, a single property or properties, or whatever) and use it however you want.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello ,
I'm programming in C# in the SmartSolution for pocket PC environment .
I've defined a CAutoRestetEvent and noticed that there is only WaitOne() function
Which does not allow Time out .
I'm looking for something that will support waiting on a specific handle with timeout like - WaitOne(5000) .
Thanks in advance …
|
|
|
|
|
One of the more odious omissions from the Compact Framework.
You'll have to P/Invoke CreateEvent to create an event, and WaitForSingleObject to wait on it.
You may find the OpenNETCF Smart Device Framework[^] useful. This already contains appropriate P/Invokes in the OpenNETCF.Win32.Core class.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
I created an installer package which has been installed by several clients. Now I want to create a new version. I increased the version number and changed the upgrade code of the installer package and set the RemovePreviousVersion property to True and set the DetectNewerInstallerVersion to True as well. I have several registry setting setup in the registry editor. However if the client has a previous version of the application installed I want the system to remember those settings and not override them. Because the RemovePrevioiusVersion property is set to True the system removes all settings after which they are lost. However if I dont set this property to true the system willl install 2 version of the application on the target machine.
How can I create a package that overrides (or removes) the old version but doesn't override the registr values so that previous configuration settings will be maintained? I spend many days trying to find a solution but haven't had much luck. Also it must be possible to use this package as the first installer meaning that if the client never had the application installed before, he can run the setup to install the application. In other words it is not just a patch for older versions.
|
|
|
|
|
Never change the UpgradeCode! The UpgradeCode should remain constant throughout an application's installer's lifetime. It is the PackageCode and ProductCode that you must change. When you change the Version, you opt to leave the UpgradeCode alone. This is what associates the newer product with the older product. Read about the Upgrade table in the Windows Installer SDK on MSDN[^] for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|