Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2010, 01:51 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default Dime attachment & Delphi 7.

Hi,
I am writing a web application and need to use "Dime" encoding in my WebService's attachments. Any idea how to send DIME attachments using Delphi7 or Delphi2007 (Win32)?
__________________
Regards,
Abdulaziz Jasser

Last edited by Jasser; 09-06-2010 at 11:43 AM.
Reply With Quote
  #2  
Old 09-06-2010, 09:02 AM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,335
Default

DIME is the .NET soap service, Delphi uses MIME... So with the default components using D7 it's not possible, sorry...

But there are alternatives, you could look at pocketsoap
Reply With Quote
  #3  
Old 09-06-2010, 10:57 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default

Thanks Norrit. However, I know that and this is the core of my problem. I am trying to avoid using another version of Delphi especially the NET thing. Any idea on how to translate the VB code into Delphi code? So far this is what I did:

Code:
var
          soap, t : OleVariant;
begin

	        soap := CreateOleObject('PocketSOAP.Envelope.11');

        //  soap.methodName = "Add"  ????????
          soap.URI := sURL;

          soap.Parameters.Create('a', 100);
          soap.Parameters.Create('b', 20);

          t := CreateOleObject('PocketSOAP.HTTPTransport');
          t.Send('http://soap.4s4c.com/ssss4c/soap.asp', soap.serialize);
          soap.parse(t);

          // jump into the return parameters collection to get the results
         // wscript.echo "4s4c at soap.4s4c.com result (expecting 120) : " & _
         //   soap.Parameters.ItemByName("added").Value

         FreeAndNil(t);
         FreeAndNil(soap);
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #4  
Old 09-06-2010, 11:14 AM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default

A better thing: Do you have a complete example written in Delphi for a local file sent via DIMEi? This thing is new to me.
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #5  
Old 09-06-2010, 12:17 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,335
Default

Sorry, no working code here, I do webservices, but I'm allowed to do them in MIME. I only know that when wanting to do DIME you could use the pocketsoap api.
The howto is new for me aswell.

The method they ask you is the method you can find in the WSDL, the function/procedure you want to call... The parameters and their values are the parameters of the function specified by soap.MethodName...
The URI is either the WSDL or the SOAP Service itself, just test this one out...

In this case the t.Send sends a .asp file, not sure what this is...
Reply With Quote
  #6  
Old 09-06-2010, 12:49 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default

Does TSoapAttachment in Delphi XE Win32 (2011) support DIME?
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #7  
Old 09-06-2010, 12:58 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,335
Default

Not that I can find, and I really don't think it will. As mentioned in my first reply, as far as I know the DIME is the .NET variant, MIME is win32.
Reply With Quote
  #8  
Old 09-06-2010, 01:41 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default

I found the Delphi version of PocketSOAP http://www.delphi3000.com/articles/a...92.asp?SK=dime but still does not have any documentations for the methods and properties.
__________________
Regards,
Abdulaziz Jasser
Reply With Quote
  #9  
Old 09-06-2010, 01:50 PM
Norrit Norrit is offline
Moderator
 
Join Date: Aug 2001
Location: Landgraaf
Posts: 7,335
Default

That all depends on your WSDL, so it's not possible to give you working samples since I don't have your soap service...
What happens if you try to specify the parameters and add the wsdl, correct function names (perhaps case sensitive, but you can get them from the WSDL)?
You get error message, no result, what happens???
Reply With Quote
  #10  
Old 09-06-2010, 02:27 PM
Jasser Jasser is offline
Moderator
 
Join Date: Jan 2005
Location: Saudi Arabia
Posts: 5,060
Default

I got an error at the last line which says:

"ServergeneralException : Error - Could not perform the operation, policy limit exceeded"


This error happened before with another C# application when tried to call the same method ("CreateAttachment") without using DIME encoding. So it looks like it is not using it also in my case. This is my code:
This is my code:

Code:
const
          sURL  : WideString = 'http://192.168.4.85:8080/axis/services/USD_R11_WebService?wsdl';
var
          soap, t : OleVariant;
begin
	        soap := CreateOleObject('PocketSOAP.Envelope.11');
          soap.methodName := 'createAttachment';
          soap.URI        := sURL;

          soap.Parameters.Create('sid', sid);
          soap.Parameters.Create('repositoryHandle', 'doc_rep:1002');
          soap.Parameters.Create('objectHandle', newTicketHandle);
          soap.Parameters.Create('description', 'My description');
          soap.Parameters.Create('fileName', 'C:\qryItems.SQL');

          t := CreateOleObject('PocketSOAP.HTTPTransport');
          t.Send(sURL, soap.serialize);
          soap.parse(t); >>>>>> I got the error here.
__________________
Regards,
Abdulaziz Jasser

Last edited by Jasser; 09-06-2010 at 02:32 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 05:39 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.