Security

Reply
Occasional Contributor II

ClearPass Guest SOAP interface

Hi,

 

I'm trying to use the ClearPass SOAP interface but am running into a few issues.

 

I am coding in VB.NET and have imported the Service Referance from my ClearPass Guest as https://10.21.4.4/guest/soap_guestmanager.php?wsdl

 

I am able to use the Referance in my VB project and followed the guide to setting up a basic command.  Using Ping as an example i am getting an error complaining about "GET" used instead of "POST".  

 

Does anyone have any ideas?

 

VB Code

 

  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

 

 

        Dim client AsGuestManagerWebServiceClient = NewGuestManagerWebServiceClient

        client.ClientCredentials.UserName.UserName = "CaptivePortal"

        client.ClientCredentials.UserName.Password = "xxx"

 

 

        Dim PingRequest As New EmptyType()

        Dim PingResponse As New ResultType()

        ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf CertificateValidationCallBack)

        PingResponse = client.Ping(PingRequest)

        MsgBox(PingResponse.error)

 

    EndSub

 

    Function CertificateValidationCallBack( _

ByVal sender AsObject, _

ByVal certificate As X509Certificate, _

ByVal chain As X509Chain, _

ByVal sslPolicyErrors As SslPolicyErrors _

) AsBoolean

 

        ReturnTrue

    EndFunction

 

App.Config

 

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

    <startup>

        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />

    </startup>

    <system.serviceModel>

        <bindings>

            <basicHttpBinding>

              <binding name="GuestManagerSoapBinding" closeTimeout="00:01:00"

                       openTimeout="00:01:00" receiveTimeout="00:10:00"

                       sendTimeout="00:01:00"

                       allowCookies="false" bypassProxyOnLocal="false"

                       hostNameComparisonMode="StrongWildcard"

                       maxBufferSize="65536" maxBufferPoolSize="534288"

                       messageEncoding="Text" textEncoding="utf-8"

                       transferMode="Buffered"

                       useDefaultWebProxy="true">

                <security mode="TransportCredentialOnly">

                  <transport clientCredentialType="Basic"

                             proxyCredentialType="Basic"

                             realm="" />

                  <message clientCredentialType="UserName" algorithmSuite="Default" />

                </security>

              </binding>

              

                <binding name="GuestManagerSoapBinding1" />

            </basicHttpBinding>

        </bindings>

        <client>

            <endpoint address="http://10.21.4.4/guest/soap_service.php"

                binding="basicHttpBinding" bindingConfiguration="GuestManagerSoapBinding"

                contract="GuestManager.GuestManagerWebService" name="GuestManagerWebServicePort" />

        </client>

    </system.serviceModel>

</configuration>

 

Error on ClearPass Guest is:

 

Invalid SOAP request: HTTP method 'GET' is not POST
Client:    10.21.7.182:51038
Script:    /guest/soap_service.php
Function:  NwaSoapServiceMain
Arguments: array (
  'soap_action' => 'amigopod.guest.ping',
)
Details:   array (
  'headers' => array (
    'CONTENT_TYPE' => 'text/xml; charset=utf-8',
    'HTTPS' => 'on',
    'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
    'HTTP_CONNECTION' => 'Keep-Alive',
    'HTTP_HOST' => '10.21.4.4',
    'HTTP_SOAPACTION' => 'amigopod.guest.ping',
    'HTTP_USER_AGENT' => '',
    'HTTP_VSDEBUGGERCAUSALITYDATA' => 'uIDPo+RJgjmioWlGhettZ7ao/0QAAAAAaKv3ioWXQ0KCdRf4d8032IGcwbYuOQxFuyE8923pqb0ACQAA',
    'PHP_SELF' => '/guest/soap_service.php',
    'QUERY_STRING' => '',
    'REMOTE_ADDR' => '10.21.7.182',
    'REMOTE_PORT' => '51038',
    'REQUEST_METHOD' => 'GET',
    'REQUEST_TIME' => 1383766304,

 

Does anyone have any ideas?

 

Thanks!

 

MVP

Re: ClearPass Guest SOAP interface

Did you ever get this issue fixed Eric?

Koen (ACMX #351 | ACDX #547 | ACCP)

-- Found something helpful, important, or cool? Click the Kudos Star in a post.
-- Problem Solved? Click "Accept as Solution" in a post.
Contributor I

Re: ClearPass Guest SOAP interface

Hi, noticed this post and have a similar problem (?). I just dipping my toes in the water here and my code is not half as fancy as the sample above - I'm using powershell. However, I end up with the same error message "Invalid SOAP request: HTTP method 'GET' is not POST" . If someone can spot my (obvious) mistake, I would really appreciate your input!

 

/F

 

$user = "user"
$pass = "password"
$pair = "$($user):$($pass)"
$bytes = [System.Text.Encoding]::ASCII.GetBytes($pair)
$base64 = [System.Convert]::ToBase64String($bytes)
$basicAuthValue = "Basic $base64"
$headers = @{ Authorization = $basicAuthValue }

Invoke-WebRequest "http://server_ip/guest/soap_guestmanager.php" -Headers $headers -ContentType "text/xml" -InFile C:\Temp\xmlin.txt -OutFile c:\Temp\xmlout.txt -Method Post

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: