tags:

views:

449

answers:

3

I've inherited a BizTalk 2006 applicaton that uses serveral SOAP ports to request data from a 3rd party web service. The web service is secured by "basic" authentication - username / password. After making a few enhancements to the application I deployed to an integration test server which has access to the 3rd party web service. The BizTalk app was unable to retrieve the data and I soon realised that I had forgotten to set the username / password on the SOAP send ports. I wanted the make deployment of the BizTalk app as automated as possible because I may not be present when it is deployed to the live server. I opened up the binding file, located the 1st of the problem SOAP send ports and looked for the * that BizTalk uses to replace the password - except that it doesn't! It seems that the password for SOAP ports is set to NULL rather than *, see here for more details: http://msdn.microsoft.com/en-us/library/aa547319.aspx

I proceeded to update the binding but when I came to test, after importing my amended binding file, I found that I had the same problem as before. I've double checked and can confim that the correct password is now present in the binding file but, although BizTalk doesn't complain during the import, when I run the app I get the following exception:

Details:"ArgumentNullException: String reference not set to an instance of a String. Parameter name: s ".

If I then manually amend the password through the BizTalk admin console everything work fine.

Has anyone else had a similar problem with the bindings for a SOAP port - does anyone have a solution?

A: 

I've never seen this problem before - I'm doing exactly what you are trying to do and it works perfectly.

I've included the <TransportTypeData> element from one of my BizTalk bindings that works. Hopefully having something to compare against helps.

<TransportTypeData>
&lt;CustomProps&gt;
&lt;AuthenticationScheme vt="8"&gt;Basic&lt;/AuthenticationScheme&gt;
&lt;AssemblyName vt="8"&gt;WebService.ProxyClass, Version=1.0.0.0, 
Culture=neutral, PublicKeyToken=xyz&lt;/AssemblyName&gt;
&lt;Username vt="8"&gt;soapUser&lt;/Username&gt;
&lt;UseProxy vt="11"&gt;0&lt;/UseProxy&gt;
&lt;UseSoap12 vt="11"&gt;0&lt;/UseSoap12&gt;&lt;UsingOrchestration vt="11"&gt;0&lt;/UsingOrchestration&gt;
&lt;UseSSO vt="11"&gt;0&lt;/UseSSO&gt;
&lt;Password vt="8"&gt;MYPASSWORD&lt;/Password&gt;
&lt;ProxyPort vt="3"&gt;80&lt;/ProxyPort&gt;&lt;AssemblyPath
vt="8"&gt;C:\ProxyClass\bin\Debug\ProxyClass.dll&lt;/AssemblyPath&gt;
&lt;TypeName vt="8"&gt;ProxyClass.Webservice.servicesService&lt;/TypeName&gt;
&lt;MethodName vt="8"&gt;PickupRequest&lt;/MethodName&gt;
&lt;UseHandlerSetting vt="11"&gt;-1&lt;/UseHandlerSetting&gt;
&lt;/CustomProps&gt;
</TransportTypeData>
David Hall
Thanks for your help help David. In fact - your binding is subtly different you have the vt="8" attribute. So easily missed - certainly one to remember for the future.
Rob Bowman
+3  A: 

I've been bit by something like this in the past. The password is either put in as '****'. This is ok. I wouldn't want all of my secrets exported with the binding file. What does get you is when you export the bindings and you leave the password NULL. The Variable Type (vt) attribute on the XML element for the password is set to vt="1" which is the same as NULL. It won't matter what you put in for the password. It may even cause the error you described. I would suggest you include a copy of the binding XML for review.

ChrisLoris
Excellent, thanks Chris. I change the attribute to vt="8" (apparently 8=BSTR) and it worked :)
Rob Bowman
Awesome! Glad I could be of help. Mark me as the answer if you don't mind. I'm new and want to build the old rep!
ChrisLoris
Hmm... not sure I can force "mark as answer", but a definite +1 from me
Marc Gravell
A: 

Thanks Chris, it was the vt attribute that got me. Once I set this to 8 (BSTR) it worked fine.

Rob Bowman
@Rob: It looks like you meant to accept Chris's answer, not your own.
Bill the Lizard
@Rob: what he said ;-p
Marc Gravell
doh! sorry, accepted Chris's answer now
Rob Bowman