Exchange Web Services - cannot get additional properties when calling "FindPeople" method - web-services

I'm making raw SOAP requests to Office365 and trying to get a list of contacts for specified AddressListId I successfully get a list of contacts, but it does not include all additional information I need. Once I add some additional properties (e.g. PhoneNumber) to my request, the server returns Invalid shape error.
Here is my request:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
</soap:Header>
<soap:Body >
<m:FindPeople>
<m:PersonaShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="persona:DisplayName"/>
<t:FieldURI FieldURI="persona:PhoneNumber"/>
</t:AdditionalProperties>
</m:PersonaShape>
<m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="100" Offset="0"/>
<m:ParentFolderId>
<t:AddressListId Id="###-####-####-####"/>
</m:ParentFolderId>
</m:FindPeople>
</soap:Body>
</soap:Envelope>
How can I get all additional information for each persona?

I am using EWS Managed API, so you will have to search for the raw SOAP calls on MSDN, I can only direct your search a bit:
I had a similar problem, because the very same is applicable for FindAppointments(). Asking for AppointmentSchema.RequiredAttendees will raise the Invalid Shape error, and AppointmentSchema.Organizer won't contain the email address, only the name of the organizer, after using FindAppointments().
The solution was to do TWO requests to Exchange Server.
var appointments = calendarFolder.FindAppointments(BasePropertySet.FirstClassProperties);
exchangeService.LoadPropertiesForItems(appointments, MyAdvancedProperties);
I think that the same "workaround" is possible with FindPeople(), as well as every other Find%Itemtype%() EWS may support, I am not sure, though.
EDIT: I just found http://social.technet.microsoft.com/Forums/exchange/en-US/e83abfb1-37a8-48fe-9579-4e120fb77746/ews-managed-api-loadpropertiesforitems-returns-unexpected-end-of-xml-document?forum=exchangesvrdevelopment where it is stated that LoadPropertiesForItems does a call to raw soap GetItem with multiple ItemIDs.

Related

Sage 300 (accpac) SDATA: Create Order

I'm attempting to use the Sage SDATA Rest Service to create an order. So far I can't seem to find what components make up an order in oeorders. Here's the Endpoint that I'm trying to hit:
[POST] http://{company}/SDataServlet/sdata/sageERP/accpac/{org}/oeorders/
So, how do I figure out what elements are required in my payload?
Figured out what was going wrong. You have to use POST when shipping a new order, not PUT. The most minimal payload seems to be the following:
<entry xmlns:sdata="http://schemas.sage.com/sdata/2008/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.w3.org/2005/Atom">
<sdata:payload>
<oeorder xmlns="http://schemas.sage.com/sageERP">
<TERMS></TERMS>
<CUSTOMER></CUSTOMER>
</oeorder>
</sdata:payload>
</entry>

C++ XML-RPC Calling

I haven't seen any documentation for calling XML-RPC by inputing certain strings and get respone of some strings in c++ by connecting to an XML API. This is a documentation provided by the server. I can't figure out how to do this
A client can interact with a Pandorabot by POST'ing to:
http://www.pandorabots.com/pandora/talk-xml
The form variables the client needs to POST are:
botid - see H.1 above.
input - what you want said to the bot.
custid - an ID to track the conversation with a particular customer. This variable is optional. If you don't send a value Pandorabots will return a custid attribute value in the <result> element of the returned XML. Use this in subsequent POST's to continue a conversation.
This will give a text/xml response. For example:
<result status="0" botid="c49b63239e34d1d5" custid="d2228e2eee12d255">
<input>hello</input>
<that>Hi there!</that>
</result>
The <input> and <that> elements are named after the corresponding AIML elements for bot
input and last response.
If there is an error, status will be non-zero and there will be a human readable <message> element included describing the error.
For example:
<result status="1" custid="d2228e2eee12d255">
<input>hello</input>
<message>Missing botid</message>
</result>
The easiest way to communicate via HTTP in C++ is to use a library designed for that purpose. For example, libcurl provides all the facilities you would need to send and receive the kind of requests and responses you showed in the question.

Message part request was not recognized

I have developed a Webservice . It was working fine with SOAP UI
When the client tested it through APIGEE , it started giving
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Message part request was not recognized. (Does it exist in service WSDL?)</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Could anybody please tell me what might cause this ??
I am not sure, I got to this page googling for facing the same issue, the only answer I have found is here: http://prystash.blogspot.co.uk/2010/06/wsdls-and-message-parts-not-recognized.html, quoting:
The element declaration contained a reference to a complexType
instead of having the complexType defined within, or as part of, the
element declaration.

