• Doug Schmidt
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
My custom app would like to know the public IP address of the client making a custom SOAP web service call.

I see that the RestRequest (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_restrequest.htm#apex_methods_system_restrequest) class exposes both a remoteAddress and headers property.

I'm looking for something similar in a custom SOAP web service. Is there an equivalent?

So if my API wanted to send a different response if called from a well-known IP (for example, Google's DNS), I would expect the code to look something like this:
webservice static string MyCustomApi(MyRequest request)
{
    return (SoapContext.Request.remoteAddress == "8.8.8.8")
        ? "Hello Google DNS"
        : "Hello, someone other than Google";
}

Is that possible? I can't find any documentation that says it is possible from SOAP, only from REST, and that seems rather unfortunate.
My custom app would like to know the public IP address of the client making a custom SOAP web service call.

I see that the RestRequest (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_restrequest.htm#apex_methods_system_restrequest) class exposes both a remoteAddress and headers property.

I'm looking for something similar in a custom SOAP web service. Is there an equivalent?

So if my API wanted to send a different response if called from a well-known IP (for example, Google's DNS), I would expect the code to look something like this:
webservice static string MyCustomApi(MyRequest request)
{
    return (SoapContext.Request.remoteAddress == "8.8.8.8")
        ? "Hello Google DNS"
        : "Hello, someone other than Google";
}

Is that possible? I can't find any documentation that says it is possible from SOAP, only from REST, and that seems rather unfortunate.