Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Passing username/password to published asmx orchestration
- This topic has 2 replies, 1 voice, and was last updated 9 years, 3 months ago by
community-content.
-
AuthorPosts
-
-
February 5, 2009 at 4:13 PM #21654
I have an orchestration published as an asmx web service. It will be called by a vendor using Unix.
I’d like to validate a userid/password in the orchestration (or perhaps it’s better to let IIS do it).
I added this code to my orch:
strSoapUsername = msgLoanDataPullReq(SOAP.Username);
strSoapPassword = msgLoanDataPullReq(SOAP.Password);Result was this message: There is no value associated with the property ‘SOAP.Username’ in the message.
This is how I tried to pass the data:
objClient.ClientCredentials.UserName.UserName =
“someuser”;
objClient.ClientCredentials.UserName.Password = “somepass”;My test harness is a C# VS2008 with a service reference.
I’ve been trying to follow the “Improving Web Services Security” (Chapter 13) doc from CodePlex.
Based on sample in Chapter 13, I changed app.config of client to this:
<security mode=”Transport”>
<transport clientCredentialType=”Basic” proxyCredentialType=”None” realm=”” />
<message clientCredentialType=”UserName” algorithmSuite=”Default” />
</security>This results in “The provided URI schema ‘http’ is invalid; expected ‘https’. So apparently, I have to use https, but would like to test without doing that.
Any ideas? I’d like to be able to test with the harness before attempting to test with the vendor.
Thanks,
Neal Walters -
February 6, 2009 at 10:51 AM #21658
So is message(SOAP.Username) only used to set the username when calling a SOAP service, or can it be used to receive a username?
I’m trying this type of code in C# to pass the SOAP username, but haven’t got it yet.
The following looks like it is setting WSE username, not SOAP username.I added the “exists” to check if SOAP.Username is coming to orchestration, and it’s not.
System.Net.HttpWebRequest request =
(System.Net.HttpWebRequest)System.Net.WebRequest.Create(
“http://localhost/MyOrchestrations_Proxy/ImagingInterfaceLoanDataPull.asmx“);string strSOAPRequestBody =
“<soap:Envelope xmlns:xsi=\”http://www.w3.org/2001/XMLSchema-instance\” xmlns:xsd=\”http://www.w3.org/2001/XMLSchema\” xmlns:soap=\”http://schemas.xmlsoap.org/soap/envelope/\“>” +
“<soap:Header>” +
“<wsse:Security xmlns:wsse=\”http://schemas.xmlsoap.org/ws/2002/07/secext\“>” +
” <wsse:UsernameToken>” +
” <wsse:Username>AUSER</wsse:Username>” +
” <wsse:Password Type=\”wsse:PasswordText\”>APassword</wsse:Password>” +
” </wsse:UsernameToken>” +
“</wsse:Security>” +
“</soap:Header>” +
“<soap:Body>” +
“<PortLoanDataPull xmlns=\”http://thornburgmortgage.com/mortgagecadence/webservice/\“>” +
” <LoanDataPull>” +
” <LoanID>” + strCenlarLoanId + “</LoanID>” +
” </LoanDataPull>” +
“</PortLoanDataPull>” +
“</soap:Body>” +
“</soap:Envelope>”;request.Method = “POST”;
//request.ContentType = “application/soap+xml; charset=utf-8”;
request.ContentType = “text/xml; charset=utf-8”;
request.ContentLength = strSOAPRequestBody.Length;System.IO.StreamWriter streamWriter = new System.IO.StreamWriter( request.GetRequestStream() );
streamWriter.Write( strSOAPRequestBody );
streamWriter.Close();System.IO.StreamReader streamReader = new System.IO.StreamReader(
request.GetResponse().GetResponseStream() );
string strResponse = “”;while (!streamReader.EndOfStream)
{
strResponse += streamReader.ReadLine();
}
streamReader.Close(); -
April 14, 2009 at 7:49 AM #22130
Did you get any answers of the questions you have put ? I am facing the same issue. I need to get the soap header user id and password to orchestration and pass it to calling another webservice from orchestration. Pls let me know if you find some solution of it.
Thanks
Jit
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.