This XML file does not appear to have any style information associated with it

I have deployed my webservice into Tomcat.
The WSDL has got some operations like ViewOptions, but when I ran that, I got this error:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>1</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Why do we get this error?
The message isn't an "error" but rather a warning n need not be solved but ignored. An XML document is a data structure but does not contain any presentation/style information internally. Normally an XML document is used in inter-application communication or as a pure data structure that is then used with additional presentation/style information to display to users.
XML can be applied style by XSLT just as HTML by CSS and the above warning can be eradicated An eg: of applying xls to xml
We don't present xml using xls for RSS, Web Services as they are just used for communication without applying stylesheet rather than meant to be presented to user in browser.
So, everything is fine here.
what worked for my case. I replaced all the links of ... with window.open("...link", "_self") and changed
import {
HashRouter as Router,
} from 'react-router-dom';

What does "wsse:InvalidSecurity" mean?

An error was discovered processing the <wsse:Security> header
This is a WS-Security question btw...
I can't see anything wrong with my WS endpoint (apart from the fact that it's running in a TIBCO BW engine!). Does someone have any 'prior' with this kind of error? I realise that the WS-Security Header could be broken anywhere presumably to get this error but, there's GOT to be a 90% percentile on some kind of common error.
Here's the secured SOAP - the client is standalone java (WSS4J 1.5.0) performing signing only at this stage.
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-20237898">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#id-18414151">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>DvjhvAtEVxwntL/RjMCNhId57cg=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
YbOB3FRduCr5rutpIvch9sDZfZToy3pjm+Kyl/Oqz6cAPqMVKqvKBb4P7ebnzP/3SVjm+PfLqlE5
BGgcT3Vz93apyg+eY1rAIYUs7K1Zt9F5ejMmij6HQpQTGpyM9BUXJi1x5bt9GuMtD0SK939bIIE2
ZUyZ0jPJp/wUhMonskw=
</ds:SignatureValue>
<ds:KeyInfo Id="KeyId-15734641">
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STRId-3852606">
<ds:X509Data>
<ds:X509IssuerSerial>
<ds:X509IssuerName>CN=Mark Hesketh,OU=asdf,O=DVA,L=Canberra,ST=ACT,C=AU</ds:X509IssuerName>
<ds:X509SerialNumber>1231310305</ds:X509SerialNumber>
</ds:X509IssuerSerial>
</ds:X509Data>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</soapenv:Header>
<soapenv:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-18414151">
<message xmlns="http://www.tibco.com/schemas/CertificateWork/Resources/Schema.xsd" text="Sample msg with SHA1 signature"/>
</soapenv:Body>
</soapenv:Envelope>
Wow... if you're still having this problem, you have more patience than I... but just in case, here's my thoughts:
http://schemas.xmlsoap.org/specs/ws-security/ws-security.htm#ws-security__toc6201567 - suggests that this is a problem reading the tag.
One thing that sticks out to me is that I don't see a reference connecting the signature to the key info. Certainly, I would assume that the KeyInfo element is describing the certificate that used a private key to make the SignatureValue, but I don't see a peice of the XML that is telling the software that. I don't think including the KeyInfo is enough, there may have to be a link to it.
If not that, I'd double check this against the schema, and maybe an independant schema verifying source. An error at the header level makes me think format rather than content.
That's my first guess at this one, and it's just a guess without getting hands on with your system and trying a bunch of different things. If that doesn't work, this my general logical chain for this type of error:
Format - the XML correct according to the schema?
Signature - the signature needs three things: data, a key, a set of algorithms for making it. Check all three - is the data correct, is the key correct, are the algorithms appropriate for the key and for how the message will be handled? Also, are the key and data items referenced properly and being found by your library?
External sources of info - in this case, your key info references a certificate that presumably is pulled from somewhere else - like an LDAP cert store. So.. can your code get to that external source, is the source of data running and network accessible from where you are running the code? etc.
If PKI -- Certificate Validation/Trust - what does the system have to do behind the scenes to trust the signer? OCSP checks? Lookup in LDAP? Chain to trusted root? etc. Is the trust algorithm working properly and does it have everything it needs - ie, access to OCSP responder, properly configured certificate store, etc.
I reorder these steps based upon my guess on what the error means. The errors are not so intuitive -- so I often go through all these steps just in case my interpretation of the error is wrong. Besides, I may then prevent a problem later...
Check your SOAPAction in the Header. The value in the WSDL must be the same as in the call. A wrong value can cause an InvalidSecurity error.
In Java you can get the message as text with
soapMessage.getSOAPPart().getEnvelope();
Here you can check the values and settings.