I just want to update the current_state of an order,
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<order>
<id>1</id>
<current_state>1</current_state>
</order>
</prestashop>
But the prestashop is asking me for all the mandatory fields of a Post when I use the put,
I tried using the exact same information than the put but it's loosing the total ammounts when I do the put,
Is there something wrong on prestashop architecture?
You must download all order information with get request. Then modify current_state field before make put request to update values. You can not just send only desired fields to update.
Check examples here: Prestashop Webservices Data Modification
Good luck
You can call the setWsCurrentState() on the order object. This function is defined in Order.php class file.
This function takes the ID of order state you want to set for the order.
Related
If I use the Fedex Tracking tool from website (https://www.fedex.com) I can see every activity with its details (like location). But, when I use Fedex Webservice, I don't get the same info. I only get detailed info for the current status, but I also need to get the details of previous statuses.
In the documentation is not described a flag or something I need to add to my request to retrieve the full info as in the Fedex Website.
Here's the SOAP Envelope I send in my request.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v16="http://fedex.com/ws/track/v16">
<soapenv:Header/>
<soapenv:Body>
<v16:TrackRequest>
<v16:WebAuthenticationDetail>
<v16:UserCredential>
<v16:Key>XXXXXXXXXXX</v16:Key>
<v16:Password>XXXXXXXXX</v16:Password>
</v16:UserCredential>
</v16:WebAuthenticationDetail>
<v16:ClientDetail>
<v16:AccountNumber>XXXXXXXXX</v16:AccountNumber>
<v16:MeterNumber>XXXXXXXXXXX</v16:MeterNumber>
</v16:ClientDetail>
<v16:TransactionDetail>
<v16:CustomerTransactionId>Track By Number_v16</v16:CustomerTransactionId>
<v16:Localization>
<v16:LanguageCode>EN</v16:LanguageCode>
<v16:LocaleCode>US</v16:LocaleCode>
</v16:Localization>
</v16:TransactionDetail>
<v16:Version>
<v16:ServiceId>trck</v16:ServiceId>
<v16:Major>16</v16:Major>
<v16:Intermediate>0</v16:Intermediate>
<v16:Minor>0</v16:Minor>
</v16:Version>
<v16:SelectionDetails>
<v16:CarrierCode>FDXE</v16:CarrierCode>
<v16:PackageIdentifier>
<v16:Type>TRACKING_NUMBER_OR_DOORTAG</v16:Type>
<v16:Value>783202918813</v16:Value>
</v16:PackageIdentifier>
<v16:PagingDetail></v16:PagingDetail>
<v16:SecureSpodAccount/>
<v16:Destination>
</v16:Destination>
</v16:SelectionDetails>
</v16:TrackRequest>
</soapenv:Body>
</soapenv:Envelope>
According to this documentation I found (page 606), you need to include a ProcessingOptions object on your TrackRequest with the value of INCLUDE_DETAILED_SCANS set to TRUE.
If FALSE (the default), the reply will contain
summary/profile data including current status.
If TRUE, the reply will contain profile and detailed scan
activity (multiple TrackDetail objects) for each package.
That translates to
<v16:ProcessingOptions>INCLUDE_DETAILED_SCANS</v16:ProcessingOptions>
in your SOAP request.
I am invoking Sharepoint's List Web services and using the getListItems() method. In particular, I am keen on specifying a CAML query because I really want it to just retrieve one item that I am specifically interested in. This I am doing by specifying a query in my XML string, in varying degrees of combinations, either by specifying the EncodedAbsUrl, the LinkFileName, the URL or the FileRef, with most results returning 0.
The XML query looks like this :
<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body><GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>{5cbc4407-3851-4e00-964a-bb7e9b430f9f}</listName> <viewName></viewName> <rowLimit>1000</rowLimit> <webID></webID>
**<query><Query><Where><Eq><FieldRef Name = "FileRef"/><Value Type = "Text">"/Shared%20Documents/Ashish/Word_feb27.doc"</Value></Eq></Where></Query></query>**
<viewFields><ViewFields><FieldRef Name="FSObjType"/><FieldRef Name="LinkFilename"/><FieldRef Name="UniqueId"/><FieldRef Name="FileRef"/><FieldRef Name="FileRef"/><FieldRef Name="EncodedAbsUrl"/><FieldRef Name="FileSizeDisplay"/><FieldRef Name="_UIVersionString"/><FieldRef Name="_owshiddenversion"/></ViewFields></viewFields></GetListItems> </S:Body></S:Envelope>
Without the tags this Soap request does infact work, and it retrieves all the items that area available in the List. The frustration begins when i specify the query tag. In particular the Following combinations have been attempted by me
FieldRef.name = {LinkFileName, EncodedAbsUrl, URL,FileRef} and Value.type = {Text, URL}
Either they yield results with no 0 fields in it or they return internal errors. I figure, this is a syntactical issue and would rather shoot this question to you guys who have probably dunnit in the past to see where I am possibly messing it up.
Thanks
I would recommend using CAML Query Builder and Fiddler. Query builder can connect SP using Web services and you can build the query with that. After you got your expected results, capture the Web service request with Fiddler and use it :)
BTW: Have you considered using Sharepoint Client Object model? You do not have to worry about SOAP messages.
Remove the <query><Query> tags.
I have an xsl file which I am currently grabbing all of the records from at once, starting them off as hidden and showing them as the user selects an id (<xsl:for-each select"">). The id value is currently being stored as a javascript variable selected by a user clicking that id.
I would like to use xQuery to grab the records, but only the records which match the ID the user has selected. Furthermore I generally understand the logic behind the rules in xQuery i just don't understand how to actually use it in my xsl file. Is it possible to use xQuery to maybe compare the value of the id(a js variable) to something using xQuery to grab only the records with that matching id?
Thank you for your time,
XQuery is a separate language from XSLT, not one that's embedded within XSLT. So depending on how you are launching XSLT, you can look for a parallel method for launching XQuery. For example, you may try XQIB (I have not tried it, but it looks promising).
If you need more help on that, let us know how you are running an XSLT processor, and what your data source is.
HOWEVER... It's not at all clear that XQuery is really what you want. It doesn't sound like you're wanting XQuery for something that you couldn't already do in XSLT. I'm not even sure you're not thinking of jQuery... which is a completely different animal.
It would be helpful if you could tell us more about where the records are coming from; what form they're stored in (an XML DOM?); and what you need to do with them. Probably the best solution then is that we show you how to do what you're trying to do within XSLT (or in Javascript).
Update
Looking at your new comment, I realize that I may have misunderstood where you are trying to run XQuery. You mentioned javascript above, from which I assumed you wanted to run XQuery in the browser, but now I think I jumped to the wrong conclusion - you are actually wanting to run it on the server maybe?
Regardless of where you're running it, either XSLT or XQuery can select "only the records which match the ID the user has selected". But if the XSLT/XQuery is running on the server, in order for this to work, you have to have either a page refresh or an AJAX call after the user selects an ID, to let the program on the server know what the selected ID is. I'm not sure if you already have that architecture set up, or if you're still trying to figure out how to use an AJAX call to retrieve data based on user input.
It sounds like you want to never send the whole set of records from server to client, not even initially (correct?). In that case, how does the user know what the set of available IDs is?
Anyway, you question may boil down to "How do you run XQuery from ASP.NET?" I have not tried to do that, but this article may help: Using Saxon.NET in ASP.NET; or this one: Querying XML Data with XQuery.
But again, I think XQuery may not be what you want. XQuery is not a querying language used within XSLT - that's more like XPath. XQuery is something you would use instead of XSLT, or beside it. So if you're using XSLT and you want to filter records according to what ID the user has selected, assuming you already know what ID the user has selected, the easy way to do that is within XSLT/XPath, rather than firing up a separate processor. E.g. you could say
<xsl:for-each select="//record[#ID = $usersChosenID]"> ...
Let me know if this is getting close to a solution for you. There are a variety of directions to expand this explanation, but I don't want to spend time scratching where there's no itch.
it seems that my response from a cxf implemented webservice contains a
<Action xmlns="http://www.w3.org/2005/08/addressing">urn://...dummy.../WebserviceResponse</Action>
Is there a way i can remove the urn and only keep the /WebserviceResponse or make the action empty?
<Action xmlns="http://www.w3.org/2005/08/addressing">/WebserviceResponse</Action>
The system that uses that uses our webservice fails on the urn on the action.
Got the answer via the CXF Mailinglist... All credits go to Daniel Kulp for providing the answer!
<quote>
If java first, you would need to add #Action annotations to the methods to
control the actions that are used and expected for the input and output (and
faults).
For wsdl first, you would need to add wsam:Action attributes to the
portType/operation/input and output elements. (which would result in the
above annotations being generated)
</quote>
in sharepoint webservices, I can use getListItems() to obtain the child elements of a list.
In a document library, sometimes the element is a folder.
"ows_FSObjType = 1"
Is there any way to ask SP for the child elements of this folder?
Querying with getListItems() using the folder ID gives me a SOAP Exception.
Edit:
I found that this webservice has got more method
Site Data Webservice
There is an "enumerate folder" method, which has got a "isFolder" property, but no method to recurse its contents.
Thank you, Sam. :)
On the GetListItems method, one of the optional parameters is an XMLNode called "QueryOptions". One of the elements you can put in that node is <Folder>.
So you should be able to pass in something like:
<QueryOptions>
<Folder>/My/Path/Here</Folder>
</QueryOptions>
I may be off a bit syntatically (didn't try to build and run a query when making this post), but the general idea should be sound. You can see more details on this in the MSDN GetListItems Reference.