Hi,
I believe the format you are using for the Default HTTP Request Header is not correct.
As per this KB:
1. Try registering the service instance first with your Service Endpint URL and Service Endpoint URL WSDL specified.
2. After that, generate the SmartObjects from the service instance
3. One of the SmartObjects generated is the HTTP Header SmartObject. You can use that SmartObject to add items to serialized array (step 10 and 11 in KB).
4. Copy the entire serialized item obtained from above, then edit your service instance, and paste it into your Default HTTP Request Header field.
Thanks for the reply. I found the correct HttpHeader which is getting serialized correctly. Below is the header value that I am passing in.
{
"$type":"SourceCode.SmartObjects.Services.Endpoints.Common.HttpHeader[], SourceCode.SmartObjects.Services.Endpoints.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null",
"$values":[
{
"$type":"SourceCode.SmartObjects.Services.Endpoints.Common.HttpHeader, SourceCode.SmartObjects.Services.Endpoints.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null",
"Name":"Username",
"Value":"abcd"
},
{
"$type":"SourceCode.SmartObjects.Services.Endpoints.Common.HttpHeader, SourceCode.SmartObjects.Services.Endpoints.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null",
"Name":"Password",
"Value":"xxxx"
}
]
}
When I hit the smartobject service tester I am getting the error given below
The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm = "MetricsWebService"'
The service still thinks that I am not sending it the credentials. However when I send the username/password through the SOAP UI, it responds correctly.
Are the parameters that I am sending above correct? Do I need to send something else.
Thanks in Advance.
Was able to resolve this using the following HttpHeader
{
"$type":"SourceCode.SmartObjects.Services.Endpoints.Common.HttpHeaderr], SourceCode.SmartObjects.Services.Endpoints.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null",
"$values"::
{
"$type":"SourceCode.SmartObjects.Services.Endpoints.Common.HttpHeader, SourceCode.SmartObjects.Services.Endpoints.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null",
"Name":"Authorization",
"Value":"Basic Y249emFsaTAzLG91PXVzZXJzLG89ZGF0YTpQQDU1d29yZA=="
}
]
}