cancel
Showing results for 
Search instead for 
Did you mean: 

SAP API Management Trial – Connecting on-prem issue with SOAP

0 Kudos

It works very well with an Odata service. However I have struggled to do the same thing with an existing SOAP Enterprise Service. However when I am adding a resource(operation) I can’t save the API without getting an error:

“Unable to register API” and [Request ID: 0ef2d71f-cf76-4818-a1bb-c543d1235f0e]
String index out of range: 0

It seems it’s related to the adding of the resource since I have no problem saving it without a resource but then I get the service unavailable respone when testing of course.

What could possibly be wrong?

Janne

ElijahM
Advisor
Advisor
0 Kudos

Hi Jan,

Apologies for the late reply. Can you give a little more information? You are adding a SOAP service via the Cloud Connector? When you create the SOAP service you are creating it as SOAP and pointing to the resource endpoint?

Regards,
Elijah

0 Kudos

Hi Elijah,

Well, maybe I should be more general. I haven't seen any example where you expose an "onprem" SOAP-service and must say I don't know how to achieve it or even if it's possible. I have tried by creating both a SOAP and a REST API but the only way to have it connected to a onPrem service is to specify an API-provider.

I tried that, pretty much by looking at this article but with an API-provider pointing to the onPrem endpoint through Hana Cloud Connector.

https://blogs.sap.com/2016/03/12/sap-api-management-soap-to-rest/

Now, I'm coming further but getting a 502-error message when trying to send the SOAP-message:

{
"fault":{
"faultstring":"Unexpected EOF",
"detail":{
"errorcode":"messaging.adaptors.http.UnexpectedEOF"
}
}
}

My message looks like this:

<AssignMessage async="false" continueOnError="true" enabled="true" xmlns='http://www.sap.com/apimgmt'>
<!-- Sets a new value to the existing parameter -->
<Set>
<Headers>
<Header name="Content-Type">application/soap+xml; charset=utf-8</Header>
</Headers>
<Payload contentType="text/xml">
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<MaterialERPPriceAvailabilityQuery>
<SalesAndServiceBusinessArea>
<SalesOrganisationID>5058</SalesOrganisationID>
<DistributionChannelCode>01</DistributionChannelCode>
<DivisionCode>20</DivisionCode>
</SalesAndServiceBusinessArea>
<BuyerParty>10000003</BuyerParty>
<ProcessingTypeCode>Z1OR</ProcessingTypeCode>
<Materials>
<Material>
<ID>10</ID>
<OrderingCode>{OrderingCode}</OrderingCode>
<RequestedQuantity>1</RequestedQuantity>
<RequestedDate>2017-03-14</RequestedDate>
</Material>
</Materials>
</MaterialERPPriceAvailabilityQuery>
</soap:Body>
</soap:Envelope>
</Payload>
<Verb>POST</Verb>
</Set>
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

Is this at all doable?

Thanks in advance!

Janne

ElijahM
Advisor
Advisor
0 Kudos

Hi Janne,

Can you try clicking "Use SSL" in your API Provider? And let me know if this helps your EOF issue?

Regards,
Elijah

0 Kudos

Hi Elijah,

Many thanks, it works like a charm now!!!

Just curious why it isn't necessary for Odata-services?

Best Regards

Janne

Accepted Solutions (1)

Accepted Solutions (1)

ElijahM
Advisor
Advisor
0 Kudos

Hi Jan,

I am going to create this reply as an "Answer" so we can hopefully let others know as well. Please mark as accepted answer.

Currently the way the OnPremise connector is configured, if the target endpoint is expecting a different transport protocol than is given, it will return this error, as it is not finding the endpoint as configured. My guess is that for your OData service you were able to connect to it as a simple HTTP request, but the SOAP service either expected HTTPS, or had a configuration issue. I ran into a similar problem with my own Gateway system, which is how I reasoned out this issue (my system was fine for HTTP, but required HTTPS to connect via CC).

So in short, this is not necessarily a SOAP vs ODATA issue, but rather a backend configuration issue. Please note this is only for the Trial landscape, and has already been patched for Productive systems. There are discussions about rolling this out to trial as well (which is a larger undertaking to do).

Thank you for bringing this issue to our attention.

Regards,
Elijah

0 Kudos

Hi again Elijah,

Just a followup question: Is there a simple way to document my created "REST-service" which infact is an onprem SOAP service making the documentation available in the Developer portal? I guess I would have to somehow create a Resource but haven't been able to figure out how without creating a new API.

Best Regards

Janne

Answers (0)