How would I post the following soap envelope via a bash script.
In PHP I would post using cURL but don't know how to translate into bash?
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<n:Request xmlns:n="http://www.****.com/iprs/soap" env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" env:mustUnderstand="true">UserMod</n:Request>
</env:Header>
<env:Body>
<n:RequestUserMod xmlns:n="http://www.****.com/iprs/soap">
<n:UserID>****</n:UserID>
<n:UserData >
<n:SystemName>****</n:SystemName>
<n:AdminState>enabled</n:AdminState>
<n:CategoryTypeID>****</n:CategoryTypeID>
<n:Permissions>****</n:Permissions>
<n:BillingProgID>****</n:BillingProgID>
<n:DefaultGroupID>****</n:DefaultGroupID>
<n:PrimarySiteID>****</n:PrimarySiteID>
<n:SecondarySiteID>****</n:SecondarySiteID>
<n:ContactInfo></n:ContactInfo>
<n:Password>****</n:Password>
</n:UserData>
</n:RequestUserMod>
</env:Body>
</env:Envelope>
If possible I would also like to detect the response, which should be:
HTTP/1.1 200 OK
Content-Type:application/soap+xml; charset="utf-8"
Content-Length:509
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header>
<n:Response xmlns:n="http://www.*****.com/iprs/soap" env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" env:mustUnderstand="true">UserMod</n:Response>
</env:Header>
<env:Body>
<n:ResponseUserMod xmlns:n="http://www.*****.com/iprs/soap">
<n:StatusReport>
<n:Code>ok</n:Code>
<n:SubCode>0</n:SubCode>
</n:StatusReport>
</n:ResponseUserMod>
</env:Body>
</env:Envelope>
Perhaps like this?
curl --data - --request "POST" "http://www.somesite.com" <<EOF
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<n:Request xmlns:n="http://www.****.com/iprs/soap" env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" env:mustUnderstand="true">UserMod</n:Request>
</env:Header>
<env:Body>
<n:RequestUserMod xmlns:n="http://www.****.com/iprs/soap">
<n:UserID>****</n:UserID>
<n:UserData >
<n:SystemName>****</n:SystemName>
<n:AdminState>enabled</n:AdminState>
<n:CategoryTypeID>****</n:CategoryTypeID>
<n:Permissions>****</n:Permissions>
<n:BillingProgID>****</n:BillingProgID>
<n:DefaultGroupID>****</n:DefaultGroupID>
<n:PrimarySiteID>****</n:PrimarySiteID>
<n:SecondarySiteID>****</n:SecondarySiteID>
<n:ContactInfo></n:ContactInfo>
<n:Password>****</n:Password>
</n:UserData>
</n:RequestUserMod>
</env:Body>
</env:Envelope>
EOF
to post:
cat file | curl ...
but to retrieve the result, and act according to it, embed it all in a expect script.
Related
Using hazelcast 3.8.2 (hazelcast-all jar) + IMap+ mapstore + Spring 4.3.8 (xml config). In Spring xml config, 'hz:map-store' throws an error saying:
17:49:40.519 ERROR [main] org.springframework.test.context.TestContextManager – Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener#1868ed54] to prepare test instance [com.twc.ctg.ecp.service.dataaccess.maps.EntitlementMapTest#1b9ea3e3] org.xml.sax.SAXParseException: cvc-complex-type.2.1: Element 'hz:map' must have no character or element information item [children], because the type's content type is empty.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) ~[?:1.8.0_101]
What am I doing wrong?
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hz="http://www.hazelcast.com/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.hazelcast.com/schema/spring
http://www.hazelcast.com/schema/spring/hazelcast-spring.xsd">
<hz:hazelcast id="hzInstance1">
<hz:config>
...
</hz:config>
</hz:hazelcast>
<hz:client id="hzInstance1Client">
...
</hz:client>
<hz:map id="entitlementCache" instance-ref="hzInstance1" name="entitlement">
<hz:map-store enabled="true" implementation="linearEntitlementMapStore"
write-delay-seconds="30000"/>
</hz:map>
<bean id="linearEntitlementMapStore" class="com.twc.ctg.ecp.service.dataaccess.maps.LinearEntitlementMapStore" />
</beans>
You need to configure MapStore in <hz:config> section.
Correct config should look like this
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:hz="http://www.hazelcast.com/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.hazelcast.com/schema/spring
http://www.hazelcast.com/schema/spring/hazelcast-spring.xsd">
<hz:hazelcast id="hzInstance1">
<hz:config>
<hz:map name="entitlement">
<hz:map-store enabled="true" implementation="linearEntitlementMapStore"
write-delay-seconds="30000"/>
<!-- ... -->
</hz:map>
</hz:config>
</hz:hazelcast>
<hz:client id="hzInstance1Client">
<!--... -->
</hz:client>
<bean id="linearEntitlementMapStore" class="com.twc.ctg.ecp.service.dataaccess.maps.LinearEntitlementMapStore"/>
I've successfully created a phone call record in netsuite and related it to a company record. However, I haven't been able to relate a phone call to a contact record. Where am I going wrong?
Error
{
"message": "Invalid contact reference key 43780 for company <NULL>.",
"code": "INVALID_KEY_OR_REF"
}
Note: Internal ID 4370 is a contact in netsuite
Envelope with variables
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<applicationInfo xmlns="urn:messages_2015_2.platform.webservices.netsuite.com">
<applicationId>_appId_</applicationId>
</applicationInfo>
<preferences xmlns="urn:messages_2015_2.platform.webservices.netsuite.com">
<warningAsError>false</warningAsError>
</preferences>
</soap:Header>
<soap:Body>
<update xmlns="urn:messages_2015_2.platform.webservices.netsuite.com">
<record internalId="_callId_" xmlns:q1="urn:scheduling_2015_2.activities.webservices.netsuite.com" xsi:type="q1:PhoneCall">
<q1:message>_description_</q1:message>
<q1:title>_name_</q1:title>
<q1:assigned internalId="_user_" type="contact"/>
<q1:contact internalId="_customer_" type="contact"/>
<q1:phone>_number_</q1:phone>
<q1:startDate>_startDate_</q1:startDate>
<q1:endDate>_endDate_</q1:endDate>
<q1:timedEvent>true</q1:timedEvent>
</record>
</update>
</soap:Body>
</soap:Envelope>
We tried to Fedex shipping method in our opencart website.
It Display the "Error" text.
ERRORERRORcrs691The PurposeOfShipmentType is null, empty or invalid.
The PurposeOfShipmentType is null, empty or invalid.crs1000
Use this xml
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://fedex.com/ws/rate/v13">
<SOAP-ENV:Body>
<RateRequest>
<WebAuthenticationDetail>
<UserCredential>
<Key>XXXXX</Key>
<Password>XXXXX</Password>
</UserCredential>
</WebAuthenticationDetail>
<ClientDetail>
<AccountNumber>XXXXX</AccountNumber>
<MeterNumber>XXXXX</MeterNumber>
</ClientDetail>
<TransactionDetail>
<CustomerTransactionId>MY-RATE-REQUEST</CustomerTransactionId>
</TransactionDetail>
<Version>
<ServiceId>crs</ServiceId>
<Major>13</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<ReturnTransitAndCommit>true</ReturnTransitAndCommit>
<RequestedShipment>
<ShipTimestamp>2012-10-09T14:28:07.9489435+05:30</ShipTimestamp>
<DropoffType>REGULAR_PICKUP</DropoffType>
<PackagingType>YOUR_PACKAGING</PackagingType>
<Shipper>
<Address>
<StreetLines>Sardarnagar Main Road, Rajkot</StreetLines>
<City>Rajkot</City>
<StateOrProvinceCode>GJ</StateOrProvinceCode>
<PostalCode>360001</PostalCode>
<CountryCode>IN</CountryCode>
</Address>
</Shipper>
<Recipient>
<Address>
<StreetLines>Radhekrishna App. Main Road , Rajkot</StreetLines>
<City>Bhuj</City>
<StateOrProvinceCode>GJ</StateOrProvinceCode>
<PostalCode>370001</PostalCode>
<CountryCode>IN</CountryCode>
</Address>
</Recipient>
<ShippingChargesPayment>
<PaymentType>SENDER</PaymentType>
<Payor>
<ResponsibleParty>
<AccountNumber>XXXXX</AccountNumber>
</ResponsibleParty>
</Payor>
</ShippingChargesPayment>
<CustomsClearanceDetail>
<DutiesPayment>
<PaymentType>RECIPIENT</PaymentType>
</DutiesPayment>
<DocumentContent>NON_DOCUMENTS</DocumentContent>
<CustomsValue>
<Currency>INR</Currency>
<Amount>299.000000</Amount>
</CustomsValue>
<CommercialInvoice>
<Purpose>NOT_SOLD</Purpose>
</CommercialInvoice>
</CustomsClearanceDetail>
<RateRequestTypes>ACCOUNT</RateRequestTypes>
<RateRequestTypes>LIST</RateRequestTypes>
<PackageCount>1</PackageCount>
<RequestedPackageLineItems>
<SequenceNumber>1</SequenceNumber>
<GroupPackageCount>1</GroupPackageCount>
<Weight>
<Units>KG</Units>
<Value>1</Value>
</Weight>
</RequestedPackageLineItems>
</RequestedShipment>
</RateRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I'm using CURL to extract data from a sharepoint list. Now, I'm facing the problem that the data returned from sharepoint is double encoded (e.g. '>' does not become '>' but instead '>'). How can I work around this?
Example call:
POST /sites/00133/_vti_bin/Lists.asmx HTTP/1.1
User-Agent: curl/7.26.0
Host: team.sp.wp.intra.net
Accept: */*
Content-Type: text/xml; charset=utf8
SOAPAction: http://schemas.microsoft.com/sharepoint/soap/GetListItems
<?xml version='1.0' encoding='utf-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns4630='http://tempuri.org'>
<SOAP-ENV:Body>
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
<listName>{D44FAB23-172F-4756-B573-3E903D21F468}</listName>
<viewName>{79D163F7-3750-49DD-9782-AE9F15B35268}</viewName>
<queryOptions><QueryOptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns></QueryOptions></queryOptions>
<query><Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text">0023120112</Value></Eq></Where></Query></query>
</GetListItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Example resonse:
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.5
SPRequestGuid: 7ec7d0cc-2be3-4884-a54f-bb6883eb3584
X-SharePointHealthScore: 0
X-AspNet-Version: 2.0.50727
Persistent-Auth: true
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.7102
X-MS-InvokeApp: 1; RequireReadOnly
Date: Thu, 30 Jan 2014 12:22:17 GMT
Content-Length: 1967
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="h
ttp://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetListItemsResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<GetListItemsResult>
<listitems xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2 A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:rs='urn:schemas-microsoft-com:rowset' xmlns:z='#RowsetSchema'>
<rs:data ItemCount="1">
<z:row ows_LinkTitle='0023120112' ows_Issue_x0020_Name='Test' ows_Description='VPC --> please consider Attachment
' ows__ModerationStatus='0' ows__Level='1' ows_UniqueId='947;#{0FAF4F6D-7952-4771-86C2-81DC3CDB2EAF}' ows_FSObjType='947;#0' ows_Created_x0020_Date='947;#2014-01-07 07:27:04' ows_Modified='2014-01-30 13:10:19' ows_MetaInfo='947;#' ows_ID='947' ows_owshiddenversion='612' ows_Created='2014-01-07 07:27:04' ows_Title='0023120112' ows_FileLeafRef='947;#947_.000' ows_PermMask='0x7fffffffffffffff' ows_FileRef='947;#sites/00133/Lists/Post Go Live Issue Tracking/947_.000' />
</rs:data>
</listitems>
</GetListItemsResult>
</GetListItemsResponse>
</soap:Body>
</soap:Envelope>
Trying to set status Flag for an email using ActiveSync. Below is my request. I receive status 6. What's wrong with my request?
Request
<Sync xmlns="AirSync:" xmlns:email="Email:" xmlns:tasks="Tasks:" >
<Collections>
<Collection>
<SyncKey>648263900</SyncKey>
<CollectionId>11</CollectionId>
<GetChanges>0</GetChanges>
<Commands>
<Change>
<ServerId>11:2</ServerId>
<ApplicationData>
<email:Flag>
<email:Status>1</email:Status>
<email:FlagType>Follow Up</email:FlagType>
<tasks:StartDate>113-04-23T05:30:00.000Z</tasks:StartDate>
<tasks:UTCStartDate>113-04-23T05:30:00.000Z</tasks:UTCStartDate>
<tasks:DueDate>113-04-26T05:30:00.000Z</tasks:DueDate>
<tasks:UTCDueDate>113-04-26T05:30:00.000Z</tasks:UTCDueDate>
</email:Flag>
</ApplicationData>
</Change>
</Commands>
</Collection>
</Collections>
Response I receive
<?xml version="1.0"?>
<!DOCTYPE ActiveSync PUBLIC "-//MICROSOFT//DTD ActiveSync//EN" "http://www.microsoft.com/">
<Sync xmlns="AirSync:">
<Collections>
<Collection>
<SyncKey>648263900</SyncKey>
<CollectionId>11</CollectionId>
<Status>1</Status>
<Responses>
<Change>
<ServerId>11:2</ServerId>
<Status>6</Status>
</Change>
</Responses>
</Collection>
</Collections>
</Sync>
Change email:FlagType from Follow Up to for Follow Up.
And add </Sync> in the end.
Try:
<?xml version="1.0" encoding="utf-8"?>
<Sync xmlns="AirSync:" xmlns:email="Email:" xmlns:tasks="Tasks:" >
<Collections>
<Collection>
<SyncKey>648263900</SyncKey>
<CollectionId>11</CollectionId>
<GetChanges>0</GetChanges>
<Commands>
<Change>
<ServerId>11:2</ServerId>
<ApplicationData>
<email:Flag>
<email:Status>1</email:Status>
<email:FlagType>for Follow Up</email:FlagType>
<tasks:StartDate>113-04-23T05:30:00.000Z</tasks:StartDate>
<tasks:UTCStartDate>113-04-23T05:30:00.000Z</tasks:UTCStartDate>
<tasks:DueDate>113-04-26T05:30:00.000Z</tasks:DueDate>
<tasks:UTCDueDate>113-04-26T05:30:00.000Z</tasks:UTCDueDate>
</email:Flag>
</ApplicationData>
</Change>
</Commands>
</Collection>
</Collections>
</Sync>
See more: MS-ASEMAIL