Amazon Simple Queue Service:

only one small piece is missing ...

I have this WSDL

http://queue.amazonaws.com/doc/2008-01-01/QueueService.wsdl


All operations are working perfectly, for example this is the 
GetQueueAttributes operation body:

<SOAP-ENV:Body>
<GetQueueAttributes xmlns="http://queue.amazonaws.com/doc/2008-01-01/">
   <AttributeName>VisibilityTimeout</AttributeName>
</GetQueueAttributes>
</SOAP-ENV:Body>


This is the problematic operation:

The SetQueueAttributes operation adds a "SOAP-ENV:" namespace in front 
of the operation name, and adds a namespace declaration to the Attribute 
element:

<SOAP-ENV:Body>
<SOAP-ENV:SetQueueAttributes>
   <Attribute xmlns="http://queue.amazonaws.com/doc/2008-01-01/">
     <Name>VisibilityTimeout</Name>
     <Value>2</Value>
   </Attribute>
</SOAP-ENV:SetQueueAttributes>
</SOAP-ENV:Body></SOAP-ENV:Envelope>


The reason might be the declaration of SetQueueAttributes

   SetQueueAttributes = array of Attribute;

while

   GetQueueAttributes = class(TRemotable)



All other declarations for Get/SetQueueAttributes are identical:

InvRegistry.RegisterExternalParamName(TypeInfo(MessageQueuePortType), 
'GetQueueAttributes', 'body1', 'body');
InvRegistry.RegisterExternalParamName(TypeInfo(MessageQueuePortType), 
'SetQueueAttributes', 'body1', 'body');

RemClassRegistry.RegisterXSClass(GetQueueAttributes, 
'http://queue.amazonaws.com/doc/2008-01-01/', 'GetQueueAttributes');
RemClassRegistry.RegisterSerializeOptions(GetQueueAttributes, 
[xoLiteralParam]);

RemClassRegistry.RegisterXSInfo(TypeInfo(SetQueueAttributes), 
'http://queue.amazonaws.com/doc/2008-01-01/', 'SetQueueAttributes');
RemClassRegistry.RegisterSerializeOptions(TypeInfo(SetQueueAttributes), 
[xoLiteralParam]);


Is there a way to wrap the "array of Attribute" for SetQueueAttributes 
in a TRemotable descendant, or an other workaround?


Many thanks in advance!
-- 
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
0
Michael
9/8/2008 5:22:37 PM
embarcadero.delphi.webservices 976 articles. 0 followers. Follow

5 Replies
1132 Views

Similar Articles

[PageSpeed] 5

<div id="jive-html-wrapper-div">
<br />
<DIV><FONT face="Arial" size="2">Hello Michael,</FONT></DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2">I took a quick peek at the WSDL and the bindings <br />
generated by the importer and indeed the importer is generating incorrect code. <br />
I have not tested this but I would expect the importer to generate something <br />
along the lines of the following for SetQueueAttributes:</FONT></DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" color="#808080" size="1">//&nbsp; SetQueueAttributes = <br />
array of Attribute;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { "</FONT><A href="http://queue.amazonaws.com/doc/2008-01-01/"[Lit][GblElm"><FONT face="Courier New" color="#808080" size="1"><a class="jive-link-external" href="http://queue.amazonaws.com/doc/2008-01-01/">http://queue.amazonaws.com/doc/2008-01-01/</a>"[Lit][GblElm</FONT></A><FONT face="Courier New" color="#808080" size="1">] }<BR></FONT></DIV>
<DIV><FONT face="Courier New" size="1">&nbsp; Array_Of_Attribute = array of <br />
Attribute;</FONT></DIV>
<DIV><FONT face="Courier New" size="1"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size="1">&nbsp; SetQueueAttributes = <br />
class(TRemotable)<BR>&nbsp; private<BR>&nbsp;&nbsp;&nbsp; FAttribute: <br />
Array_Of_Attribute;<BR>&nbsp; published<BR>&nbsp;&nbsp;&nbsp; property <br />
Attribute: Array_Of_Attribute index (IS_REF or IS_UNBD) read FAttribute write <br />
FAttribute;<BR>&nbsp; end;<BR></FONT></DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2">The resulting XML would then look something <br />
like:</FONT></DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2">&lt;?xml <br />
version="1.0"?&gt;<BR>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="<A href="http://schemas.xmlsoap.org/soap/envelope/"><a class="jive-link-external" href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a></A>" <br />
xmlns:xsd="<A href="http://www.w3.org/2001/XMLSchema"><a class="jive-link-external" href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a></A>" <br />
xmlns:xsi="<A href="http://www.w3.org/2001/XMLSchema-instance"><a class="jive-link-external" href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a></A>"&gt;<BR>&nbsp; <br />
&lt;SOAP-ENV:Body&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;SetQueueAttributes xmlns="<A href="http://queue.amazonaws.com/doc/2008-01-01/"><a class="jive-link-external" href="http://queue.amazonaws.com/doc/2008-01-01/">http://queue.amazonaws.com/doc/2008-01-01/</a></A>"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&lt;Attribute&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&lt;Name&gt;VisibilityTimeout&lt;/Name&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&lt;Value&gt;40&lt;/Value&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&lt;/Attribute&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/SetQueueAttributes&gt;<BR>&nbsp; <br />
&lt;/SOAP-ENV:Body&gt;<BR>&lt;/SOAP-ENV:Envelope&gt;<BR></FONT></DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2">I'll investigate this some more and post my <br />
findings here.</FONT></DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2">Cheers,</FONT></DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2"></FONT>&nbsp;</DIV>
<DIV><FONT face="Arial" size="2">Bruneau</FONT></DIV>
</div>
0
Jean
9/9/2008 8:48:58 PM
Jean-Marie Babet wrote:

> Hello Michael,
>  
> I took a quick peek at the WSDL and the bindings
> generated by the importer and indeed the importer is generating incorrect code.
> I have not tested this but I would expect the importer to generate something
> along the lines of the following for SetQueueAttributes:
>  
>  
> //  SetQueueAttributes =
> array of Attribute;      { " 
> <http://queue.amazonaws.com/doc/2008-01-01/>http://queue.amazonaws.com/doc/2008-01-01/"[Lit][GblElm] 
> }
>   Array_Of_Attribute = array of
> Attribute;
>  
>   SetQueueAttributes =
> class(TRemotable)
>   private
>     FAttribute:
> Array_Of_Attribute;
>   published
>     property
> Attribute: Array_Of_Attribute index (IS_REF or IS_UNBD) read FAttribute write
> FAttribute;
>   end;
>  

Many thanks for the suggested change of the code! I will try to add this 
in the generated source tomorrow, if it works fine I will let you know.

-- 
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
0
Michael
9/12/2008 4:16:50 PM
Jean-Marie Babet wrote:

> I took a quick peek at the WSDL and the bindings
> generated by the importer and indeed the importer is generating incorrect code.
> I have not tested this but I would expect the importer to generate something
> along the lines of the following for SetQueueAttributes:

This works, perfect!

Many thanks for your help

Best Regards
-- 
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
0
Michael
9/13/2008 9:16:02 AM
Thanks for the follow up post. I've made a note to remedy this. If time 
allows and you can open a QC, that would be great: It would allow me to make 
a case to fix this in an update. Thank you.

Cheers,

Bruneau
0
Jean
9/15/2008 1:38:38 AM
Jean-Marie Babet wrote:
> Thanks for the follow up post. I've made a note to remedy this. If time 
> allows and you can open a QC, that would be great: It would allow me to make 
> a case to fix this in an update. Thank you.

No problem - I have reported it in QC as # 66800 now

Best Regards
Michael Justin
0
Michael
9/15/2008 6:43:25 PM
Reply:

Similar Artilces:

ANN: Habari SQS Client
Habari SQS Client for Delphi(tm) is a client library for the Amazon Simple Queue Service. It is easy to use and includes full source code and one year free upgrades. About Amazon Simple Queue Service: Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable, hosted queue for storing messages as they travel between computers. By using Amazon SQS, developers can simply move data between distributed components of their applications that perform different tasks, without losing messages or requiring each component to be always available. Amazon SQS makes it ...

ANN: Habari SQS Client for Amazon Simple Queue Service
Habari client libraries provide access to message oriented middleware solutions for cross-platform, cross-language software integration. Habari SQS Client for Delphi(tm) is a client library for the Amazon Simple Queue Service, using the SOAP interface of Amazon SQS. It supports Delphi 2007 and 2009, and includes full source code and a royalty-free license. A demo application with full API documentation is available at http://www.mikejustin.com/habari.html Amazon Simple Queue Service (Amazon SQS) offers a reliable, highly scalable hosted queue for storing messages as they travel bet...

WSDL Importer errors for Amazon Simple Queue Service (SQS)
Hello, for the new Amazon WSDL (2009-02-01), in the generated QueueService.pas there is a type declaration: DeleteQueue = array of Attribute; and a method MessageQueuePortType = interface(IInvokable) function DeleteQueue(const body: DeleteQueue): DeleteQueueResponse; stdcall; and no RemClassRegistry.RegisterXSClass(DeleteQueue, ...) The problem is now that a DeleteQueue action SOAP request contains the DeleteQueue element, but it does no longer contain the namespace attribute. It is not possible to add RemClassRegistry.RegisterXSClass(DeleteQueue, ...) becau...

Messaging using Amazon Simple Notification Service
This new service, released April 7 might be an interesting field for Delphi and Third Party developers: Amazon has just launched a cloud-based simple notification service (SNS). The new service allows developers to send push notifications to their users or applications via a number of protocols, including email. Currently supported protocols: * HTTP/HTTPS * Email/Email-JSON * SQS Here’s how it works: Developers identify up to 100 topics or types of events, decide who can publish or subscribe to messages, and then publish messages. Amazon SNS will then automatically noti...

How to access Windows/Azure Service Bus Queues from Delphi?
Hi, I want to integrate my existing Delphi application into a Windows/Azure Service Bus Queue, but I don´t know how. Are there any examples/tutorials? I´ve heard it shall be possible to access that queue by REST webservices, too. I know that it is possible to access the older MSQM queue from Delphi via COM object - maybe there is a similar solution for the Windows/Azure Service Bus Queue? Thank you! Patrick ...

Any where to offer services as Delphi/Delphi for PHP freelance developer?
Hi, I'm a freelance Software Engineer. One of many that in current difficult days, is pushing for self-employment... offering services as Business Analyst and Developer, using Delphi, Delphi for PHP, MySQL, PostgreSQL. Any where in this forum or other you might know where to offer these services to the world? Thank you, Guillermo Guillermo, The Delphi for PHP forum does have For Hire and Wanted For Hire sections if you haven't seen those yet: http://forums.delphi-php.net/ Thanks. -Phil > {quote:title=Guillermo Najar wrote:}{quote} > Hi, > > I&#...

Delphi Webservice
Hello, I have created one webservice using indy TIdHTTPWebBrokerBridge and also created the client. Now I need to way to pass some file which will be reside on my server path to the client thorugh SOAP. The picture is as follows: 1) I have some fastreport files on the server 2) The client will show those report on the client side. There will be no fr3 files in the client side. Also I don't want to use FastReport Client/Server technology, as my client does not want this. 3) I don't want to save the fr3 files in the client side also. How to call this report from Client...

