INTRODUCTION
QUERY*IN
When you download a webservice .wsdl file and open its definition, you will find the available methods that can be used, such as FindByElements, FindByIdentification, FindByCommunicationData etc, that vary from which webservice you are using. Despite of it, all of them work exactly the same way, but for different purposes. In this example, I'll use the QueryCustomerIn webservice and its FindByElements method.
First of all, lets understand the basic request structure tags.
1 | Complete Structure | The node element and all its elements, its child node elements and all their elements will be returned. |
2 | Complete Node | The node element and all its elements will be returned. |
3 | Node with Key Elements | The node element and its key elements will be returned (not supported by all web service interfaces. |
4 | Excluded Node | The node element and its child node elements will not be returned. |
<soap:Envelope>
<soap:Header/>
<soap:Body>
<glob:CustomerByElementsQuery_sync>
<CustomerSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000012</LowerBoundaryInternalID>
</SelectionByInternalID>
</CustomerSelectionByElements>
</glob:CustomerByElementsQuery_sync>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Header/>
<soap:Body>
<glob:CustomerByElementsQuery_sync>
<CustomerSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000000</LowerBoundaryInternalID>
<UpperBoundaryInternalID>1000012</UpperBoundaryInternalID>
</SelectionByInternalID>
</CustomerSelectionByElements>
</glob:CustomerByElementsQuery_sync>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Header/>
<soap:Body>
<glob:CustomerByElementsQuery_sync>
<CustomerSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000000</LowerBoundaryInternalID>
<UpperBoundaryInternalID>1000012</UpperBoundaryInternalID>
</SelectionByInternalID>
<SelectionByInternalID>
<InclusionExclusionCode>E</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000011</LowerBoundaryInternalID>
</SelectionByInternalID>
</CustomerSelectionByElements>
</glob:CustomerByElementsQuery_sync>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Header/>
<soap:Body>
<glob:CustomerByElementsQuery_sync>
<CustomerSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000000</LowerBoundaryInternalID>
<UpperBoundaryInternalID>1000012</UpperBoundaryInternalID>
</SelectionByInternalID>
<SelectionByInternalID>
<InclusionExclusionCode>E</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000011</LowerBoundaryInternalID>
</SelectionByInternalID>
</CustomerSelectionByElements>
<RequestedElements customerTransmissionRequestCode="3">
<Customer addressInformationTransmissionRequestCode="1"/>
</RequestedElements>
</glob:CustomerByElementsQuery_sync>
</soap:Body>
</soap:Envelope>
<soap:Envelope>
<soap:Header/>
<soap:Body>
<glob:CustomerByElementsQuery_sync>
<CustomerSelectionByElements>
<SelectionByInternalID>
<InclusionExclusionCode>I</InclusionExclusionCode>
<IntervalBoundaryTypeCode>3</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000000</LowerBoundaryInternalID>
<UpperBoundaryInternalID>1000012</UpperBoundaryInternalID>
</SelectionByInternalID>
<SelectionByInternalID>
<InclusionExclusionCode>E</InclusionExclusionCode>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryInternalID>1000011</LowerBoundaryInternalID>
</SelectionByInternalID>
</CustomerSelectionByElements>
<ProcessingConditions>
<QueryHitsMaximumNumberValue>1</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
<RequestedElements customerTransmissionRequestCode="2">
<Customer addressInformationTransmissionRequestCode="1"/>
</RequestedElements>
</glob:CustomerByElementsQuery_sync>
</soap:Body>
</soap:Envelope>
* If QueryHitsUnlimitedIndicator is true the request will show an error because I want only one customer but there are more than one for the specified conditions. If you want all customers in the specified conditions, the processing conditions must be:
<ProcessingConditions>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
</ProcessingConditions>
All responses contains the following tag, that shows how many records have returned, whether there are more records available and the last record node ID:
<ProcessingConditions>
<ReturnedQueryHitsNumberValue>1</ReturnedQueryHitsNumberValue>
<MoreHitsAvailableIndicator>true</MoreHitsAvailableIndicator>
<LastReturnedObjectID>00163E162F981ED5B6FCD7D58739E476</LastReturnedObjectID>
</ProcessingConditions>
Considering this, if you want the next record, in the request, specify the LastReturnedObjectID.
<ProcessingConditions>
<QueryHitsMaximumNumberValue>1</QueryHitsMaximumNumberValue>
<QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
<LastReturnedObjectID>00163E0924E61EE5B49B609769B5146E</LastReturnedObjectID>
</ProcessingConditions>
<soap:Envelope>
<soap:Header/>
<soap:Body>
<glob:CustomerBundleMaintainRequest_sync_V1>
<BasicMessageHeader/>
<Customer actionCode="01" addressInformationListCompleteTransmissionIndicator="true">
<ObjectNodeSenderTechnicalID>SENDER_CUSTOMER_1</ObjectNodeSenderTechnicalID>
<CategoryCode>2</CategoryCode>
<ProspectIndicator>false</ProspectIndicator>
<CustomerIndicator>true</CustomerIndicator>
<LifeCycleStatusCode>2</LifeCycleStatusCode>
<Organisation>
<CompanyLegalFormCode>14</CompanyLegalFormCode>
<FirstLineName>COMPANY NAME</FirstLineName>
</Organisation>
<ContactAllowedCode>1</ContactAllowedCode>
<AddressInformation actionCode="01">
<ObjectNodeSenderTechnicalID>SENDER_ADDRESS_1</ObjectNodeSenderTechnicalID>
<AddressUsage actionCode="01">
<AddressUsageCode>XXDEFAULT</AddressUsageCode>
<DefaultIndicator>true</DefaultIndicator>
</AddressUsage>
<Address actionCode="01">
<CorrespondenceLanguageCode>PT</CorrespondenceLanguageCode>
<PostalAddress>
<CountryCode>BR</CountryCode>
<RegionCode>PR</RegionCode>
<CountyName>BRASIL</CountyName>
<CityName>Curitiba</CityName>
<DistrictName>CENTRO</DistrictName>
<StreetPostalCode>80000-000</StreetPostalCode>
<StreetName>R TEST</StreetName>
<AdditionalStreetSuffixName/>
<HouseID>225</HouseID>
</PostalAddress>
</Address>
</AddressInformation>
</Customer>
</glob:CustomerBundleMaintainRequest_sync_V1>
</soap:Body>
</soap:Envelope>
* The customer information won't change (actionCode="06")
* The address previously created won't be removed (addressInformationListCompleteTransmissionIndicator="false").
* Now it's mandatory to specify the customer key.
<soap:Envelope>
<soap:Header/>
<soap:Body>
<glob:CustomerBundleMaintainRequest_sync_V1>
<BasicMessageHeader/>
<Customer actionCode="06" addressInformationListCompleteTransmissionIndicator="false">
<InternalID>1000058</InternalID>
<AddressInformation actionCode="01">
<ObjectNodeSenderTechnicalID>SENDER_ADDRESS_2</ObjectNodeSenderTechnicalID>
<AddressUsage actionCode="01">
<AddressUsageCode>XXDEFAULT</AddressUsageCode>
<DefaultIndicator>true</DefaultIndicator>
</AddressUsage>
<Address actionCode="01">
<CountryCode>BR</CountryCode>
<RegionCode>PR</RegionCode>
<CountyName>BRASIL</CountyName>
<CityName>Curitiba</CityName>
<DistrictName>CENTRO</DistrictName>
<StreetPostalCode>80000-000</StreetPostalCode>
<StreetName>R TEST 2</StreetName>
<AdditionalStreetSuffixName/>
<HouseID>225</HouseID>
</Address>
</AddressInformation>
</Customer>
</glob:CustomerBundleMaintainRequest_sync_V1>
</soap:Body>
</soap:Envelope>
<env:Envelope>
<env:Header/>
<env:Body>
<n0:CustomerBundleMaintainConfirmation_sync_V1>
<Log>
<MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>
<Item>
<TypeID>286(//APBP/R1/)</TypeID>
<CategoryCode>INC.BOI</CategoryCode>
<SeverityCode>3</SeverityCode>
<ReferenceObjectNodeSenderTechnicalID>SENDER_CUSTOMER_1</ReferenceObjectNodeSenderTechnicalID>
<Note>Business partner 1000058 already exists</Note>
</Item>
</Log>
</n0:CustomerBundleMaintainConfirmation_sync_V1>
</env:Body>
</env:Envelope>
<env:Envelope>
<env:Header/>
<env:Body>
<env:Fault>
<env:Code>
<env:Value>env:Receiver</env:Value>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">Web service processing error; more details in the web service error log on provider side (UTC timestamp 20160512004624; Transaction ID 00163E162F571EE685FB5E7780150450)</env:Text>
</env:Reason>
<env:Detail/>
</env:Fault>
</env:Body>
</env:Envelope>
<env:Envelope>
<env:Header/>
<env:Body>
<env:Fault>
<env:Code>
<env:Value>env:Receiver</env:Value>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">Authorization role missing for service "ServiceInterface http://sap.com/xi/A1S/Global ReadSalesPriceListIn <default> <default>", operation "Operation http://sap.com/xi/A1S/Global Read" (UTC timestamp 20160509191431; Transaction ID 00163E19BB2F1EE685C3483BF5E6CB73)</env:Text>
</env:Reason>
<env:Detail/>
</env:Fault>
</env:Body>
</env:Envelope>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 |