|
Home > Archive > BizTalk Server Orchestration > April 2006 > passing authentication through Orchestration
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
passing authentication through Orchestration
|
|
| Sourav Dutta Gupta 2006-04-01, 2:37 pm |
| Hi,
Below is a simple .Net application to call a web service
using System;
using System.Xml;
using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Security.Tokens;
private void CallService()
{
ServiceProxy.ServiceWse service = new ServiceProxy.ServiceWse();
service.Url =
"http://webservices.onlinetravel.com/trading/accommodation/service.asmx";
service.RequestSoapContext.Security.Tokens.Add(
new UsernameToken("{username}", "{password}",
PasswordOption.SendHashed)
);
XmlDocument document = new XmlDocument();
document.LoadXml("<accommodation
xmlns=’http://schema.onlinetravel.com/trading/’
xmlns:otc.service=’http://schema.onlinetravel.com/service/’ />");
XmlNode response = service.Request(document);
}
Now I want to do the same request through my orchestration.
When I add the web service in my biztalk application, I could get set the
request message as msg_request.document
this solved my request portion, i.e.,
XmlDocument document = new XmlDocument();
document.LoadXml("<accommodation
xmlns=’http://schema.onlinetravel.com/trading/’
xmlns:otc.service=’http://schema.onlinetravel.com/service/’ />");
XmlNode response = service.Request(document);
The other portion is my authentication portion i.e.,
service.RequestSoapContext.Security.Tokens.Add(
new UsernameToken("{username}", "{password}",
PasswordOption.SendHashed)
);
How to add service.RequestSoapContext.Security.Tokens in my orchestration.
thanks & regards
sourav.
| |
| Matt Milner 2006-04-01, 2:37 pm |
| You need to set the soap header manually. Take a look at the docs as they
have a good explanation of how to set soap headers from orchestration. You
might want to use Fiddler or some other tracing utility to see your message
so that you know what namespace and header values to send etc.
If you are signing and encypting your message using WSE, then you'll
probably want to either A) use the WSE 2 adapter for BizTalk, or B) use
BizTalk 2006 and create your own proxy class that you can specify on the
send port.
Matt
"Sourav Dutta Gupta" <SouravDuttaGupta@discussions.microsoft.com> wrote in
message news:B075306C-78A0-4443-9F61-8519030AE3EF@microsoft.com...
> Hi,
>
> Below is a simple .Net application to call a web service
>
> using System;
> using System.Xml;
>
> using Microsoft.Web.Services3;
> using Microsoft.Web.Services3.Security.Tokens;
>
> private void CallService()
> {
> ServiceProxy.ServiceWse service = new ServiceProxy.ServiceWse();
> service.Url =
> "http://webservices.onlinetravel.com/trading/accommodation/service.asmx";
>
> service.RequestSoapContext.Security.Tokens.Add(
> new UsernameToken("{username}", "{password}",
> PasswordOption.SendHashed)
> );
>
> XmlDocument document = new XmlDocument();
> document.LoadXml("<accommodation
> xmlns='http://schema.onlinetravel.com/trading/'
> xmlns:otc.service='http://schema.onlinetravel.com/service/' />");
>
> XmlNode response = service.Request(document);
> }
>
>
> Now I want to do the same request through my orchestration.
>
> When I add the web service in my biztalk application, I could get set the
> request message as msg_request.document
>
> this solved my request portion, i.e.,
>
> XmlDocument document = new XmlDocument();
> document.LoadXml("<accommodation
> xmlns='http://schema.onlinetravel.com/trading/'
> xmlns:otc.service='http://schema.onlinetravel.com/service/' />");
>
> XmlNode response = service.Request(document);
>
> The other portion is my authentication portion i.e.,
>
> service.RequestSoapContext.Security.Tokens.Add(
> new UsernameToken("{username}", "{password}",
> PasswordOption.SendHashed)
> );
>
> How to add service.RequestSoapContext.Security.Tokens in my orchestration.
>
> thanks & regards
> sourav.
>
>
|
|
|
|
|