Amazon webservice
I am trying to to set up an Amazon webservice with VWD 2005 using the GridView. I have found lots of samples using a DataGrid and I have only found samples of GridView being used with Sql Server. Does anyone have any idea how to do this or have a sample source. Thanks, I'm not exactly familar with this area, but couldn't you bind the XmlDataSource to the GridView the same way that you would for SqlDataSource? to bind the results back from amazon to the GridView?there should be absolutely no difference in syntax/methods to bind them to a DataGrid or GridView"If you make it idiot pr...

Consuming a .NET web service in Delphi 2010 using a service reference
Hi, I've been asked to modify one of my existing applications (D2010 Win32) to interact with a web service written under VS2010/.Net 4. The information I have so far is :- "As communication is secured by .NET WsHttpBinding data encrypting, In order to consume it you have to add to your application a Service Reference (not a web reference) that joins the service available at the URL: http://ctm.mobilling.it/SmsComApi/Sms.svc . Assuming that the binding created in your app.confing is named "WSHttpBinding_ISms" you have to instantiate a client as shown below: {c...

Problem upgrading web service client from Delphi 7 to Delphi XE
In trying to upgrade our web service client to Delphi XE we have now get a web service error of Invalid Format. When we examine the SOAP request we see the following differences from Delphi 7 vs Delphi XE In Delphi 7 we get <SomeStuff xmlns="" xsi:nil="true" /> In Delphi XE we get <SomeStuff xsi:nil="true" /> We have narrowed the failure down to these differences in the client request. Is there anyway to get Delphi XE to generate a SOAP request with the xmlns attribute set to blank as it used to be? Hello, > In trying to u...

Delphi 2010 webservice consumer pass null strings to webservice [Edit]
Hello, I need to consume a webservice that is developed in java ( thas all that I know ). I have a HTTPRIO componente and have import the webservice file win the WSDL importer. Til here everything is allright but when I run the application all the parameters reach the webservice as null. I have made some webservice and consumers but I never have had problems ( I make the server and the client ) I test to do the same with prism and c++ bilder and it go allright, but I need it to do in delphi Thanks PD: Pleas be patient, my English is not good Edited by: Adrian Zussino on Sep 8, 2010 3...

simple web service query
Hi all, Im following the 'Using the WebService Behaviour' document from the msdn Library and am getting the message 'service unavailable' when running my page. Is there something I'm missing? thanks, Pete mWeb Design Nottingham, UK...

Has anyone successfully used a Delphi web service client against an ENCRYPTED WCF web service server?
Has anyone successfully used a Delphi web service client against an ENCRYPTED WCF web service server? Which is to say, of course, that the URL would be starting with https. Anyone? ...

Error get when use amazon web service : unable to automatically step into the server soap.amazon.com
default.aspx page contains one button and one textboxthis code i use for find list of books using amazon web services. web service link :  http://soap.amazon.com/schemas3/AmazonWebServices.wsdlprotected void Button1_Click(object sender, EventArgs e) { KeywordRequest keywordReq = new KeywordRequest();ProductInfo productinfo = null; keywordReq.locale = "us";keywordReq.type = "lite"; keywordReq.sort = "reviewrank";keywordReq.mode = "Books"; keywordReq.keyword = this.TextBox1.Text; //keywordReq.tag = "XXXXXXXXXXXXXXXXX"; //keywo...