I am trying to set an email for follow up using the EWS managed api. I followed these links Link1
and Link2
for some guidance but it still i am sure i am missing many things here. The xml i send for updating flagstatus is
I have already put up a question to msdn support
i am sending this sample xml for it
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013"></t:RequestServerVersion>
</soap:Header>
<soap:Body>
<UpdateItem ConflictResolution="AutoResolve" MessageDisposition="SaveOnly">
<ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAMkAGEyNzAwYzc3LTkwZTgtNGI2MC05MzVkLTNjMjQzYTgyODc2OQBGAAAAAAA3WMO+ZnF/QrCdez0LEjxsBwB2Nkz9SQDSSozr39zl7KzqAAAAAAENAAB2Nkz9SQDSSozr39zl7KzqAACdlFOTAAA=" ChangeKey="CQAAABYAAAB2Nkz9SQDSSozr39zl7KzqAACdnI3c"></t:ItemId>
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI="message:IsRead"></t:FieldURI>
<t:Message>
<t:ExtendedProperty>
<ExtendedFieldURI PropertyTag="0x1090" PropertyName="FlagRequest" PropertyId="0" PropertyType="String"></ExtendedFieldURI>
<Value>2</Value>
<Values></Values>
</t:ExtendedProperty>
<t:IsRead>false</t:IsRead>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</ItemChanges>
</UpdateItem>
</soap:Body>
Using this i am getting "The request failed schema validation" as i am sure there a lot many things i need to properly while setting the extended property type.
I have looked up over google and in msdn forum but am still unclear what needs to be done to achieve it.
Can some one please explain, possibly in detail, how this can be done? Whether the way i am updating the item as in xml above is totally wrong or it misses some basic idea.
Thanks
Madhur
This worked for me:
</soap:Header>
<soap:Body>
<m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAAkAGFzaHJhZmFud2FyQG1pc3FhdGFyLm9ubWljcm9zb2Z0LmNvbQBGAAAAAADebl5aE9iCT5TWghrsI/MnBwDm30SftRRfT5FqZfPmjZoaAAAAAAEMAADm30SftRRfT5FqZfPmjZoaAACkgPgNAAA=" ChangeKey="CQAAABYAAADm30SftRRfT5FqZfPmjZoaAACkiiHb" />
<t:Updates>
<t:SetItemField>
<t:ExtendedFieldURI PropertyTag="0x1090" PropertyType="Integer" />
<t:Message>
<t:ExtendedProperty>
<t:ExtendedFieldURI PropertyTag="0x1090" PropertyType="Integer" />
<t:Value>2</t:Value>
</t:ExtendedProperty>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
Related
I"m trying to connect to a SOAP API using Savon.
The WSDL shows this:
wsdl:operation name="CustomerList" parameterOrder="Username Password Settings">
<wsdl:input message="impl:CustomerListRequest" name="CustomerListRequest"/>
<wsdl:output message="impl:CustomerListResponse" name="CustomerListResponse"/>
</wsdl:operation>
Customer Support says to use a request such as this:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ei2="http://ei2.nobj.nable.com/">
<soap:Header/>
<soap:Body>
<ei2:customerList>
<!--Optional:-->
<ei2:username>testaccount#n-able.com</ei2:username>
<!--Optional:-->
<ei2:password>!PDf2lfij23l!!</ei2:password>
<!--Zero or more repetitions:-->
<ei2:settings>
<!--Optional:-->
<ei2:key>null</ei2:key>
<!--Optional:-->
<ei2:value>null</ei2:value>
</ei2:settings>
</ei2:customerList>
</soap:Body>
</soap:Envelope>
This is my request:
{"SOAPAction"=>"\"CustomerList\"", "Content-Type"=>"text/xml;charset=UTF-8", "Content-Length"=>"452"}
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:impl="http://www.n-able.com/mickey" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<impl:CustomerList>
<username>test#test.com</username>
<password>MytestPassword1234</password>
<settings>
<listSOs>false</listSOs>
</settings>
</impl:CustomerList>
</env:Body>
</env:Envelope>
The difference is that the WSDL which Savon consumes and generates methods to call off of, is making my request send CustomerList instead of the customerList the API seems to be expecting.
Is there a way to force Savon to send CustomerList instead of customerList without constructing the entire SOAP Request by hand?
Edit 1
Found the answer in this Github Issue. https://github.com/savonrb/savon/issues/530
By adding the following to a gemspec, I was able to get a well formed request:
spec.add_runtime_dependency 'savon', '~> 2.3'
spec.add_runtime_dependency 'wasabi', '~> 3.2'
include one of those when you build your client:
convert_request_keys_to :camelcase # or one of [:lower_camelcase, :upcase, :none]
or work without the WSDL and hand code the call with 'strings'.
All,
I am having issues with calling DiscoveryService for MSCRM ONPremise
I downloaded DiscoveryWSDL file from MSCRM UNDER
Customizations > Developer Resources > Discovery Service WSDL
I uploaded that WSDL on SOAP UI, and when I execute SOAP call I get
"ERROR:Exception in request: java.net.SocketTimeoutException: Read timed out"
Any thoughts?
SOAP CALL
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<Execute >
<Request xsi:type="RetrievePolicyRequest" />
</Execute>
</soap:Body>
Thanks,
Nitesh
I'm attempting to use soap4r (from https://github.com/mumboe/soap4r) to write a SOAP Client for a product called SysAid.
I have a working example of the SOAP client in Java and, for most methods, my Ruby client works too. The Java client is useful in determining errors with the Ruby version.
I'm receiving an error when I use a particular call:
SOAP::FaultError: prefix xs is not bound to a namespace
Here's the message that soap4r sent, which generated that error:
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<n1:save xmlns:n1="http://api.ilient.com/">
<sessionId>1339292997261</sessionId>
<apiSysObj xsi:type="n1:apiServiceRequest">
<customDateFields></customDateFields>
<customFields>
<entry>
<key xsi:type="xs:string">sr_cust_dafis_fau</key>
<value xsi:type="xs:string"></value>
</entry>
<entry>
<key xsi:type="xs:string">sr_cust_activity</key>
</entry>
</customFields>
<description>This is the description of the ticket.</description>
</apiSysObj>
</n1:save>
</env:Body>
</env:Envelope>
And here is what Java sends for the same method, which the server does not complain about:
<?xml version="1.0" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:save xmlns:ns2="http://api.ilient.com/">
<sessionId>1339199684324</sessionId>
<apiSysObj xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:apiServiceRequest">
<customDateFields/><customFields>
<entry>
<key xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">sr_cust_dafis_fau</key>
<value xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string"></value>
</entry>
<entry>
<key xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">sr_cust_activity</key>
</entry>
</customFields>
<description>This is the description of the ticket.</description>
</apiSysObj>
</ns2:save>
</S:Body>
</S:Envelope>
As you can see, the error is coming from the customFields tag. soap4r is leaving out the xmlns:xs attribute on the key tag, while Java is putting it in.
soap4r does not make critical errors like this on any other method call as far as I can tell.
How can I get soap4r to add this needed attribute to the key tag?
I think the namespace "xmlns:xsd="http://www.w3.org/2001/XMLSchema" has been defined in the "env:Envelope", the problem is why in the body soap4r uses "xs:string" instead of "xsd:string".
Using the savon gem, I get the following request XML:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="URL"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ins0="SOME URL">
<soap:Body>
<ins0:Test xmlns="SOME URL">
</ins0:Test>
</soap:Body>
</soap:Envelope>
But it needs to be this instead:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="URL"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Test xmlns="SOME URL">
</Test>
</soap:Body>
</soap:Envelope>
Notice ins0 was removed.
Any suggestions?
The two XML documents are equivalent, so there should be no issues as long as the document is parsed by an XML compliant agent.
The Savon generated document is simply creating a namespace prefix of ins0 for the "SOME URL" namespace. This is convenient for a large SOAP document with many elements from that namespace. In this example, the prefix is not really necessary.
The only potential issue I can see is that the Savion generated document seems to declare the ins0 namespace twice - once in the soap:Envelope and then again in the soap:Body. Seems superfluous and potentially open to error.
I'm running into some issues doing a describeSObject call from a ruby on rails application using Savon. Could someone share an example of what my soap body should look like either from past experience with the salesforce partner api or general wsdl knowledge?
Here's what my application is generating:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:wsdl="urn:partner.soap.sforce.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ins0="urn:partner.soap.sforce.com" xmlns:ins1="urn:fault.partner.soap.sforce.com" xmlns:ins2="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<wsdl:SessionHeader>
<wsdl:sessionId>REMOVED</wsdl:sessionId>
</wsdl:SessionHeader>
</env:Header>
<env:Body>
<ins0:describeSObjects>
<wsdl:object1>Action_Plans_Settings__c</wsdl:object1>
<wsdl:object2>QuoteLineSyncField__c</wsdl:object2>
</ins0:describeSObjects>
</env:Body>
</env:Envelope>
I know this isn't correct, but I'm having trouble figuring out from the wsdl alone what the final soap body would look like. I've browsed the salesforce forums and docs without much luck.
Here's the wsdl definition for this operation, perhaps some wsdl gurus can figure this out based on it:
<operation name="describeSObjects">
<documentation>Describe a number sObjects</documentation>
<input message="tns:describeSObjectsRequest"/>
<output message="tns:describeSObjectsResponse"/>
<fault message="tns:InvalidSObjectFault" name="InvalidSObjectFault"/>
<fault message="tns:UnexpectedErrorFault" name="UnexpectedErrorFault"/>
</operation>
<message name="describeSObjectsRequest">
<part element="tns:describeSObjects" name="parameters"/>
</message>
<element name="describeSObjects">
<complexType>
<sequence>
<element name="sObjectType" type="xsd:string" minOccurs='0' maxOccurs='100' />
</sequence>
</complexType>
</element>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:partner.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>someSessionId</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<urn:describeSObjects>
<urn:sObjectType>Account</urn:sObjectType>
<urn:sObjectType>Contact</urn:sObjectType>
</urn:describeSObjects>
</soapenv:Body>
</soapenv:Envelope>