SAP Knowledge Base Article - Public

3234789 - CMT : CPQ: How to run Soap 1.2 API Calls with CPQ for New Quote Web Method

Symptom

CPQ: How to run Soap 1.2 API Calls with CPQ for New Quote Web Method

Resolution

Applies To:  

CPQ


Summary:
This article is to show you how to fix API Calls using SOAP 1.2 within CPQ for New Quote Web Method.


Details:
When users are using soap 1.2. for API Call New Quote, they may encounter an error message, “object null reference error', from Soap response in return. This happens because soap 1.2. propagates the namespace from the soap envelope.

Below is a sample API Request and Response for New Quote Web Method that will work on Soap 1.1 but not on Soap 1.2 due to the reason stated above:

API Request:

 

<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<NewQuote xmlns="http://webcominc.com/">
<username>username#domain</username>
<password>password</password>
<owner>username</owner>
<xml>
<Cart>
<MarketCode>USD</MarketCode>
<ShippingMethod>Standard Shipping</ShippingMethod>
<Crm><OpportunityId>testing</OpportunityId></Crm>
<Items>
<Item>
<Quantity>1</Quantity>
<CatalogueCode>000123456789</CatalogueCode>
</Item>
</Items>
<Properties></Properties>
<Customers></Customers>
</Cart>
</xml>
</NewQuote>
</soap12:Body>
</soap12:Envelope>

 

On Soap 1.2. API Response would be:

 

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<NewQuoteResponse xmlns="http://webcominc.com/">
<NewQuoteResult>
<Result xmlns="">
<Status>NOK</Status>
<Message>Quote is not created</Message>
<Error>
<ErrorCode>100000</ErrorCode>
<Description>Object reference not set to an instance of an object.</Description>
</Error>
</Result>
</NewQuoteResult>
</NewQuoteResponse>
</soap:Body>
</soap:Envelope>

 

Solution/Workaround:
In order to address this issue, users will have to put an empty namespace in the root node (xmlns="") of their xml input. 

Sample of a Soap 1.2 Request for "New Quote" web method is shown below:

                  <Cart xmlns="">
                     <MarketCode>USD</MarketCode>
                     <ShippingMethod>Standard Shipping</ShippingMethod>
                     <Crm><OpportunityId>testing</OpportunityId></Crm>
                     <Items>
                     <Item>
                    <Quantity>1</Quantity>
                    <CatalogueCode>000123456789</CatalogueCode>
                    </Item>
                    </Items>
                   <Properties><Properties />
                   <Customers><Customers />
                   </Cart>

 

Comments:
You can find more information here.

 

References:
SC30164758

Keywords

KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To

Product

SAP CPQ all versions